Skip to content

USB 2.0 driver fails with kernel update from 6.1.27 to 6.1.28-3-rpi-ARCH  #5470

Open

Description

@baslking

Describe the bug

USB 2.0 generates kernel trace at boot and then does not correctly detect or use USB connected devices.

expected behavior of
~lsusb
Bus 001 Device 003: ID 0463:ffff MGE UPS Systems UPS
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Kernel 28 behavior:
~lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Steps to reproduce the behaviour

Updated kernel no longer detects USB devices boot trace shown below.
Reverting to 6.1.27 kernel resolves the issue

Device (s)

Raspberry Pi CM4 8GB

System

NAME="Arch Linux ARM"
PRETTY_NAME="Arch Linux ARM"
ID=archarm
ID_LIKE=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinuxarm.org/"
DOCUMENTATION_URL="https://archlinuxarm.org/wiki"
SUPPORT_URL="https://archlinuxarm.org/forum"
BUG_REPORT_URL="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/archlinuxarm/PKGBUILDs/issues"

pacman -Qs raspberry
local/firmware-raspberrypi 20230125-1
Additional firmware for Raspberry Pi
local/raspberrypi-bootloader 20230512-1
Bootloader files for Raspberry Pi

This kernel works:
Linux pi-nas 6.1.27-1-rpi-ARCH #1 SMP PREEMPT Tue May 2 18:32:20 MDT 2023 aarch64 GNU/Linux
This kernel does not:
Linux pi-nas 6.1.28-3-rpi-ARCH #1 SMP PREEMPT Mon May 15 12:00:19 MDT 2023 aarch64 GNU/Linux

Logs

journalctl -b snippet:
------------[ cut here ]------------
May 16 11:09:01 pi-nas kernel: bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
May 16 11:09:01 pi-nas kernel: dwc2 fe980000.usb: swiotlb addr 0xffffffffffffffff+8 overflow (mask ffffffff, bus limit ffffffff).
May 16 11:09:01 pi-nas kernel: bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
May 16 11:09:01 pi-nas kernel: WARNING: CPU: 1 PID: 155 at kernel/dma/swiotlb.c:885 swiotlb_map+0x2b4/0x2c4
May 16 11:09:01 pi-nas kernel: bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
May 16 11:09:01 pi-nas kernel: Modules linked in: bcm2835_codec(C) bcm2835_v4l2(C) bcm2835_isp(C+) rpivid_hevc(C) rtc_pcf85063 bcm2835_mmal_vchiq(C)
May 16 11:09:01 pi-nas kernel: bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
May 16 11:09:01 pi-nas kernel: v4l2_mem2mem videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 snd_bcm2835(C) videobuf2_common snd_pcm vc_sm>
May 16 11:09:01 pi-nas kernel: CPU: 1 PID: 155 Comm: kworker/1:2 Tainted: P C O 6.1.28-3-rpi-ARCH #1
May 16 11:09:01 pi-nas kernel: Hardware name: Raspberry Pi Compute Module 4 Rev 1.0 (DT)
May 16 11:09:01 pi-nas kernel: Workqueue: usb_hub_wq hub_event
May 16 11:09:01 pi-nas kernel: pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
May 16 11:09:01 pi-nas kernel: pc : swiotlb_map+0x2b4/0x2c4
May 16 11:09:01 pi-nas kernel: lr : swiotlb_map+0x2b4/0x2c4
May 16 11:09:01 pi-nas kernel: sp : ffffffc0086bb880
May 16 11:09:01 pi-nas kernel: x29: ffffffc0086bb880 x28: ffffffd7660a53a0 x27: ffffff8101111800
May 16 11:09:01 pi-nas kernel: x26: ffffffd7657e2a38 x25: ffffffffffffffff x24: 0000000000000000
May 16 11:09:01 pi-nas kernel: x23: ffffff810020e410 x22: 0000000000000001 x21: 0000000000000000
May 16 11:09:01 pi-nas kernel: x20: 0000000000000008 x19: 000000010924f380 x18: 0000000000000006
May 16 11:09:01 pi-nas kernel: x17: 6d2820776f6c6672 x16: 65766f20382b6666 x15: 6666666666666666
May 16 11:09:01 pi-nas kernel: x14: 0050a68d1f24b046 x13: ffffffd76572b6a0 x12: ffffffd765f28910
May 16 11:09:01 pi-nas kernel: x11: 0000000000000001 x10: 0000000000001a80 x9 : ffffffd7656eee38
May 16 11:09:01 pi-nas kernel: x8 : ffffffc0086bb5f8 x7 : 0000000000000000 x6 : 00000000000000d0
May 16 11:09:01 pi-nas kernel: x5 : ffffffd765f29000 x4 : ffffffd765f29070 x3 : 0000000000000000
May 16 11:09:01 pi-nas kernel: x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff810322be00
May 16 11:09:01 pi-nas kernel: Call trace:
May 16 11:09:01 pi-nas kernel: swiotlb_map+0x2b4/0x2c4
May 16 11:09:01 pi-nas kernel: dma_map_page_attrs+0xa0/0x200
May 16 11:09:01 pi-nas kernel: usb_hcd_map_urb_for_dma+0x170/0x470
May 16 11:09:01 pi-nas kernel: dwc2_map_urb_for_dma+0x58/0x130 [dwc2]
May 16 11:09:01 pi-nas kernel: usb_hcd_submit_urb+0xb0/0x950
May 16 11:09:01 pi-nas kernel: usb_submit_urb+0x29c/0x5c0
May 16 11:09:01 pi-nas kernel: usb_start_wait_urb+0x78/0x11c
May 16 11:09:01 pi-nas kernel: usb_control_msg+0xc8/0x140
May 16 11:09:01 pi-nas kernel: hub_port_init+0x3dc/0xc80
May 16 11:09:01 pi-nas kernel: hub_event+0x968/0x159c
May 16 11:09:01 pi-nas kernel: process_one_work+0x200/0x474
May 16 11:09:01 pi-nas kernel: worker_thread+0x74/0x43c
May 16 11:09:01 pi-nas kernel: kthread+0xfc/0x110
May 16 11:09:01 pi-nas kernel: ret_from_fork+0x10/0x20
May 16 11:09:01 pi-nas kernel: ---[ end trace 0000000000000000 ]---

Additional context

No response

Activity

  1. graysky2 commented on May 16, 2023

    @graysky2
    Contributor

    For context:

  2. pelwell commented on May 16, 2023

    @pelwell
    Contributor

    Strange - it's working for me, built from 1229967:

    pi@raspberrypi:~$ tail -1 /proc/cpuinfo
    Model           : Raspberry Pi Compute Module 4 Rev 1.0
    pi@raspberrypi:~$ lsusb
    Bus 001 Device 004: ID 04d9:0006 Holtek Semiconductor, Inc. Wired Keyboard (78/79 key) [RPI Wired Keyboard 5]
    Bus 001 Device 003: ID 05e3:0610 Genesys Logic, Inc. Hub
    Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    
    1. What's in your config.txt?
    2. Do you have a custom .dtb file?
    3. Can you upload /sys/firmware/fdt somewhere and post a link?
  3. baslking commented on May 16, 2023

    @baslking
    Author

    tail -1 /proc/cpuinfo
    Model : Raspberry Pi Compute Module 4 Rev 1.0

    config.txt

    
    #dtoverlay=vc4-kms-v3d
    initramfs initramfs-linux.img followkernel
    
    # USB 2.0
    dtoverlay=dwc2,dr_mode=host
    #dtoverlay=dwc-otg
    # Uncomment to enable bluetooth
    #dtoverlay=dwc2
    #dtparam=krnbt=on
    # Disable BT and WIFI
    dtoverlay=disable-wifi
    dtoverlay=disable-bt
    # Activate RTC
    dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
    # bcm2708_fb set Framebuffers to zero to save RAM and avoid boot error
    max_framebuffers=0
    [pi4]
    # Run as fast as firmware / board allows
    arm_boost=1
    

    No custom .dtb files as far as I know

    The fdt

  4. pelwell commented on May 16, 2023

    @pelwell
    Contributor

    Your dtb may not be custom, but it also isn't the dtb that goes with that kernel version. ls -l /proc/device-tree/soc/dma-ranges should report a length of 32, but yours has 16. Similarly, ls -l /proc/device-tree/scb/dma-ranges should report a length of 48, but yours has 24.

  5. baslking commented on May 16, 2023

    @baslking
    Author

    Sorry my dtb is the one downloaded ruunning 6.1.27, since I backed it off. Would they be the same?

  6. pelwell commented on May 16, 2023

    @pelwell
    Contributor

    No - the set of patches leading up to 1229967 requires that the drivers and dtb be updated together (something we usually try to avoid, but in general the dtbs should be treated as if they were part of the kernel).

  7. baslking commented on May 16, 2023

    @baslking
    Author

    I assumed so. I pushed it back to 2.1.28 and yours and mine do match

  8. pelwell commented on May 16, 2023

    @pelwell
    Contributor

    And yet it doesn't work? Please link to the new fdt file for comparison.

  9. baslking commented on May 16, 2023

    @baslking
    Author

    After reboot same problem
    uname -a
    Linux pi-nas 6.1.28-3-rpi-ARCH #1 SMP PREEMPT Mon May 15 12:00:19 MDT 2023 aarch64 GNU/Linux

    kernel trace:

    May 16 16:49:33 pi-nas kernel: ------------[ cut here ]------------
    May 16 16:49:33 pi-nas kernel: dwc2 fe980000.usb: swiotlb addr 0xffffffffffffffff+8 overflow (mask ffffffff, bus limit ffffffff).
    May 16 16:49:34 pi-nas kernel: WARNING: CPU: 2 PID: 230 at kernel/dma/swiotlb.c:885 swiotlb_map+0x2b4/0x2c4
    May 16 16:49:34 pi-nas kernel: Modules linked in: bcm2835_v4l2(C) bcm2835_isp(C) bcm2835_codec(C) rpivid_hevc(C) rtc_pcf85063 bcm2835_mmal_vchiq(C) v4l2_mem2mem >
    May 16 16:49:34 pi-nas kernel: CPU: 2 PID: 230 Comm: kworker/2:2 Tainted: P         C O       6.1.28-3-rpi-ARCH #1
    May 16 16:49:34 pi-nas kernel: Hardware name: Raspberry Pi Compute Module 4 Rev 1.0 (DT)
    May 16 16:49:34 pi-nas kernel: Workqueue: usb_hub_wq hub_event
    May 16 16:49:34 pi-nas kernel: pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    May 16 16:49:34 pi-nas kernel: pc : swiotlb_map+0x2b4/0x2c4
    May 16 16:49:34 pi-nas kernel: lr : swiotlb_map+0x2b4/0x2c4
    May 16 16:49:34 pi-nas kernel: sp : ffffffc008993880
    May 16 16:49:34 pi-nas kernel: x29: ffffffc008993880 x28: ffffffec5c4a53a0 x27: ffffff8101fea800
    May 16 16:49:34 pi-nas kernel: x26: ffffffec5bbe2a38 x25: ffffffffffffffff x24: 0000000000000000
    May 16 16:49:34 pi-nas kernel: x23: ffffff810020e410 x22: 0000000000000001 x21: 0000000000000000
    May 16 16:49:34 pi-nas kernel: x20: 0000000000000008 x19: 00000001096c7f80 x18: 0000000000000006
    May 16 16:49:34 pi-nas kernel: x17: 6d2820776f6c6672 x16: 65766f20382b6666 x15: 6666666666666666
    May 16 16:49:34 pi-nas kernel: x14: 6666666666667830 x13: 2e29666666666666 x12: 66662074696d696c
    May 16 16:49:34 pi-nas kernel: x11: 20737562202c6666 x10: ffffffec5c39e6a0 x9 : ffffffec5baeee38
    May 16 16:49:34 pi-nas kernel: x8 : ffffffc008993648 x7 : 0000000000000000 x6 : 80000000fffff000
    May 16 16:49:34 pi-nas kernel: x5 : ffffffec5c329000 x4 : ffffffec5c329070 x3 : 0000000000000000
    May 16 16:49:34 pi-nas kernel: x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff81031a1f00
    May 16 16:49:34 pi-nas kernel: Call trace:
    May 16 16:49:34 pi-nas kernel:  swiotlb_map+0x2b4/0x2c4
    May 16 16:49:34 pi-nas kernel:  dma_map_page_attrs+0xa0/0x200
    May 16 16:49:34 pi-nas kernel:  usb_hcd_map_urb_for_dma+0x170/0x470
    May 16 16:49:34 pi-nas kernel:  dwc2_map_urb_for_dma+0x58/0x130 [dwc2]
    May 16 16:49:34 pi-nas kernel:  usb_hcd_submit_urb+0xb0/0x950
    May 16 16:49:34 pi-nas kernel:  usb_submit_urb+0x29c/0x5c0
    May 16 16:49:34 pi-nas kernel:  usb_start_wait_urb+0x78/0x11c
    May 16 16:49:34 pi-nas kernel:  usb_control_msg+0xc8/0x140
    May 16 16:49:34 pi-nas kernel:  hub_port_init+0x3dc/0xc80
    May 16 16:49:34 pi-nas kernel:  hub_event+0x968/0x159c
    May 16 16:49:34 pi-nas kernel:  process_one_work+0x200/0x474
    May 16 16:49:34 pi-nas kernel:  worker_thread+0x74/0x43c
    May 16 16:49:34 pi-nas kernel:  kthread+0xfc/0x110
    May 16 16:49:34 pi-nas kernel:  ret_from_fork+0x10/0x20
    May 16 16:49:34 pi-nas kernel: ---[ end trace 0000000000000000 ]---
    May 16 16:49:34 pi-nas kernel: usb 1-1: device descriptor read/64, error -11
    May 16 16:49:34 pi-nas kernel: usb 1-1: device descriptor read/64, error -11
    May 16 16:49:34 pi-nas kernel: usb 1-1: new high-speed USB device number 3 using dwc2
    May 16 16:49:35 pi-nas kernel: usb 1-1: device descriptor read/64, error -11
    May 16 16:49:35 pi-nas kernel: usb 1-1: device descriptor read/64, error -11
    May 16 16:49:35 pi-nas kernel: usb usb1-port1: attempt power cycle
    

    The 6.1.28 fdt

  10. pelwell commented on May 16, 2023

    @pelwell
    Contributor

    Ah - it looks like you have an 8GB CM4 (I would keep your location secret!), whereas mine is a 4GB. As a diagnostic tool, does adding total_mem=4096 to config.txt make it work (at the cost of halving your RAM)?

  11. baslking commented on May 16, 2023

    @baslking
    Author

    Well that partially fixes it. The bus is unstable with I/O errors and then failure

    lsusb looks happy

    Bus 001 Device 003: ID 0463:ffff MGE UPS Systems UPS
    Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    but a stream of errors:
    xxx kernel: usb 1-1.4: usbfs: usb_submit_urb returned -11

  12. pelwell commented on May 16, 2023

    @pelwell
    Contributor

    I'm seeing something strange, which I'm investigating. In the meantime, does replacing:

    dtoverlay=dwc2,dr_mode=host
    

    with

    otg_mode=1
    

    (which is our default configuration on CM4) help? You can remove the total_mem=4096 for this test.

  13. baslking commented on May 16, 2023

    @baslking
    Author

    Yes otg_mode=1 with 8GB RAM worked; the boot log is clean, and the IO errors are gone.

    Could that be documented in /boot/overlays/README ?

    BTW using dtoverlay=dwc2 without forcing host mode changed nothing.
    I had also tried dtoverlay=dwc-otg which is documented in the README and no change

    Thanks

  14. pelwell commented on May 16, 2023

    @pelwell
    Contributor

    It's not an overlay thing - it's one of the other config.txt settings, and documented here: https://www.raspberrypi.com/documentation/computers/config_txt.html#otg_mode-raspberry-pi-4-only

  15. 35 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions