Raspberry Pi 4B: USB OTG is not working

Bug #1861070 reported by Enoch Leung
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux-raspi (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Medium
Unassigned
linux-raspi2 (Ubuntu)
Fix Released
High
Hui Wang
Eoan
Fix Released
High
Unassigned

Bug Description

[Impact]
On the RPI4B board, the usb-c power port could also work as a USB
OTG mode, but we set the dwc2 driver to the host mode
unconditionally, now set it to dual_role mode, then it could work
in host/otg/peripheal mode.

[Fix]
Set USB_DWC2_DUAL_ROLE=y, USB_DWC2_HOST=n

[Test Case]
set the dtoverlay=dwc2,dr_mode=[otg|peripheral] in the config.txt,
and isnmod the g_ether or g_cdc, on the host machine, we could see
RPI4B work as a usb device.

Because physical port limitation, could test dr_mode=host.

[Regression Risk]
Low, our eoan kernel choose dwc_otg driver for this port by default,
very very few users will choose dwc2 driver, and the dwc2 driver is
not enabled by default in our kernel.

And bug reporter and I already tested that the peripheral mode works
after this change.

I am using Raspberry Pi 4B (4GB) and want to make use of the OTG functionality (g_ether). I cross checked with Raspbian to make sure it is not a hardware issue. Extract from dmesg of Ubuntu 19.10.1 with latest updates applied as of Jan 26th, 2020 via "apt-get update" and "apt-get full-upgrade":

...
[ 1.514262] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.517365] dwc_otg: FIQ enabled
[ 1.517376] dwc_otg: NAK holdoff enabled
[ 1.517386] dwc_otg: FIQ split-transaction FSM enabled
[ 1.517399] Module dwc_common_port init
...
[ 6.358332] dwc2 fe980000.usb: fe980000.usb supply vusb_d not found, using dummy regulator
[ 6.358388] dwc2 fe980000.usb: fe980000.usb supply vusb_a not found, using dummy regulator
[ 6.358545] dwc2 fe980000.usb: Configuration mismatch. dr_mode forced to host
[ 6.409098] dwc2 fe980000.usb: DWC OTG Controller
[ 6.409399] dwc2 fe980000.usb: new USB bus registered, assigned bus number 3
[ 6.409432] dwc2 fe980000.usb: irq 23, io mem 0xfe980000
...
[ 111.796714] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers

I think it is that "Configuration mismatch. dr_mode forced to host" log entry telling me that the port is acting as HOST mode instead of OTG mode. I have try putting these in usercfg.txt

"dtoverlay=dwc2"
"dtoverlay=dwc2,dr_mode=otg"
"dtoverlay=dwc2,dr_mode=peripheral"

and it will give the same result, no OTG functionality.

On the same hardware running Raspbian Buster, it initialise successfully. Corresponding dmesg:
...
[ 0.567531] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 0.570391] dwc_otg: FIQ enabled
[ 0.570400] dwc_otg: NAK holdoff enabled
[ 0.570409] dwc_otg: FIQ split-transaction FSM enabled
[ 0.570421] Module dwc_common_port init
...
[ 2.507634] dwc2 fe980000.usb: fe980000.usb supply vusb_d not found, using dummy regulator
[ 2.511011] dwc2 fe980000.usb: Linked as a consumer to regulator.0
[ 2.514450] dwc2 fe980000.usb: fe980000.usb supply vusb_a not found, using dummy regulator
[ 2.731860] dwc2 fe980000.usb: dwc2_check_params: Invalid parameter lpm=1
[ 2.735511] dwc2 fe980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
[ 2.735522] dwc2 fe980000.usb: dwc2_check_params: Invalid parameter besl=1
[ 2.735533] dwc2 fe980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1
[ 2.735582] dwc2 fe980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 2.752511] dwc2 fe980000.usb: DWC OTG Controller
[ 2.752554] dwc2 fe980000.usb: new USB bus registered, assigned bus number 3
[ 2.752601] dwc2 fe980000.usb: irq 36, io mem 0xfe980000
...
[ 2.848843] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[ 2.851601] g_ether gadget: g_ether ready
[ 2.854580] dwc2 fe980000.usb: bound driver g_ether
[ 2.998525] dwc2 fe980000.usb: new device is high-speed
[ 3.075025] dwc2 fe980000.usb: new device is high-speed
[ 3.139338] dwc2 fe980000.usb: new address 10
[ 3.154010] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)

CVE References

Revision history for this message
Hui Wang (hui.wang) wrote :

I remember on the rpi4B board, there is no physical usb-otg port at all? could you please tell me which port is for otg?

Hui Wang (hui.wang)
Changed in linux-raspi2 (Ubuntu):
assignee: nobody → Hui Wang (hui.wang)
importance: Undecided → High
Revision history for this message
Enoch Leung (leun0036) wrote : Re: [Bug 1861070] Re: Raspberry Pi 4B: USB OTG is not working
Download full text (4.3 KiB)

Thanks for quick reply. It is the same USB-C power supply port which can also work as OTG port. I tried Raspbian Buster + g_ether with USB cable connecting to my machine (Lenovo L470 on docking), and it is detected. On both Raspbian and my L470 running Ubuntu 19.10, usb0 are created when I do “ip addr”. I am using a ‘dual port USB cable’ so that I can provide 2.1A from a USB power supply + 0.5A from PC’s USB port, so it is not a concern in term of powering up my Pi 4B.

Pls. Let me know if there is anything I can help in fixing this bug, thanks.

Sent from my iPad

> On 28 Jan 2020, at 16:55, Hui Wang <email address hidden> wrote:
>
> I remember on the rpi4B board, there is no physical usb-otg port at all?
> could you please tell me which port is for otg?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1861070
>
> Title:
> Raspberry Pi 4B: USB OTG is not working
>
> Status in linux-raspi2 package in Ubuntu:
> New
>
> Bug description:
> I am using Raspberry Pi 4B (4GB) and want to make use of the OTG
> functionality (g_ether). I cross checked with Raspbian to make sure
> it is not a hardware issue. Extract from dmesg of Ubuntu 19.10.1 with
> latest updates applied as of Jan 26th, 2020 via "apt-get update" and
> "apt-get full-upgrade":
>
> ...
> [ 1.514262] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
> [ 1.517365] dwc_otg: FIQ enabled
> [ 1.517376] dwc_otg: NAK holdoff enabled
> [ 1.517386] dwc_otg: FIQ split-transaction FSM enabled
> [ 1.517399] Module dwc_common_port init
> ...
> [ 6.358332] dwc2 fe980000.usb: fe980000.usb supply vusb_d not found, using dummy regulator
> [ 6.358388] dwc2 fe980000.usb: fe980000.usb supply vusb_a not found, using dummy regulator
> [ 6.358545] dwc2 fe980000.usb: Configuration mismatch. dr_mode forced to host
> [ 6.409098] dwc2 fe980000.usb: DWC OTG Controller
> [ 6.409399] dwc2 fe980000.usb: new USB bus registered, assigned bus number 3
> [ 6.409432] dwc2 fe980000.usb: irq 23, io mem 0xfe980000
> ...
> [ 111.796714] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
>
> I think it is that "Configuration mismatch. dr_mode forced to host"
> log entry telling me that the port is acting as HOST mode instead of
> OTG mode. I have try putting these in usercfg.txt
>
> "dtoverlay=dwc2"
> "dtoverlay=dwc2,dr_mode=otg"
> "dtoverlay=dwc2,dr_mode=peripheral"
>
> and it will give the same result, no OTG functionality.
>
> On the same hardware running Raspbian Buster, it initialise successfully. Corresponding dmesg:
> ...
> [ 0.567531] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
> [ 0.570391] dwc_otg: FIQ enabled
> [ 0.570400] dwc_otg: NAK holdoff enabled
> [ 0.570409] dwc_otg: FIQ split-transaction FSM enabled
> [ 0.570421] Module dwc_common_port init
> ...
> [ 2.507634] dwc2 fe980000.usb: fe980000.usb supply vusb_d not found, using dummy regulator
> [ 2.511011] dwc2 fe980000.usb: Linked as a consumer to regulator.0
> [ 2.514450] dwc2 fe980000.usb: fe980000.usb supply vusb_a not found,...

Read more...

Revision history for this message
Hui Wang (hui.wang) wrote :

In the ubuntu kernel, we set "CONFIG_USB_DWC2_HOST=y". Let's change it to "CONFIG_USB_DWC2_DUAL_ROLE=y".

And I remember the driver dwc_otg work while the dwc2/3 doesn't work in the kernel, since the dwc_otg is highly optimized.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please test this kernel. this kernel enabled dual_role.

https://people.canonical.com/~hwang4/otg/

Revision history for this message
Enoch Leung (leun0036) wrote :

Thanks Hui for the new kernel. It is not fully working yet though. I attach the two "dmesg --color=always" output for your comparison.

Using your new kernel, my Pi 4B can load g_ether successfully with Ubuntu. However, OTG mode is still not working as expected. Connected to my L470 running Ubuntu 19.10, P4B on ubuntu gives:

----- this is output from dmesg on L470 -----
[114144.192312] usb 1-3.1: new high-speed USB device number 15 using xhci_hcd
[114144.572780] usb 1-3.1: device descriptor read/64, error -71
[114160.102412] usb 1-3.1: device descriptor read/64, error -110
[114160.287331] usb 1-3.1: new high-speed USB device number 16 using xhci_hcd
[114165.734418] usb 1-3.1: device descriptor read/64, error -110
[114181.606824] usb 1-3.1: device descriptor read/64, error -110
[114181.712895] usb 1-3-port1: attempt power cycle
[114182.324401] usb 1-3.1: new high-speed USB device number 17 using xhci_hcd
[114187.750644] usb 1-3.1: device descriptor read/64, error -110
[114203.622447] usb 1-3.1: device descriptor read/64, error -110
[114203.806762] usb 1-3.1: new high-speed USB device number 18 using xhci_hcd
[114209.253645] usb 1-3.1: device descriptor read/64, error -110
[114225.126520] usb 1-3.1: device descriptor read/64, error -110
[114225.233412] usb 1-3-port1: unable to enumerate USB device

when I boot my Pi 4B on Raspbian, the output is as expected:

----- this is output from dmesg on L470 -----
[114365.055969] usb 1-3.1: new high-speed USB device number 19 using xhci_hcd
[114365.146823] usb 1-3.1: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 4.19
[114365.146837] usb 1-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[114365.146844] usb 1-3.1: Product: RNDIS/Ethernet Gadget
[114365.146849] usb 1-3.1: Manufacturer: Linux 4.19.93-v7l+ with fe980000.usb
[114365.161097] cdc_subset: probe of 1-3.1:1.0 failed with error -22
[114365.162862] cdc_subset 1-3.1:1.1 usb0: register 'cdc_subset' at usb-0000:00:14.0-3.1, Linux Device, 7a:e4:85:af:64:35
[114365.162980] usbcore: registered new interface driver cdc_subset
[114365.163051] cdc_ether: probe of 1-3.1:1.0 failed with error -16
[114365.163119] usbcore: registered new interface driver cdc_ether

Any suggestion? I simply use some random values as g_ether module parameters.

Revision history for this message
Enoch Leung (leun0036) wrote :

Sorry, too haste, seems like it works a bit different than Raspbian.
Using your new kernel with this set in usercfg.txt, OTG mode is working fine.

dtoverlay=dwc2,dr_mode=peripheral

though with Raspbian, only "dtoverlay=dwc2" is needed, which was what I was using.

Revision history for this message
Hui Wang (hui.wang) wrote :

Oh, if we don't add dtoverlay=dwc2, the usb port is driven by dwc_otg driver by default, if we add dtoverlay=dwc2, then the usb port is driven by dwc2.

And I tested with only dtoverlay=dwc2 (no dr_mode=peripheral), i could see usb0 net device both from rpi4 board and my host machine (via ifconfig -a).

Revision history for this message
Enoch Leung (leun0036) wrote :

Hi Hui, just in case I tried again, but no it won't work if I put "dtoverlay=dwc2" w/o dr_mode. I remember dwc2 should be new code and should be used, hence why I use that instead of dwc_otg.

Anyway, if we use "dtoverlay=dwc2" only, I guess the actual "dr_mode" value may not be init properly in run time memory space, and thus it didn't work. Say using no "dr_mode", on my Pi 4B I can see g_cdc driver loaded correctly, but then on the host side, my L470, it actually won't work. Something like this would appear:

----- pi4 -----
[ 5.317371] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
...
[ 7.497909] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[ 7.497913] g_cdc gadget: g_cdc ready
[ 7.497921] dwc2 fe980000.usb: bound driver g_cdc

----- L470 -----
[44740.491468] usb 1-3.1: new high-speed USB device number 18 using xhci_hcd
[44741.837984] usb 1-3.1: device descriptor read/64, error -71
[44757.718734] usb 1-3.1: device descriptor read/64, error -110
[44757.902877] usb 1-3.1: new high-speed USB device number 19 using xhci_hcd
[44763.350132] usb 1-3.1: device descriptor read/64, error -110
[44779.223840] usb 1-3.1: device descriptor read/64, error -110
[44779.329078] usb 1-3-port1: attempt power cycle
[44779.942228] usb 1-3.1: new high-speed USB device number 20 using xhci_hcd
[44785.366277] usb 1-3.1: device descriptor read/64, error -110
[44801.236885] usb 1-3.1: device descriptor read/64, error -110
[44801.423944] usb 1-3.1: new high-speed USB device number 21 using xhci_hcd
[44806.870008] usb 1-3.1: device descriptor read/64, error -110
[44822.743518] usb 1-3.1: device descriptor read/64, error -110
[44822.849333] usb 1-3-port1: unable to enumerate USB device

but if I use "dtoverlay=dwc2,dr_mode=peripheral" then no problem. I didn't test the Ethernet part yet as I don't have the network part properly set up, so I tried g_cdc instead, bind console to ttyGS0 with systemd and tried login from L470 to Pi via minicom, which was successful.

Revision history for this message
Enoch Leung (leun0036) wrote :

some configuration I'd tried:
1. dtoverlay=dwc_otg, or comment out = no difference
2. with no other dtoverlay, I actually set "dtoverlay=vc4-fkms-v3d" in syscfg.txt, and comment it out or not also make no difference

I didn't grab every dmesg, but without both dwc_otg and vc4-fkms-v3d, here you go:

----- pi4 -----
[ 1.677307] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.884348] Core Release: 2.80a
[ 1.888641] Setting default values for core params
[ 1.892857] Finished setting default values for core params
[ 1.966759] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[ 2.099551] Using Buffer DMA mode
[ 2.103715] Periodic Transfer Interrupt Enhancement - disabled
[ 2.107870] Multiprocessor Interrupt Enhancement - disabled
[ 2.112043] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 2.116220] Dedicated Tx FIFOs mode
[ 2.121186] WARN::dwc_otg_hcd_init:1043: FIQ DMA bounce buffers: virt = ffff00001060b000 dma = 0x00000000f9510000 len=9024
[ 2.121384] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
[ 2.125542] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[ 2.129850] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 2.150875] dwc_otg: Microframe scheduler enabled
[ 2.155145] usb 1-1: Product: USB2.0 Hub
[ 2.155171] WARN::hcd_init_fiq:496: MPHI regs_base at ffff000010305200
[ 2.161313] hub 1-1:1.0: USB hub found
[ 2.163817] dwc_otg fe980000.usb: DWC OTG Controller
[ 2.168259] hub 1-1:1.0: 4 ports detected
[ 2.172320] dwc_otg fe980000.usb: new USB bus registered, assigned bus number 3
[ 2.180968] dwc_otg fe980000.usb: irq 24, io mem 0x00000000
[ 2.185310] Init: Port Power? op_state=1
[ 2.189549] Init: Power Port (0)
[ 2.194099] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.03
[ 2.198369] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.202590] usb usb3: Product: DWC OTG Controller
[ 2.206801] usb usb3: Manufacturer: Linux 5.3.0-1017-raspi2 dwc_otg_hcd
[ 2.211037] usb usb3: SerialNumber: fe980000.usb
[ 2.216023] hub 3-0:1.0: USB hub found
[ 2.220290] hub 3-0:1.0: 1 port detected
[ 2.225408] dwc_otg: FIQ enabled
[ 2.225419] dwc_otg: NAK holdoff enabled
[ 2.225430] dwc_otg: FIQ split-transaction FSM enabled
[ 2.225458] Module dwc_common_port init
...
[ 5.701961] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers

no more g_cdc driver related loading message afterward. so, I have to keep using "dtoverlay=dwc2,dr_mode=peripheral" at the moment

Revision history for this message
Hui Wang (hui.wang) wrote :

I tried "dtoverlay=dwc2,dr_mode=peripheral" and "dtoverlay=dwc2" with ubuntu-5.3 kernel, I could see "[18977.499410] usb 1-1.1: device descriptor read/64, error -110" sometimes too (not always happen), if I run "rmmod g_ether/g_cdc; modprobe g_ether/g_cdc" many times, it could work without those errors sometimes.So it looks like this issue has nothing to do with "dr_mode=pheripheral", maybe it has sth to do the power supplied to the board.

I also tested the Raspbian, the kernel is "Linux raspberrypi 4.19.57-v7l+ #1244 SMP Thu Jul 4 18:48:07 BST 2019 armv7l GNU/Linux", the result is same as the ubuntu-5.3 kernel.

And I used a single usb typec cable to connect the board and a usb hub, the usb hub connects to a laptop.

Revision history for this message
Enoch Leung (leun0036) wrote :

For me I would still prefer using "dtoverlay=dwc2,dr_mode=peripheral" as it is more reliable at the moment: if pi4 is rebooted remotely, it will come up with the necessary interface as I added g_cdc to /etc/modprobe.d/modules.

On my setup it should not be power related, as I'm using a cable that should provide <=0.9A from PC's USB-A and <=2.1A from an external PSU = 2.5~3A in total. Based on my test before out of curiosity, my pi4 uses ~0.6A when idle, and up to 1.5A during CPU stress test.

Revision history for this message
Enoch Leung (leun0036) wrote :

sorry, typo above: /etc/modules instead of /etc/modprobe.d/modules.

Hui Wang (hui.wang)
Changed in linux-raspi2 (Ubuntu):
status: New → Triaged
Hui Wang (hui.wang)
description: updated
Stefan Bader (smb)
Changed in linux-raspi2 (Ubuntu Eoan):
importance: Undecided → High
status: New → In Progress
Changed in linux-raspi2 (Ubuntu Eoan):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (48.0 KiB)

This bug was fixed in the package linux-raspi2 - 5.3.0-1019.21

---------------
linux-raspi2 (5.3.0-1019.21) eoan; urgency=medium

  * eoan/linux-raspi2: 5.3.0-1019.21 -proposed tracker (LP: #1863269)

  * Eoan update: upstream stable patchset 2020-02-06 (LP: #1862227)
    - [Config] raspi2: Update for COPY_THREAD_TLS

  * Raspberry Pi 4B: USB OTG is not working (LP: #1861070)
    - [Config] raspi2: USB_DWC2_DUAL_ROLE=y

  [ Ubuntu: 5.3.0-41.33 ]

  * eoan/linux: 5.3.0-41.33 -proposed tracker (LP: #1863294)
  * CVE-2019-3016
    - x86/kvm: Be careful not to clear KVM_VCPU_FLUSH_TLB bit
    - x86/kvm: Introduce kvm_(un)map_gfn()
    - x86/kvm: Cache gfn to pfn translation
    - x86/KVM: Make sure KVM_VCPU_FLUSH_TLB flag is not missed
    - x86/KVM: Clean up host's steal time structure
  * Reduce s2idle power consumption when ethernet cable is connected on e1000e
    (LP: #1859126)
    - e1000e: Add support for S0ix
  * alsa/sof: let legacy hda driver and sof driver co-exist (LP: #1837828)
    - ASoC: Intel: Skylake: move NHLT header to common directory
    - ALSA: hda: move parts of NHLT code to new module
    - ALSA: hda: intel-nhlt: handle NHLT VENDOR_DEFINED DMIC geometry
    - ASoC: Intel: Skylake: use common NHLT module
    - ALSA: hda/intel: stop probe if DMICS are detected on Skylake+ platforms
    - [Config] Enable SND_HDA_INTEL_DETECT_DMIC
  * USB key cannot be detected by hotplug on Sunix USB Type-A 3.1 Gen 2 card
    [1b21:2142] (LP: #1858988)
    - SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect
  * ipsec interfaces: fix sending with bpf_redirect() / AF_PACKET sockets
    (LP: #1860969)
    - vti[6]: fix packet tx through bpf_redirect()
    - xfrm interface: fix packet tx through bpf_redirect()
  * peripheral devices on Dell WD19TB cannot be detected after suspend resume
    (LP: #1859407)
    - PCI: irq: Introduce rearm_wake_irq()
    - ACPICA: Return u32 from acpi_dispatch_gpe()
    - ACPI: EC: Return bool from acpi_ec_dispatch_gpe()
    - ACPI: PM: Set s2idle_wakeup earlier and clear it later
    - PM: sleep: Simplify suspend-to-idle control flow
    - ACPI: EC: Rework flushing of pending work
  * Dell XPS 13 (7390) Display Flickering - 19.10 (LP: #1849947)
    - SAUCE: drm/i915: Disable PSR by default on all platforms
  * Root can lift kernel lockdown via USB/IP (LP: #1861238)
    - Revert "UBUNTU: SAUCE: (efi-lockdown) Add a SysRq option to lift kernel
      lockdown"
  * [CML-H] Add intel_thermal_pch driver support Comet Lake -H (LP: #1853219)
    - thermal: intel: intel_pch_thermal: Add Comet Lake (CML) platform support
  * Eoan update: upstream stable patchset 2020-02-07 (LP: #1862429)
    - ARM: dts: meson8: fix the size of the PMU registers
    - clk: qcom: gcc-sdm845: Add missing flag to votable GDSCs
    - dt-bindings: reset: meson8b: fix duplicate reset IDs
    - ARM: dts: imx6q-dhcom: fix rtc compatible
    - clk: Don't try to enable critical clocks if prepare failed
    - ASoC: msm8916-wcd-digital: Reset RX interpolation path after use
    - iio: buffer: align the size of scan bytes to size of the largest element
    - USB: serial: simple: Add Motorola Solutions TETRA MTP3xxx and MTP85xx
    - USB: serial: o...

Changed in linux-raspi2 (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Nick Melnick (nmelnick) wrote :

Sorry to bump an old question/resolution, but did this fix also make it into the focal 5.4 raspi kernel? I'm seeing something similar to the original post, but the test kernel above isn't going to work in focal. Thanks!

Revision history for this message
Rachel Chen (zllovesuki) wrote :

It doesn't seem like it: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal/tree/debian.raspi/config/config.common.ubuntu?h=raspi#n7282

I'm currently trying to recompile linux-image-5.4.0-1008-raspi on RPi4 with USB_DWC2_DUAL_ROLE=y

Juerg Haefliger (juergh)
no longer affects: linux-raspi (Ubuntu Eoan)
no longer affects: linux-raspi2 (Ubuntu Focal)
Stefan Bader (smb)
Changed in linux-raspi (Ubuntu Focal):
importance: Undecided → Medium
status: New → Triaged
Changed in linux-raspi (Ubuntu):
status: New → Invalid
Changed in linux-raspi (Ubuntu Focal):
status: Triaged → Fix Committed
Revision history for this message
lsmith (smith-pooteeweet) wrote :

so what is the state of this with ubuntu server 20.20 ?

I added “dtoverlay=dwc2,dr_mode=peripheral“ to /boot/firmware/usercfg.txt but also never seeing the USB-C ethernet show up when connected to my Ubuntu 18.04 laptop. Then again I might be missing the equivalent of “modules-load=dwc2” as noted at https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/

Note when connecting to my iPad Pro the pi never even boots, I suspect because it is not in the low power mode which apparently the steps from the above article configure in rasbian.

Revision history for this message
Enoch Leung (leun0036) wrote :

I just upgraded to Focal and yes, the issue just come back.

###### from dmesg ######
[ 5.722325] dwc2 fe980000.usb: fe980000.usb supply vusb_d not found, using dummy regulator
[ 5.722385] dwc2 fe980000.usb: fe980000.usb supply vusb_a not found, using dummy regulator
[ 5.722541] dwc2 fe980000.usb: Configuration mismatch. dr_mode forced to host

So unlikely the compilation flag is applied to the current Focal kernel.

###### from dpkg -l ######
ii linux-raspi2 5.4.0.1011.11

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (42.1 KiB)

This bug was fixed in the package linux-raspi - 5.4.0-1012.12

---------------
linux-raspi (5.4.0-1012.12) focal; urgency=medium

  * focal/linux-raspi: 5.4.0-1012.12 -proposed tracker (LP: #1878791)

  * Focal update: v5.4.36 upstream stable release (LP: #1876361)
    - [Config] raspi: updateconfigs for ARM64_ERRATUM_1542419

  * Raspberry Pi 4B: USB OTG is not working (LP: #1861070)
    - [Config] raspi: Set USB_DWC2_DUAL_ROLE=y

  * Missing v3d driver disables 3D support on RPi4 (LP: #1876862)
    - [Config] raspi: Set DRM_V3D=m

  * focal/linux-raspi: Upstream raspberrypi patchset 2020-05-11 (LP: #1877928)
    - SAUCE: media: bcm2835-unicam: Resync to upstream raspberrypi
    - media: bcm2835-unicam: Add support for mulitple device nodes.
    - media: bcm2835-unicam: Add embedded data node.
    - media: bcm2835-unicam: Use dummy buffer if none have been queued
    - media: bcm2835-unicam: Disable event-related ioctls on metadata node
    - media: bcm2835-unicam: Add support for the FRAME_SYNC event
    - media: imx219: Advertise embedded data node on media pad 1
    - dts: bcm2711: EMMC2 can address the whole first GB
    - driver: char: rpivid: Remove legacy name support
    - driver: char: rpivid: Don't map more than wanted
    - defconfig: Enable I2C_MUX_PINCTRL in all Pi configs
    - dt: Implement an I2C pinctrl mux for BSC0.
    - dtoverlays: Update CSI overlays to use i2c_csi_dsi
    - dt: Update all mainline bcm283x dt files for i2c0 pinctrl mux
    - ARM: dts: Create bcm2708-rpi-b-rev1.dts
    - dts: bcm2711: set #size-cells = <2>
    - dts: bcm2711: add "High Peripheral" mode overlay
    - Revert "spi: spidev: Fix CS polarity if GPIO descriptors are used"
    - spi: use_gpio_descriptor fixup moved to spi_setup
    - overlays: rpivid-v4l2 also needs size-cells = 2
    - media: bcm2835-unicam: Re-fetch mbus code from subdev on a g_fmt call
    - uapi: bcm2835-isp: Add bcm2835-isp uapi header file
    - media: uapi: v4l2-core: Add ISP statistics output V4L2 fourcc type
    - media: uapi: v4l-ctrls: Add CID base for the bcm2835-isp driver
    - staging: mmal-vchiq: Fix formatting errors in mmal_parameters.h
    - staging: vc04_services: ISP: Add a more complex ISP processing component
    - staging: vchiq: Load bcm2835_isp driver from vchiq
    - configs: Add VIDEO_ISP_BCM2835 to all Pi defconfigs
    - vc4_hvs: Mark core clock as optional
    - vc4_hdmi: BCM2835 requires a fixed hsm clock for CEC to work
    - configs: Enable CONFIG_DRM_VC4_HDMI_CEC
    - media: i2c: imx219: Implement get_selection
    - media: i2c: ov5647: Add support for g_selection to reflect cropping/binning
    - media: i2c: ov5467: Fixup error path to release mutex
    - media: i2c: ov5647: Support V4L2_CID_PIXEL_RATE
    - media: i2c: ov5647: Set V4L2_SUBDEV_FL_HAS_EVENTS flag
    - media: i2c: ov5647: Add support for V4L2_CID_VBLANK
    - media: i2c: ov5647: Neither analogue gain nor exposure need EXECUTE_ON_WRITE
    - media: i2c: ov5647: Use member names in mode tables
    - media: i2c: ov5647: Advertise the correct exposure range
    - media: i2c: imx219: Declare that the driver can create events
    - media: bcm2835-unicam: Add support for VIDIOC_[S|G]_...

Changed in linux-raspi (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Enoch Leung (leun0036) wrote :

Confirmed to work now after upgrading to linux-image-5.4.0-1012-raspi, which also fixed the warm boot issue I'd reported in 1871977.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (42.1 KiB)

This bug was fixed in the package linux-raspi - 5.4.0-1012.12

---------------
linux-raspi (5.4.0-1012.12) focal; urgency=medium

  * focal/linux-raspi: 5.4.0-1012.12 -proposed tracker (LP: #1878791)

  * Focal update: v5.4.36 upstream stable release (LP: #1876361)
    - [Config] raspi: updateconfigs for ARM64_ERRATUM_1542419

  * Raspberry Pi 4B: USB OTG is not working (LP: #1861070)
    - [Config] raspi: Set USB_DWC2_DUAL_ROLE=y

  * Missing v3d driver disables 3D support on RPi4 (LP: #1876862)
    - [Config] raspi: Set DRM_V3D=m

  * focal/linux-raspi: Upstream raspberrypi patchset 2020-05-11 (LP: #1877928)
    - SAUCE: media: bcm2835-unicam: Resync to upstream raspberrypi
    - media: bcm2835-unicam: Add support for mulitple device nodes.
    - media: bcm2835-unicam: Add embedded data node.
    - media: bcm2835-unicam: Use dummy buffer if none have been queued
    - media: bcm2835-unicam: Disable event-related ioctls on metadata node
    - media: bcm2835-unicam: Add support for the FRAME_SYNC event
    - media: imx219: Advertise embedded data node on media pad 1
    - dts: bcm2711: EMMC2 can address the whole first GB
    - driver: char: rpivid: Remove legacy name support
    - driver: char: rpivid: Don't map more than wanted
    - defconfig: Enable I2C_MUX_PINCTRL in all Pi configs
    - dt: Implement an I2C pinctrl mux for BSC0.
    - dtoverlays: Update CSI overlays to use i2c_csi_dsi
    - dt: Update all mainline bcm283x dt files for i2c0 pinctrl mux
    - ARM: dts: Create bcm2708-rpi-b-rev1.dts
    - dts: bcm2711: set #size-cells = <2>
    - dts: bcm2711: add "High Peripheral" mode overlay
    - Revert "spi: spidev: Fix CS polarity if GPIO descriptors are used"
    - spi: use_gpio_descriptor fixup moved to spi_setup
    - overlays: rpivid-v4l2 also needs size-cells = 2
    - media: bcm2835-unicam: Re-fetch mbus code from subdev on a g_fmt call
    - uapi: bcm2835-isp: Add bcm2835-isp uapi header file
    - media: uapi: v4l2-core: Add ISP statistics output V4L2 fourcc type
    - media: uapi: v4l-ctrls: Add CID base for the bcm2835-isp driver
    - staging: mmal-vchiq: Fix formatting errors in mmal_parameters.h
    - staging: vc04_services: ISP: Add a more complex ISP processing component
    - staging: vchiq: Load bcm2835_isp driver from vchiq
    - configs: Add VIDEO_ISP_BCM2835 to all Pi defconfigs
    - vc4_hvs: Mark core clock as optional
    - vc4_hdmi: BCM2835 requires a fixed hsm clock for CEC to work
    - configs: Enable CONFIG_DRM_VC4_HDMI_CEC
    - media: i2c: imx219: Implement get_selection
    - media: i2c: ov5647: Add support for g_selection to reflect cropping/binning
    - media: i2c: ov5467: Fixup error path to release mutex
    - media: i2c: ov5647: Support V4L2_CID_PIXEL_RATE
    - media: i2c: ov5647: Set V4L2_SUBDEV_FL_HAS_EVENTS flag
    - media: i2c: ov5647: Add support for V4L2_CID_VBLANK
    - media: i2c: ov5647: Neither analogue gain nor exposure need EXECUTE_ON_WRITE
    - media: i2c: ov5647: Use member names in mode tables
    - media: i2c: ov5647: Advertise the correct exposure range
    - media: i2c: imx219: Declare that the driver can create events
    - media: bcm2835-unicam: Add support for VIDIOC_[S|G]_...

Changed in linux-raspi (Ubuntu):
status: Invalid → Fix Released
Hui Wang (hui.wang)
Changed in linux-raspi2 (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
LS (m0dded) wrote (last edit ):

Hi

Running RPI4B with Jammy and cannot get the USB Ports to work.

uname -r output:
5.15.0-1006-raspi

dmesg output:

pi@raspberrypi:~$ sudo dmesg | grep dwc2
[ 1.842505] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
[ 1.842665] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
[ 1.895846] dwc2 fe980000.usb: DWC OTG Controller
[ 1.895873] dwc2 fe980000.usb: new USB bus registered, assigned bus number 3
[ 1.895904] dwc2 fe980000.usb: irq 21, io mem 0xfe980000
[ 1.896089] usb usb3: Manufacturer: Linux 5.15.0-1006-raspi dwc2_hsotg

In Raspbian Bullseye it works without issue.

Output of uname -r
5.15.32-v7l+

dmesg output:
pi@raspberrypi:~ $ sudo dmesg | grep dwc2
[ 6.571855] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
[ 6.623458] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
[ 6.745506] dwc2 fe980000.usb: DWC OTG Controller
[ 6.745560] dwc2 fe980000.usb: new USB bus registered, assigned bus number 3
[ 6.745624] dwc2 fe980000.usb: irq 36, io mem 0xfe980000
[ 6.747266] usb usb3: Manufacturer: Linux 5.15.32-v7l+ dwc2_hsotg
[ 7.182279] usb 3-1: new high-speed USB device number 2 using dwc2
[ 7.872295] usb 3-1.4: new full-speed USB device number 3 using dwc2

Revision history for this message
Juerg Haefliger (juergh) wrote :

This is unrelated. Please open a new ticket.

Revision history for this message
LS (m0dded) wrote :

Thanks - I thought it was related - I have opened a new ticket:
https://bugs.launchpad.net/ubuntu/+bug/1973648

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.