EHCI: Update qTD next pointer in QH overlay region during unlink
authorPavankumar Kondeti <pkondeti@codeaurora.org>
Fri, 7 Sep 2012 05:53:28 +0000 (11:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2012 23:01:37 +0000 (16:01 -0700)
commit3d037774b42ed677f699b1dce7d548d55f4e4c2b
tree61a78695b8c846114038cd8b66a7e92e939d4423
parent6a44886899ef8cc396e230e492e6a56a883889f3
EHCI: Update qTD next pointer in QH overlay region during unlink

There is a possibility of QH overlay region having reference to a stale
qTD pointer during unlink.

Consider an endpoint having two pending qTD before unlink process begins.
The endpoint's QH queue looks like this.

qTD1 --> qTD2 --> Dummy

To unlink qTD2, QH is removed from asynchronous list and Asynchronous
Advance Doorbell is programmed.  The qTD1's next qTD pointer is set to
qTD2'2 next qTD pointer and qTD2 is retired upon controller's doorbell
interrupt.  If QH's current qTD pointer points to qTD1, transfer overlay
region still have reference to qTD2. But qtD2 is just unlinked and freed.
This may cause EHCI system error.  Fix this by updating qTD next pointer
in QH overlay region with the qTD next pointer of the current qTD.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-q.c