All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, regressions@lists.linux.dev,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: Regression: onboard-usb-hub breaks USB on RPi 3
Date: Mon, 19 Dec 2022 17:44:15 +0000	[thread overview]
Message-ID: <Y6Ci7wWvbBRRQkR6@google.com> (raw)
In-Reply-To: <d04bcc45-3471-4417-b30b-5cf9880d785d@i2se.com>

Hi Stefan,

Sorry for the regression.

What seems to happen is this:

arch/arm/boot/dts/bcm283x-rpi-lan7515.dtsi specifies device nodes for the
two (nested) USB hubs (which is done rarely since USB devices (including
hubs) are autodetected). The DT nodes were most likely only added to be
able to configure the LED modes of the USB to Ethernet adapter. With
43993626de00 ("usb: misc: onboard-hub: add support for Microchip USB2514B
USB 2.0 hub") the onboard_usb_hub driver gained support for the hubs on
the RPi3. The onboard_usb_hub driver expects a regulator ("vdd") in the DT
node of the USB hub, which isn't present for the RPi3 (this isn't an error
per se). Without the regulator the onboard_hub platform driver fails to
probe, when the USB driver of the hub is probed (onboard_hub_usbdev_probe())
it doesn't find the corresponding platform driver instance
(_find_onboard_hub()) and defers probing. When the deferred probe runs it
encounters the same situation, rinse and repeat.

One possible fix would be to specify the 'missing' "vdd" property, however
that wouln't fix the issue for other boards with a similar configurations.
Instead the driver could check if "vdd" exists in the DT node of the hub,
and not defer probing if it doesn't.

Could you please try if the below patch fixes the issue on the Rpi 3?

Thanks

m.


diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c
index d63c63942af1..4d2a27afb09c 100644
--- a/drivers/usb/misc/onboard_usb_hub.c
+++ b/drivers/usb/misc/onboard_usb_hub.c
@@ -363,6 +363,15 @@ static struct onboard_hub *_find_onboard_hub(struct device *dev)
 	hub = dev_get_drvdata(&pdev->dev);
 	put_device(&pdev->dev);
 
+	/*
+	 * Some boards have device tree nodes for USB hubs supported by this
+	 * driver, but the nodes don't have all properties needed for the driver
+	 * to work properly. Use the absence of the "vdd" regulator as an
+	 * indicator of such nodes.
+	 */
+	if (!of_get_property(pdev->dev.of_node, "vdd", NULL))
+		return ERR_PTR(-ENODEV);
+
 	/*
 	 * The presence of drvdata ('hub') indicates that the platform driver
 	 * finished probing. This handles the case where (conceivably) we could



On Sun, Dec 18, 2022 at 02:35:43PM +0100, Stefan Wahren wrote:
> Hi,
> 
> unfortunately i didn't notice this regression sooner, but the following
> commits breaks USB on Raspberry Pi 3:
> 
> usb: misc: Add onboard_usb_hub driver
> usb: misc: onboard-hub: add support for Microchip USB2514B USB 2.0 hub
> 
> After these commits (and this new driver enabled like in multi_v7_defconfig)
> the connected USB devices doesn't work anymore (mouse is powered, but no
> function of keyboard and mouse). Reconnecting doesn't help. Running lsusb
> hangs forever.
> 
> Here is the relevant dmesg in error case:
> 
> [    0.078446] usbcore: registered new interface driver usbfs
> [    0.078516] usbcore: registered new interface driver hub
> [    0.078574] usbcore: registered new device driver usb
> [    0.078827] usb_phy_generic phy: supply vcc not found, using dummy
> regulator
> [    0.078990] usb_phy_generic phy: dummy supplies not allowed for exclusive
> requests
> [    2.897258] usbcore: registered new interface driver pegasus
> [    2.903161] usbcore: registered new interface driver asix
> [    2.908809] usbcore: registered new interface driver ax88179_178a
> [    2.915185] usbcore: registered new interface driver cdc_ether
> [    2.921281] usbcore: registered new interface driver smsc75xx
> [    2.927305] usbcore: registered new interface driver smsc95xx
> [    2.933298] usbcore: registered new interface driver net1080
> [    2.939219] usbcore: registered new interface driver cdc_subset
> [    2.945407] usbcore: registered new interface driver zaurus
> [    2.951238] usbcore: registered new interface driver cdc_ncm
> [    3.030909] usbcore: registered new interface driver usb-storage
> [    3.178104] usbcore: registered new interface driver usbhid
> [    3.191022] usbhid: USB HID core driver
> [    3.981848] dwc2 3f980000.usb: supply vusb_d not found, using dummy
> regulator
> [    3.992467] dwc2 3f980000.usb: supply vusb_a not found, using dummy
> regulator
> [    4.053728] dwc2 3f980000.usb: DWC OTG Controller
> [    4.065343] dwc2 3f980000.usb: new USB bus registered, assigned bus
> number 1
> [    4.079415] dwc2 3f980000.usb: irq 66, io mem 0x3f980000
> [    4.463447] usb 1-1: new high-speed USB device number 2 using dwc2
> [    5.063444] usb 1-1.1: new high-speed USB device number 3 using dwc2
> [    5.523440] usb 1-1.3: new low-speed USB device number 4 using dwc2
> [    5.685546] input: HID 046a:0011 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:046A:0011.0001/input/input0
> [    5.763446] usb 1-1.1.2: new low-speed USB device number 5 using dwc2
> [    5.777968] hid-generic 0003:046A:0011.0001: input: USB HID v1.11
> Keyboard [HID 046a:0011] on usb-3f980000.usb-1.3/input0
> [    5.931991] input: PixArt Microsoft USB Optical Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0/0003:045E:00CB.0002/input/input1
> [    5.954668] hid-generic 0003:045E:00CB.0002: input: USB HID v1.11 Mouse
> [PixArt Microsoft USB Optical Mouse] on usb-3f980000.usb-1.1.2/input0
> [    6.263459] usb 1-1.1.1: new high-speed USB device number 6 using dwc2
> [   14.828915] onboard-usb-hub 3f980000.usb:usb-port@1: supply vdd not
> found, using dummy regulator
> [   14.829493] onboard-usb-hub 3f980000.usb:usb-port@1:usb-port@1: supply
> vdd not found, using dummy regulator
> [   14.829729] usbcore: registered new device driver onboard-usb-hub
> [   14.829945] usb 1-1.1: USB disconnect, device number 3
> [   14.829958] usb 1-1.1.1: USB disconnect, device number 6
> [   14.830419] usb 1-1.1.2: USB disconnect, device number 5
> [   14.854725] usb 1-1.3: USB disconnect, device number 4
> [   14.896865] usbcore: registered new interface driver lan78xx
> 
> Unfortunately i'm not that USB expert, so please tell me if you need more
> information.
> 

  parent reply	other threads:[~2022-12-19 17:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-18 13:35 Regression: onboard-usb-hub breaks USB on RPi 3 Stefan Wahren
2022-12-19 10:41 ` Regression: onboard-usb-hub breaks USB on RPi 3 #forregzbot Thorsten Leemhuis
2022-12-19 17:44 ` Matthias Kaehlcke [this message]
2022-12-19 22:32   ` Regression: onboard-usb-hub breaks USB on RPi 3 Stefan Wahren
2022-12-20  0:30     ` Matthias Kaehlcke
2022-12-20 16:19       ` Stefan Wahren
2022-12-20 22:50         ` Matthias Kaehlcke
2022-12-21 12:29           ` Stefan Wahren
2022-12-21 16:50             ` Matthias Kaehlcke
2022-12-21 18:00               ` Stefan Wahren
2022-12-21 19:02                 ` Matthias Kaehlcke
2022-12-21 21:31                   ` Stefan Wahren
2022-12-22  0:55                     ` Matthias Kaehlcke
2022-12-22 11:19                       ` Stefan Wahren
2022-12-27 13:15                     ` Stefan Wahren

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=Y6Ci7wWvbBRRQkR6@google.com \
    --to=mka@chromium.org \
    --cc=f.fainelli@gmail.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=stefan.wahren@i2se.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.