]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Check if slot is already in default state before moving it there
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 9 Jan 2015 15:18:28 +0000 (17:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jan 2015 17:45:30 +0000 (09:45 -0800)
commitc8152b634d34baefe58cc74f7adf57f984662de7
treec3d93f9f525b318b561a84ae728fed699e1a6b7a
parent4a301d2f1e646de65a368b7b0bdcef89a5140faa
xhci: Check if slot is already in default state before moving it there

Solves xhci error cases with debug messages:
xhci_hcd 0000:00:14.0: Setup ERROR: setup context command for slot 1.
usb 1-6: hub failed to enable device, error -22

xhci will give a context state error if we try to set a slot in default
state to the same default state with a special address device command.

Turns out this happends in several cases:
- retry reading the device rescriptor in hub_port_init()
- usb_reset_device() is called for a slot in default state
- in resume path, usb_port_resume() calls hub_port_init()

The default state is usually reached from most states with a reset device
command without any context state errors, but using the address device
command with BSA bit set (block set address) only works from the enabled
state and will otherwise cause context error.

solve this by checking if we are already in the default state before issuing
a address device BSA=1 command.

Fixes: 59d73dd69cf2 ("usb: xhci: change enumeration scheme to 'new scheme'")
Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c