linux/drivers/usb
Serge Semin 6e3c8beb4f usb: usb251xb: Lock i2c-bus segment the hub resides
SMBus slave configuration is activated by CFG_SEL[1:0]=0x1 pins
state. This is the mode the hub is supposed to be to let this driver
work correctly. But a race condition might happen right after reset
is cleared due to CFG_SEL[0] pin being multiplexed with SMBus SCL
function. In case if the reset pin is handled by a i2c GPIO expander,
which is also placed at the same i2c-bus segment as the usb251x
SMB-interface connected to, then the hub reset clearance might
cause the CFG_SEL[0] being latched in unpredictable state. So
sometimes the hub configuration mode might be 0x1 (as expected),
but sometimes being 0x0, which doesn't imply to have the hub SMBus-slave
interface activated and consequently causes this driver failure.

In order to fix the problem we must make sure the GPIO-reset chip doesn't
reside the same i2c-bus segment as the SMBus-interface of the hub. If
it doesn't, we can safely block the segment for the time the reset is
cleared to prevent anyone generating a traffic at the i2c-bus SCL lane
connected to the CFG_SEL[0] pin. But if it does, nothing we can do, so
just return an error. If we locked the i2c-bus segment and tried to
communicate with the GPIO-expander, it would cause a deadlock. If we didn't
lock the i2c-bus segment, it would randomly cause the CFG_SEL[0] bit flip.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 10:59:03 +02:00
..
atm USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
c67x00
chipidea usb: chipidea: msm: get optional clock by devm_clk_get_optional() 2019-04-19 14:24:26 +02:00
class usb: cdc-acm: fix race during wakeup blocking TX traffic 2019-03-28 00:08:49 +09:00
common Merge 5.1-rc3 into usb-next 2019-04-01 07:42:04 +02:00
core USB: core: Don't unbind interfaces following device reset failure 2019-04-17 14:46:58 +02:00
dwc2 usb: dwc2: get optional clock by devm_clk_get_optional() 2019-04-19 14:24:26 +02:00
dwc3 usb: dwc3: Allow building USB_DWC3_QCOM without EXTCON 2019-04-25 10:59:03 +02:00
early memblock: drop memblock_alloc_*_nopanic() variants 2019-03-12 10:04:02 -07:00
gadget Merge 5.1-rc3 into usb-next 2019-04-01 07:42:04 +02:00
host usb: host: xhci-plat: get optional clock by devm_clk_get_optional() 2019-04-19 14:24:25 +02:00
image USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
isp1760 USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
misc usb: usb251xb: Lock i2c-bus segment the hub resides 2019-04-25 10:59:03 +02:00
mon USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
mtu3 usb: mtu3: get optional clock by devm_clk_get_optional() 2019-04-19 14:24:26 +02:00
musb USB: musb: mark expected switch fall-through 2019-02-13 19:40:20 +01:00
phy USB: changes for v5.1 merge window 2019-02-15 09:08:57 +01:00
renesas_usbhs USB: renesas_usbhs: fix spelling mistake "doens't" -> "doesn't" 2019-02-19 14:41:38 +01:00
roles usb: roles: Find the muxes by also matching against the device node 2019-02-14 10:52:25 +01:00
serial USB: serial: option: add Olicard 600 2019-03-28 09:27:22 +01:00
storage usb-storage: Set virt_boundary_mask to avoid SG overflows 2019-04-16 20:43:34 +02:00
typec usb: typec: fusb302: Revert "Resolve fixed power role contract setup" 2019-04-19 14:23:34 +02:00
usbip usbip: stub_rx: tidy the indenting in is_clear_halt_cmd() 2019-04-25 10:59:02 +02:00
wusbcore wusb: Remove unnecessary static function ckhdid_printf 2019-03-01 20:53:41 +01:00
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile usb: roles: Add Intel xHCI USB role switch driver 2018-03-22 13:49:27 +01:00
usb-skeleton.c usb: usb-skeleton: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00