usb: dwc2: regression during boot on Raspberry Pi

Stefan Wahren info at lategoodbye.de
Sat Nov 7 16:16:13 PST 2015


Hi,

i try to run linux-next-20151106 (U-Boot + USB patches from Stephen 
Warren) on my Raspberry Pi B rev2 and get a kernel oops (see bootlog at 
the end). I bisect the issue to this commit:

09a75e8577901489f77a14a3b305a9a1f67bf25b ("usb: dwc2: refactor common 
low-level hw code to platform.c")

Looking at the messages before the oops

[ 1.658393] dwc2 20980000.usb: Configuration mismatch. Forcing host mode
[ 1.665605] dwc2 20980000.usb: no platform data or transceiver defined

seems to come from missing DT properties according to 
Documentation/devicetree/bindings/usb/dwc2.txt:

   * dr_mode (optional)
   * clocks (required)
   * clock-names (required)
   * phys (optional)
   * phy-names (optional)

So here are my questions:

How to fix the kernel oops in dwc2 driver?

Should we specify dr_mode = "host" for all Raspberry Pi variants in DT?

Which clock should be referenced by USB host in DT?

Do we need a USB PHY DT node and driver for bcm2835?

Best regards
Stefan


Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.3.0-rc3+ (user at Raspberry) (gcc version 
4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #19 Sat Nov 7 
22:41:15 UTC 2015
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 
(ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing 
instruction cache
[    0.000000] Machine model: Raspberry Pi Model B rev2
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] debug: skip boot console de-registration.
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on. 
Total pages: 48768
[    0.000000] Kernel command line: earlyprintk keep_bootcon 
root=/dev/mmcblk0p2 rootwait
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 
bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 186500K/196608K available (5503K kernel code, 
397K rwdata, 1280K rodata, 408K init, 680K bss, 10108K reserved, 0K 
cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xcc800000 - 0xff000000   ( 808 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xcc000000   ( 192 MB)
[    0.000000]       .text : 0xc0008000 - 0xc06a7f38   (6784 kB)
[    0.000000]       .init : 0xc06a8000 - 0xc070e000   ( 408 kB)
[    0.000000]       .data : 0xc070e000 - 0xc0771778   ( 398 kB)
[    0.000000]        .bss : 0xc0771778 - 0xc081b9b8   ( 681 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000031] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps 
every 2147483647500ns
[    0.008592] clocksource: timer: mask: 0xffffffff max_cycles: 
0xffffffff, max_idle_ns: 1911260446275 ns
[    0.018178] bcm2835: system timer (irq = 27)
[    0.022934] Console: colour dummy device 80x30
[    0.027526] console [tty0] enabled
[    0.031172] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[    0.094066] pid_max: default: 32768 minimum: 301
[    0.099215] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.106084] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 
bytes)
[    0.114417] Initializing cgroup subsys devices
[    0.119122] Initializing cgroup subsys freezer
[    0.123742] Initializing cgroup subsys perf_event
[    0.128646] CPU: Testing write buffer coherency: ok
[    0.133789] ftrace: allocating 19067 entries in 56 pages
[    0.258189] Setting up static identity map for 0x8220 - 0x8258
[    0.268782] devtmpfs: initialized
[    0.276249] VFP support v0.3: implementor 41 architecture 1 part 20 
variant b rev 5
[    0.284644] clocksource: jiffies: mask: 0xffffffff max_cycles: 
0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.295409] pinctrl core: initialized pinctrl subsystem
[    0.301662] NET: Registered protocol family 16
[    0.306968] DMA: preallocated 256 KiB pool for atomic coherent 
allocations
[    0.319789] No ATAGs?
[    0.321968] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.329275] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.335320] Serial: AMBA PL011 UART driver
[    0.350850] SCSI subsystem initialized
[    0.355317] usbcore: registered new interface driver usbfs
[    0.361204] usbcore: registered new interface driver hub
[    0.366842] usbcore: registered new device driver usb
[    0.374874] clocksource: Switched to clocksource timer
[    0.429305] simple-framebuffer 4e795000.framebuffer: framebuffer at 
0x4e795000, 0x465000 bytes, mapped to 0xcd000000
[    0.440252] simple-framebuffer 4e795000.framebuffer: format=r5g6b5, 
mode=1920x1200x16, linelength=3840
[    0.498052] Console: switching to colour frame buffer device 240x75
[    0.551194] simple-framebuffer 4e795000.framebuffer: fb0: simplefb 
registered!
[    0.575927] NET: Registered protocol family 2
[    0.581855] TCP established hash table entries: 2048 (order: 1, 8192 
bytes)
[    0.589408] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.596239] TCP: Hash tables configured (established 2048 bind 2048)
[    0.603105] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.609394] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.616417] NET: Registered protocol family 1
[    0.621722] RPC: Registered named UNIX socket transport module.
[    0.628128] RPC: Registered udp transport module.
[    0.633159] RPC: Registered tcp transport module.
[    0.638223] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.646059] hw perfevents: enabled with armv6_1176 PMU driver, 3 
counters available
[    0.655726] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.684134] Installing knfsd (copyright (C) 1996 okir at monad.swb.de).
[    0.700087] jitterentropy: Initialization failed with host not 
compliant with requirements: 2
[    0.709758] Block layer SCSI generic (bsg) driver version 0.4 loaded 
(major 253)
[    0.717889] io scheduler noop registered
[    0.722134] io scheduler deadline registered
[    0.727213] io scheduler cfq registered (default)
[    0.734709] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    1.594570] bcm2835-rng 20104000.rng: hwrng registered
[    1.601351] usbcore: registered new interface driver zd1211rw
[    1.607759] usbcore: registered new interface driver asix
[    1.613654] usbcore: registered new interface driver ax88179_178a
[    1.620357] usbcore: registered new interface driver cdc_ether
[    1.626762] usbcore: registered new interface driver smsc95xx
[    1.633006] usbcore: registered new interface driver net1080
[    1.639223] usbcore: registered new interface driver cdc_subset
[    1.645711] usbcore: registered new interface driver zaurus
[    1.651846] usbcore: registered new interface driver cdc_ncm
[    1.658393] dwc2 20980000.usb: Configuration mismatch. Forcing host mode
[    1.665605] dwc2 20980000.usb: no platform data or transceiver defined
[    1.672588] Unable to handle kernel paging request at virtual address 
cc860040
[    1.680241] pgd = c0004000
[    1.683173] [cc860040] *pgd=0b41e811, *pte=00000000, *ppte=00000000
[    1.689891] Internal error: Oops: 7 [#1] ARM
[    1.694469] CPU: 0 PID: 1 Comm: swapper Not tainted 4.3.0-rc3+ #19
[    1.701026] Hardware name: BCM2835
[    1.704685] task: cb494000 ti: cb4d0000 task.ti: cb4d0000
[    1.710439] PC is at dwc2_is_controller_alive+0x18/0x34
[    1.716008] LR is at dwc2_handle_common_intr+0x24/0xb60
[    1.721571] pc : [<c0300c24>]    lr : [<c0300cf4>]    psr: 200001d3
[    1.721571] sp : cb4d1d00  ip : cb4d1d18  fp : cb4d1d14
[    1.733737] r10: c02abac4  r9 : c02abaac  r8 : a0000153
[    1.751078] r7 : cb634810  r6 : 00000021  r5 : 20000153  r4 : cb634810
[    1.769616] r3 : cc860000  r2 : 00000000  r1 : cb634810  r0 : cb634810
[    1.788009] Flags: nzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM 
Segment none
[    1.807367] Control: 00c5387d  Table: 00004008  DAC: 00000051
[    1.825254] Process swapper (pid: 1, stack limit = 0xcb4d0188)
[    1.843267] Stack: (0xcb4d1d00 to 0xcb4d2000)
[    1.859768] 1d00: c0300cd0 cb634810 cb4d1d4c cb4d1d18 c0300cf4 
c0300c18 00000021 cb634810
[    1.880325] 1d20: cb4d1d3c cb6381c0 20000153 00000021 cb634810 
a0000153 c02abaac c02abac4
[    1.900931] 1d40: cb4d1d74 cb4d1d50 c0054d38 c0300cdc 00000000 
cb41f080 00000021 cb634810
[    1.921519] 1d60: cb634800 cb4d1db0 cb4d1d94 cb4d1d78 c00559bc 
c0054c30 c00579e4 00000004
[    1.942043] 1d80: cb639e00 cb509710 cb4d1da4 cb4d1d98 c0057a00 
c0055970 cb4d1de4 cb4d1da8
[    1.962471] 1da0: c02abea0 c00579f0 cb509718 a0000153 cb634800 
cb639e60 c0744950 cb509710
[    1.982845] 1dc0: c0744950 fffffdfb 00000000 c06d39d4 00000000 
c06ee840 cb4d1df4 cb4d1de8
[    2.003283] 1de0: c02ac1d4 c02abd04 cb4d1e1c cb4d1df8 c02a921c 
c02ac198 cb4d1e1c cb4d1e08
[    2.023737] 1e00: cb509710 cb509744 c0744950 c02a9414 cb4d1e3c 
cb4d1e20 c02a948c c02a9020
[    2.044183] 1e20: c02a9414 00000000 cb4d1e40 c0744950 cb4d1e64 
cb4d1e40 c02a75bc c02a9420
[    2.064576] 1e40: cb43858c cb4f7f30 c0744950 cb62ac00 c073e0c0 
00000000 cb4d1e74 cb4d1e68
[    2.084991] 1e60: c02a96e0 c02a7564 cb4d1e9c cb4d1e78 c02a7ea0 
c02a96c4 c05223ec cb4d1e88
[    2.105439] 1e80: c0744950 c06ee000 c06ee000 c0771780 cb4d1eb4 
cb4d1ea0 c02a9c14 c02a7d84
[    2.125901] 1ea0: cb639da0 c06ee000 cb4d1ec4 cb4d1eb8 c02ab1fc 
c02a9b74 cb4d1ed4 cb4d1ec8
[    2.146431] 1ec0: c06d39ec c02ab1b0 cb4d1f54 cb4d1ed8 c06a8e2c 
c06d39e0 cbffc756 cbffc74d
[    2.166959] 1ee0: cb4d1f04 cb4d1ef0 c003a300 c003a378 cbffc74d 
00000000 cb4d1f54 cb4d1f08
[    2.187659] 1f00: c003a6a8 c06a8608 cb4d1f34 cb4d1f18 c004a9e0 
c0632508 00000006 00000006
[    2.208458] 1f20: 00000084 c0631ab8 cb4d1f54 00000006 c06ee834 
c070d48c c0771780 00000084
[    2.229272] 1f40: 00000000 c06ee840 cb4d1f94 cb4d1f58 c06a903c 
c06a8d20 00000006 00000006
[    2.250014] 1f60: 00000000 c06a85fc 00000420 40080500 00000000 
c04eeda0 00000000 00000000
[    2.270711] 1f80: 00000000 00000000 cb4d1fac cb4d1f98 c04eedb8 
c06a8f08 cb4d0000 00000000
[    2.291306] 1fa0: 00000000 cb4d1fb0 c000fcf8 c04eedac 00000000 
00000000 00000000 00000000
[    2.311826] 1fc0: 00000000 00000000 00000000 00000000 00000000 
00000000 00000000 00000000
[    2.332245] 1fe0: 00000000 00000000 00000000 00000000 00000013 
00000000 20200000 01000000
[    2.352591] [<c0300c24>] (dwc2_is_controller_alive) from [<c0300cf4>] 
(dwc2_handle_common_intr+0x24/0xb60)
[    2.374570] [<c0300cf4>] (dwc2_handle_common_intr) from [<c0054d38>] 
(__free_irq+0x114/0x17c)
[    2.395387] [<c0054d38>] (__free_irq) from [<c00559bc>] 
(free_irq+0x58/0x94)
[    2.414712] [<c00559bc>] (free_irq) from [<c0057a00>] 
(devm_irq_release+0x1c/0x20)
[    2.434667] [<c0057a00>] (devm_irq_release) from [<c02abea0>] 
(release_nodes+0x1a8/0x1d4)
[    2.455238] [<c02abea0>] (release_nodes) from [<c02ac1d4>] 
(devres_release_all+0x48/0x50)
[    2.475803] [<c02ac1d4>] (devres_release_all) from [<c02a921c>] 
(driver_probe_device+0x208/0x400)
[    2.497182] [<c02a921c>] (driver_probe_device) from [<c02a948c>] 
(__driver_attach+0x78/0x9c)
[    2.518210] [<c02a948c>] (__driver_attach) from [<c02a75bc>] 
(bus_for_each_dev+0x64/0xa0)
[    2.539051] [<c02a75bc>] (bus_for_each_dev) from [<c02a96e0>] 
(driver_attach+0x28/0x30)
[    2.559861] [<c02a96e0>] (driver_attach) from [<c02a7ea0>] 
(bus_add_driver+0x128/0x24c)
[    2.580744] [<c02a7ea0>] (bus_add_driver) from [<c02a9c14>] 
(driver_register+0xac/0xf0)
[    2.601631] [<c02a9c14>] (driver_register) from [<c02ab1fc>] 
(__platform_driver_register+0x58/0x6c)
[    2.623591] [<c02ab1fc>] (__platform_driver_register) from 
[<c06d39ec>] (dwc2_platform_driver_init+0x18/0x20)
[    2.646525] [<c06d39ec>] (dwc2_platform_driver_init) from 
[<c06a8e2c>] (do_one_initcall+0x118/0x1e8)
[    2.668666] [<c06a8e2c>] (do_one_initcall) from [<c06a903c>] 
(kernel_init_freeable+0x140/0x210)
[    2.690324] [<c06a903c>] (kernel_init_freeable) from [<c04eedb8>] 
(kernel_init+0x18/0xf4)
[    2.711461] [<c04eedb8>] (kernel_init) from [<c000fcf8>] 
(ret_from_fork+0x14/0x3c)
[    2.732031] Code: e24cb004 e92d4000 e8bd4000 e5903004 (e5934040)
[    2.751244] ---[ end trace 1a5f4d01f2020e03 ]---
[    2.769133] Kernel panic - not syncing: Attempted to kill init! 
exitcode=0x0000000b
[    2.769133]
[    2.804393] ---[ end Kernel panic - not syncing: Attempted to kill 
init! exitcode=0x0000000b
[    2.804393]



More information about the linux-rpi-kernel mailing list