[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7g/JA0KZukK+41g@kroah.com>
Date: Fri, 6 Jan 2023 16:32:52 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Matthias Kaehlcke <mka@...omium.org>
Cc: Johan Hovold <johan@...nel.org>, linux-usb@...r.kernel.org,
Stefan Wahren <stefan.wahren@...e.com>,
Alexander Stein <alexander.stein@...tq-group.com>,
Icenowy Zheng <uwu@...nowy.me>,
Douglas Anderson <dianders@...omium.org>,
stable@...r.kernel.org, linux-kernel@...r.kernel.org,
Ravi Chandra Sadineni <ravisadineni@...omium.org>
Subject: Re: [PATCH 1/2] usb: misc: onboard_hub: Invert driver registration
order
On Thu, Jan 05, 2023 at 11:03:28PM +0000, Matthias Kaehlcke wrote:
> 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@...r.kernel.org
> Fixes: 8bc063641ceb ("usb: misc: Add onboard_usb_hub driver")
> Link: https://lore.kernel.org/lkml/Y6W00vQm3jfLflUJ@hovoldconsulting.com/T/#m0d64295f017942fd988f7c53425db302d61952b4
> Reported-by: Alexander Stein <alexander.stein@...tq-group.com>
> Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
> ---
>
> drivers/usb/misc/onboard_usb_hub.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Does this superseed this thread:
Link: https://lore.kernel.org/r/20221222022605.v2.1.If5e7ec83b1782e4dffa6ea759416a27326c8231d@changeid
or is that also needed?
confused,
greg k-h
Powered by blists - more mailing lists