OpenCloudOS-Kernel/drivers/usb
Matthias Kaehlcke e5854355d7 usb: misc: onboard_hub: Invert driver registration order
The onboard_hub 'driver' consists of two drivers, a platform
driver and a USB driver. Currently when the onboard hub driver
is initialized it first registers the platform driver, then the
USB driver. This results in a race condition when the 'attach'
work is executed, which is scheduled when the platform device
is probed. The purpose of fhe 'attach' work is to bind elegible
USB hub devices to the onboard_hub USB driver. This fails if
the work runs before the USB driver has been registered.

Register the USB driver first, then the platform driver. This
increases the chances that the onboard_hub USB devices are probed
before their corresponding platform device, which the USB driver
tries to locate in _probe(). The driver already handles this
situation and defers probing if the onboard hub platform device
doesn't exist yet.

Cc: stable@vger.kernel.org
Fixes: 8bc063641c ("usb: misc: Add onboard_usb_hub driver")
Link: https://lore.kernel.org/lkml/Y6W00vQm3jfLflUJ@hovoldconsulting.com/T/#m0d64295f017942fd988f7c53425db302d61952b4
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/20230110172954.v2.1.I75494ebee7027a50235ce4b1e930fa73a578fbe2@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 17:06:50 +01:00
..
atm usb: move from strlcpy with unused retval to strscpy 2022-08-19 11:08:54 +02:00
c67x00 USB: c67x00: remove unnecessary check of res 2022-05-12 11:36:46 +02:00
cdns3 usb: cdns3: remove fetched trb from cache before dequeuing 2023-01-17 16:35:47 +01:00
chipidea usb: chipidea: core: fix possible constant 0 if use IS_ERR(ci->role_switch) 2023-01-17 17:05:02 +01:00
class USB: make devnode() callback in usb_class_driver take a const * 2022-10-20 12:11:56 +02:00
common Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout" 2022-12-28 11:22:30 +01:00
core usb: acpi: add helper to check port lpm capability using acpi _DSM 2023-01-17 16:37:24 +01:00
dwc2 usb: dwc2: power on/off phy for peripheral mode in dual-role mode 2022-12-08 16:50:56 +01:00
dwc3 usb: dwc3: gadget: Ignore End Transfer delay on teardown 2023-01-06 16:32:10 +01:00
early usb: early: xhci-dbc: use console_is_registered() 2022-12-02 11:25:02 +01:00
fotg210 usb: fotg210-udc: fix error return code in fotg210_udc_probe() 2023-01-06 09:12:31 +01:00
gadget USB: gadgetfs: Fix race between mounting and unmounting 2023-01-17 16:36:15 +01:00
host xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables 2023-01-17 16:37:24 +01:00
image usb/image: fix repeated words in comments 2022-07-27 14:33:53 +02:00
isp1760 usb: isp1760: Fix out-of-bounds array access 2022-05-19 18:10:59 +02:00
misc usb: misc: onboard_hub: Invert driver registration order 2023-01-17 17:06:50 +01:00
mon usb: mon: make mmapped memory read only 2022-09-22 15:52:29 +02:00
mtu3 usb: mtu3: fix failed runtime suspend in host only mode 2022-09-30 13:55:48 +02:00
musb usb: musb: fix error return code in omap2430_probe() 2023-01-17 17:05:58 +01:00
phy usb: isp1301-omap: Convert to i2c's .probe_new() 2022-11-22 17:33:27 +01:00
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-06-21 16:39:03 +02:00
roles Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
serial treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
storage usb-storage: apply IGNORE_UAS only for HIKSEMI MD202 on RTL9210 2023-01-17 16:37:04 +01:00
typec usb: ucsi: Ensure connector delayed work items are flushed 2023-01-17 17:06:18 +01:00
usbip Including fixes from bpf, netfilter and can. 2022-12-21 08:41:32 -08:00
Kconfig usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
Makefile usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
usb-skeleton.c usb: add usb_set_intfdata() documentation 2022-11-29 08:56:09 +01:00