From: Matthias Kaehlcke <mka@chromium.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Johan Hovold <johan@kernel.org>,
linux-usb@vger.kernel.org, Stefan Wahren <stefan.wahren@i2se.com>,
Alexander Stein <alexander.stein@ew.tq-group.com>,
Icenowy Zheng <uwu@icenowy.me>,
Douglas Anderson <dianders@chromium.org>,
stable@vger.kernel.org, linux-kernel@vger.kernel.org,
Ravi Chandra Sadineni <ravisadineni@chromium.org>
Subject: Re: [PATCH 1/2] usb: misc: onboard_hub: Invert driver registration order
Date: Fri, 6 Jan 2023 16:13:38 +0000 [thread overview]
Message-ID: <Y7hIsvAG3QWb/PmL@google.com> (raw)
In-Reply-To: <Y7g/JA0KZukK+41g@kroah.com>
On Fri, Jan 06, 2023 at 04:32:52PM +0100, Greg Kroah-Hartman wrote:
> 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@vger.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@ew.tq-group.com>
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.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
This series ("usb: misc: onboard_hub: Invert driver registration order"
et al) fixes the race condition mentioned in the commit message
of the other series ("usb: misc: onboard_usb_hub: Don't create platform
devices for DT nodes without 'vdd-supply'" et al), plus another race
that was reported later (this patch).
> or is that also needed?
This series is (mostly) independent from the other one, it should
fix the issue that was reported for the RPi 3 B+. It can be landed
even if the other one is abandonded.
With this series the other one doesn't fix or mitigate any actual
issue (AFAIK), it would only be an optimization (don't instantiate
the onboard_hub drivers if they'd do nothing).
> confused
Sorry, hope this clarifies things a bit.
prev parent reply other threads:[~2023-01-06 16:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 23:03 [PATCH 1/2] usb: misc: onboard_hub: Invert driver registration order Matthias Kaehlcke
2023-01-05 23:03 ` [PATCH 2/2] usb: misc: onboard_hub: Move 'attach' work to the driver Matthias Kaehlcke
2023-01-07 17:23 ` Stefan Wahren
2023-01-08 10:47 ` Stefan Wahren
2023-01-09 17:40 ` Matthias Kaehlcke
2023-01-09 20:19 ` Stefan Wahren
2023-01-10 1:07 ` Matthias Kaehlcke
2023-01-06 15:32 ` [PATCH 1/2] usb: misc: onboard_hub: Invert driver registration order Greg Kroah-Hartman
2023-01-06 16:13 ` Matthias Kaehlcke [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y7hIsvAG3QWb/PmL@google.com \
--to=mka@chromium.org \
--cc=alexander.stein@ew.tq-group.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ravisadineni@chromium.org \
--cc=stable@vger.kernel.org \
--cc=stefan.wahren@i2se.com \
--cc=uwu@icenowy.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).