devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Saravana Kannan <saravanak@google.com>,
	Tudor Ambarus <tudor.ambarus@microchip.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>,
	Nicolas Saenz Julienne <nsaenz@kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org
Subject: Re: dwc2: RPi 3 B plus - USB mass storage boot broken
Date: Tue, 29 Jun 2021 23:31:56 +0200	[thread overview]
Message-ID: <6104f60b-9ba2-523f-de4b-af42b6c67e2e@i2se.com> (raw)
In-Reply-To: <a385bbdf-8806-896d-5b9a-d26df907e43a@i2se.com>

Am 29.06.21 um 13:37 schrieb Stefan Wahren:
> Hi,
>
> i noticed more fallout connected to the recent fw_devlink changes in
> Linux 5.13. Since fw_devlink=on the Raspberry Pi 3 B Plus
> (multi_v7_defconfig, 32 bit) is unable to boot from USB because the dwc2
> driver probe too late and the kernel waits endlessly for the rootfs.
> Switching fw_devlink back to permissive makes the dwc2 driver probe
> earlier and make USB mass storage boot work again.
>
> Here are some dmesg extracts taken from a Raspberry Pi 3 B Plus (5.13,
> multi_v7_defconfig, booting from SD card to show good and bad case):
>
> fw_devlink=permissive
>
> [    2.198105] calling  dwc2_platform_driver_init+0x0/0x10 @ 1
> [    2.198663] initcall dwc2_platform_driver_init+0x0/0x10 returned 0
> after 529 usecs
> [    4.156494] dwc2 3f980000.usb: supply vusb_d not found, using dummy
> regulator
> [    4.174514] dwc2 3f980000.usb: supply vusb_a not found, using dummy
> regulator
> [    4.242973] dwc2 3f980000.usb: DWC OTG Controller
> [    4.259505] dwc2 3f980000.usb: new USB bus registered, assigned bus
> number 1
> [    4.278483] dwc2 3f980000.usb: irq 66, io mem 0x3f980000
> [    4.759700] usb 1-1: new high-speed USB device number 2 using dwc2
> [    5.359793] usb 1-1.1: new high-speed USB device number 3 using dwc2
> [    5.899703] usb 1-1.2: new low-speed USB device number 4 using dwc2
> [    6.149705] usb 1-1.1.3: new low-speed USB device number 5 using dwc2
> [    6.629761] usb 1-1.1.1: new high-speed USB device number 6 using dwc2
>
> fw_devlink=on
>
> [    2.198579] calling  dwc2_platform_driver_init+0x0/0x10 @ 1
> [    2.199021] initcall dwc2_platform_driver_init+0x0/0x10 returned 0
> after 416 usecs
> [    7.693987] dwc2 3f980000.usb: supply vusb_d not found, using dummy
> regulator
> [    7.694228] dwc2 3f980000.usb: supply vusb_a not found, using dummy
> regulator
> [    7.747111] dwc2 3f980000.usb: DWC OTG Controller
> [    7.747152] dwc2 3f980000.usb: new USB bus registered, assigned bus
> number 1
> [    7.747192] dwc2 3f980000.usb: irq 66, io mem 0x3f980000
> [    8.179985] usb 1-1: new high-speed USB device number 2 using dwc2
> [    8.749920] usb 1-1.1: new high-speed USB device number 3 using dwc2
> [    9.179900] usb 1-1.2: new low-speed USB device number 4 using dwc2
> [    9.409951] usb 1-1.1.3: new low-speed USB device number 5 using dwc2
> [    9.849927] usb 1-1.1.1: new high-speed USB device number 6 using dwc2
>
> Unfortunately i wasn't able to find the root cause for this delay of 3
> seconds during boot. I noticed that usb_phy_generic_init is called very
> late. Maybe this is related.

I was able to investigate this further. The Raspberry Pi has a PHY
defined in device tree ( compatible = "usb-nop-xceiv", bcm283x.dtsi )
and in arm/multi_v7_defconfig the relevant driver is compiled as a module.

The dwc2 platform code attempt to find the optional PHY. With
fw_devlink=permissive the dwc2 driver seems to fail getting the PHY and
proceed. But with fw_devlink=on the dwc2 driver seems to go the
EPROBE_DEFER path and wait endlessly for the PHY driver which isn't
built into the kernel. This PHY handling was a troublemaker in the past [1]

So there are two workarounds to avoid this issue with fw_devlink=on:

a) make CONFIG_NOP_USB_XCEIV=y for multi_v7_defconfig
b) remove the usb-nop-xceiv PHY from the device tree

But it would be nice to have a clean solution.

Best regards
Stefan

[1] -
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20180112101223.3661181-1-arnd@arndb.de/

>
> Best regards
> Stefan
>
>


      reply	other threads:[~2021-06-29 21:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 11:37 dwc2: RPi 3 B plus - USB mass storage boot broken Stefan Wahren
2021-06-29 21:31 ` Stefan Wahren [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=6104f60b-9ba2-523f-de4b-af42b6c67e2e@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=Minas.Harutyunyan@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=m.szyprowski@samsung.com \
    --cc=nsaenz@kernel.org \
    --cc=saravanak@google.com \
    --cc=tudor.ambarus@microchip.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 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).