]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xHCI: fix bug in xhci_clear_command_ring()
authorAndiry Xu <andiry.xu@amd.com>
Wed, 30 Nov 2011 08:37:41 +0000 (16:37 +0800)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Fri, 16 Dec 2011 01:38:08 +0000 (17:38 -0800)
commit98662c27e9c6a952ac4e07081c28f7c6a2b27cc4
tree04e5e9b0bd3d1de86577f07590c68870c9cf4262
parent734d2fe4a93d629f437302bf7df8efdafb2560cc
xHCI: fix bug in xhci_clear_command_ring()

commit 158886cd2cf4599e04f9b7e10cb767f5f39b14f1 upstream.

When system enters suspend, xHCI driver clears command ring by writing zero
to all the TRBs. However, this also writes zero to the Link TRB, and the ring
is mangled. This may cause driver accesses wrong memory address and the
result is unpredicted.

When clear the command ring, keep the last Link TRB intact, only clear its
cycle bit. This should fix the "command ring full" issue reported by Oliver
Neukum.

This should be backported to stable kernels as old as 2.6.37, since the
commit 89821320 "xhci: Fix command ring replay after resume" is merged.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci.c