linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
@ 2018-07-27 13:11 Krzysztof Kozlowski
  2018-07-27 13:18 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2018-07-27 13:11 UTC (permalink / raw)
  To: Robin Murphy, Ard Biesheuvel, Christoph Hellwig, Rob Herring,
	Frank Rowand, devicetree, linux-kernel, Stefan Agner,
	Fugang Duan

[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]

Hi,

On today's next, the bisect pointed commit
ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).

Author: Robin Murphy <robin.murphy@arm.com>
Date:   Mon Jul 23 23:16:12 2018 +0100
    OF: Don't set default coherent DMA mask

Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
with DMA) on Iris Carrier.

It looks like problem with Freescale Ethernet driver:
[   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
[   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
[   15.472086] Root-NFS: no NFS server address
[   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
[   15.484228] VFS: Cannot open root device "nfs" or
unknown-block(2,0): error -6
[   15.491664] Please append a correct "root=" boot option; here are
the available partitions:
[   15.500188] 0100           16384 ram0
[   15.500200]  (driver?)
[   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
fs on unknown-block(2,0)
[   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
mount root fs on unknown-block(2,0) ]---

Attached - defconfig and full boot log.

Any hints?
Let me know if you need any more information.

Best regards,
Krzysztof

[-- Attachment #2: vf-boot-log.txt --]
[-- Type: text/plain, Size: 29579 bytes --]

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.18.0-rc6-00011-g12be1e1a09c8 (krzk@PC-kkoz) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)) #394 Fri Jul 27 15:01:34 CEST 2018
[    0.000000] CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Toradex Colibri VF50 on Colibri Evaluation Board
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x87000000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] random: get_random_bytes called from start_kernel+0xa0/0x3fc with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: ip=:::::eth0: root=/dev/nfs console=tty1 console=ttyLP0,115200n8 consoleblank=0
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 103836K/131072K available (6144K kernel code, 193K rwdata, 1600K rodata, 1024K init, 142K bss, 10852K reserved, 16384K 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 : 0x88800000 - 0xff800000   (1904 MB)
[    0.000000]     lowmem  : 0x80000000 - 0x88000000   ( 128 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (7136 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 194 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 143 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000058] sched_clock: 64 bits at 132MHz, resolution 7ns, wraps every 2199023255551ns
[    0.000131] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x1e7178659b, max_idle_ns: 440795204301 ns
[    0.000221] Switching to timer-based delay loop, resolution 7ns
[    0.001479] Console: colour dummy device 80x30
[    0.002469] console [tty1] enabled
[    0.002562] Calibrating delay loop (skipped), value calculated using timer frequency.. 264.00 BogoMIPS (lpj=1320000)
[    0.002661] pid_max: default: 32768 minimum: 301
[    0.003168] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.003281] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.005152] CPU: Testing write buffer coherency: ok
[    0.007574] Setting up static identity map for 0x80100000 - 0x80100060
[    0.010395] devtmpfs: initialized
[    0.026025] VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
[    0.026971] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.027109] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.029626] pinctrl core: initialized pinctrl subsystem
[    0.033125] NET: Registered protocol family 16
[    0.037527] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.041234] cpuidle: using governor menu
[    0.041656] hw-breakpoint: found 2 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.041749] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.053893] vf610-pinctrl 40048000.iomuxc: DMA mask not set
[    0.054590] vf610-pinctrl 40048000.iomuxc: initialized IMX pinctrl driver
[    0.060556] mxs_phy 40050800.usbphy: DMA mask not set
[    0.062169] mxs_phy 40050c00.usbphy: DMA mask not set
[    0.099947] fsl-edma 40018000.dma-controller: DMA mask not set
[    0.110747] fsl-edma 40098000.dma-controller: DMA mask not set
[    0.122064] reg-fixed-voltage regulator-module-3v3: DMA mask not set
[    0.123095] reg-fixed-voltage regulator-module-3v3-avdd: DMA mask not set
[    0.124035] reg-fixed-voltage regulator-3v3: DMA mask not set
[    0.124997] reg-fixed-voltage regulator-5v0: DMA mask not set
[    0.125797] +V3.3: supplied by 3.3V
[    0.126371] reg-fixed-voltage regulator-usbh-vbus: DMA mask not set
[    0.128294] SCSI subsystem initialized
[    0.129228] usbcore: registered new interface driver usbfs
[    0.129554] usbcore: registered new interface driver hub
[    0.129967] usbcore: registered new device driver usb
[    0.131324] imx-i2c 40066000.i2c: DMA mask not set
[    0.132928] i2c i2c-0: IMX I2C adapter registered
[    0.133169] i2c i2c-0: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
[    0.133913] pps_core: LinuxPPS API ver. 1 registered
[    0.133999] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.134173] PTP clock support registered
[    0.138225] clocksource: Switched to clocksource arm_global_timer
[    0.179588] NET: Registered protocol family 2
[    0.181405] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.181577] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.181674] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.181754] TCP: Hash tables configured (established 1024 bind 1024)
[    0.182243] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.182365] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.182976] NET: Registered protocol family 1
[    0.184778] RPC: Registered named UNIX socket transport module.
[    0.184878] RPC: Registered udp transport module.
[    0.184927] RPC: Registered tcp transport module.
[    0.184970] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.186742] armv7-pmu 40089000.pmu: DMA mask not set
[    0.187330] hw perfevents: enabled with armv7_cortex_a5 PMU driver, 3 counters available
[    0.191561] Initialise system trusted keyrings
[    0.192178] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.212366] NFS: Registering the id_resolver key type
[    0.212528] Key type id_resolver registered
[    0.212591] Key type id_legacy registered
[    0.212766] ntfs: driver 2.1.32 [Flags: R/W].
[    0.214603] fuse init (API version 7.27)
[    0.228438] Key type asymmetric registered
[    0.228543] Asymmetric key parser 'x509' registered
[    0.228657] io scheduler noop registered
[    0.229244] io scheduler cfq registered (default)
[    0.229326] io scheduler mq-deadline registered
[    0.229380] io scheduler kyber registered
[    0.230875] gpio-vf610 40049000.gpio: DMA mask not set
[    0.232843] gpio-vf610 4004a000.gpio: DMA mask not set
[    0.234518] gpio-vf610 4004b000.gpio: DMA mask not set
[    0.236214] gpio-vf610 4004c000.gpio: DMA mask not set
[    0.237851] gpio-vf610 4004d000.gpio: DMA mask not set
[    0.240304] fsl-ftm-pwm 40038000.pwm: DMA mask not set
[    0.241481] fsl-ftm-pwm 40039000.pwm: DMA mask not set
[    0.245075] fsl-lpuart 40027000.serial: DMA mask not set
[    0.245618] 40027000.serial: ttyLP0 at MMIO 0x40027000 (irq = 19, base_baud = 4125000) is a FSL_LPUART
[    0.880945] console [ttyLP0] enabled
[    0.886031] fsl-lpuart 40028000.serial: DMA mask not set
[    0.891991] 40028000.serial: ttyLP1 at MMIO 0x40028000 (irq = 20, base_baud = 4125000) is a FSL_LPUART
[    0.903108] fsl-lpuart 40029000.serial: DMA mask not set
[    0.909073] 40029000.serial: ttyLP2 at MMIO 0x40029000 (irq = 21, base_baud = 4125000) is a FSL_LPUART
[    0.924431] brd: module loaded
[    0.952401] loop: module loaded
[    0.958600] vf610_nfc 400e0000.nand: DMA mask not set
[    0.964603] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
[    0.971158] nand: Macronix NAND 128MiB 3,3V 8-bit
[    0.975929] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.984095] Bad block table found at page 65472, version 0x01
[    0.990259] Bad block table found at page 65408, version 0x01
[    0.996309] nand_read_bbt: bad block at 0x0000013c0000
[    1.001801] 6 fixed-partitions partitions found on MTD device vf610_nfc
[    1.008577] Creating 6 MTD partitions on "vf610_nfc":
[    1.013711] 0x000000000000-0x000000020000 : "vf-bcb"
[    1.020310] 0x000000020000-0x000000180000 : "u-boot"
[    1.026742] 0x000000180000-0x0000001c0000 : "u-boot-env"
[    1.033681] 0x0000001c0000-0x000004080000 : "ubi1"
[    1.040989] 0x000004080000-0x000007f40000 : "ubi2"
[    1.048086] 0x000007f40000-0x000007f80000 : "reserved"
[    1.055900] fsl-dspi 4002d000.dspi1: DMA mask not set
[    1.061773] ------------[ cut here ]------------
[    1.066519] WARNING: CPU: 0 PID: 1 at ../include/linux/dma-mapping.h:516 dspi_probe+0x888/0x8e8
[    1.075391] Modules linked in:
[    1.078604] CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-rc6-00011-g12be1e1a09c8 #394
[    1.086672] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[    1.093219] Backtrace:
[    1.095762] [<8010c580>] (dump_backtrace) from [<8010c848>] (show_stack+0x18/0x1c)
[    1.103484]  r7:00000009 r6:00000000 r5:80808bfc r4:00000000
[    1.109300] [<8010c830>] (show_stack) from [<8062f28c>] (dump_stack+0x24/0x28)
[    1.116620] [<8062f268>] (dump_stack) from [<8011bf50>] (__warn+0x100/0x118)
[    1.123817] [<8011be50>] (__warn) from [<8011c088>] (warn_slowpath_null+0x48/0x50)
[    1.131551]  r8:868b4a10 r7:86ba8af8 r6:80494cf0 r5:00000204 r4:80808bfc
[    1.138399] [<8011c040>] (warn_slowpath_null) from [<80494cf0>] (dspi_probe+0x888/0x8e8)
[    1.146571]  r6:868b4a00 r5:80a03048 r4:86ba8800
[    1.151329] [<80494468>] (dspi_probe) from [<8042ccf8>] (platform_drv_probe+0x74/0xac)
[    1.159408]  r10:00000000 r9:00000000 r8:80a229a4 r7:80a4d5f0 r6:80a229a4 r5:868b4a10
[    1.167310]  r4:00000000
[    1.169990] [<8042cc84>] (platform_drv_probe) from [<8042b064>] (driver_probe_device+0x2bc/0x334)
[    1.179021]  r7:80a4d5f0 r6:00000000 r5:80a4d5ec r4:868b4a10
[    1.184764] [<8042ada8>] (driver_probe_device) from [<8042b1c0>] (__driver_attach+0xe4/0xe8)
[    1.193353]  r10:8092b838 r9:80a03048 r8:00000000 r7:80a03048 r6:868b4a44 r5:80a229a4
[    1.201326]  r4:868b4a10 r3:00000000
[    1.204981] [<8042b0dc>] (__driver_attach) from [<804290f8>] (bus_for_each_dev+0x70/0xbc)
[    1.213306]  r7:80a03048 r6:8042b0dc r5:80a229a4 r4:00000000
[    1.219114] [<80429088>] (bus_for_each_dev) from [<8042a93c>] (driver_attach+0x24/0x28)
[    1.227199]  r7:00000000 r6:80a1e5d8 r5:86b9f600 r4:80a229a4
[    1.233002] [<8042a918>] (driver_attach) from [<8042a3b8>] (bus_add_driver+0x1a0/0x218)
[    1.241175] [<8042a218>] (bus_add_driver) from [<8042bb9c>] (driver_register+0x80/0x118)
[    1.249418]  r7:8091e158 r6:ffffe000 r5:80934e7c r4:80a229a4
[    1.255157] [<8042bb1c>] (driver_register) from [<8042cc38>] (__platform_driver_register+0x48/0x50)
[    1.264341]  r5:80934e7c r4:80a30440
[    1.268005] [<8042cbf0>] (__platform_driver_register) from [<8091e174>] (fsl_dspi_driver_init+0x1c/0x20)
[    1.277655] [<8091e158>] (fsl_dspi_driver_init) from [<80102630>] (do_one_initcall+0x5c/0x1a4)
[    1.286455] [<801025d4>] (do_one_initcall) from [<80900f18>] (kernel_init_freeable+0x148/0x1e4)
[    1.295318]  r9:00000007 r8:80a30440 r7:8092b830 r6:80a30440 r5:80934e7c r4:8088ede8
[    1.303234] [<80900dd0>] (kernel_init_freeable) from [<80643f90>] (kernel_init+0x10/0x118)
[    1.311662]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80643f80
[    1.319624]  r4:00000000
[    1.322233] [<80643f80>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[    1.329938] Exception stack(0x86843fb0 to 0x86843ff8)
[    1.335054] 3fa0:                                     00000000 00000000 00000000 00000000
[    1.343378] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.351699] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    1.358447]  r5:80643f80 r4:00000000
[    1.362091] ---[ end trace 14801d0875acd9ff ]---
[    1.366776] fsl-dspi 4002d000.dspi1: coherent DMA mask is unset
[    1.372904] fsl-dspi 4002d000.dspi1: can't get dma channels
[    1.378837] fsl-dspi: probe of 4002d000.dspi1 failed with error -12
[    1.386400] libphy: Fixed MDIO Bus: probed
[    1.393539] fec 400d1000.ethernet: DMA mask not set
[    1.399380] ------------[ cut here ]------------
[    1.404130] WARNING: CPU: 0 PID: 1 at ../include/linux/dma-mapping.h:516 fec_probe+0x10ec/0x14d4
[    1.413096] Modules linked in:
[    1.416241] CPU: 0 PID: 1 Comm: swapper Tainted: G        W         4.18.0-rc6-00011-g12be1e1a09c8 #394
[    1.425771] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[    1.432326] Backtrace:
[    1.434871] [<8010c580>] (dump_backtrace) from [<8010c848>] (show_stack+0x18/0x1c)
[    1.442588]  r7:00000009 r6:00000000 r5:80808bfc r4:00000000
[    1.448412] [<8010c830>] (show_stack) from [<8062f28c>] (dump_stack+0x24/0x28)
[    1.455730] [<8062f268>] (dump_stack) from [<8011bf50>] (__warn+0x100/0x118)
[    1.462928] [<8011be50>] (__warn) from [<8011c088>] (warn_slowpath_null+0x48/0x50)
[    1.470659]  r8:00000000 r7:86983000 r6:804a6000 r5:00000204 r4:80808bfc
[    1.477445] [<8011c040>] (warn_slowpath_null) from [<804a6000>] (fec_probe+0x10ec/0x14d4)
[    1.485761]  r6:807013d8 r5:86983028 r4:86832000
[    1.490538] [<804a4f14>] (fec_probe) from [<8042ccf8>] (platform_drv_probe+0x74/0xac)
[    1.498535]  r10:00000000 r9:00000000 r8:80a23bb4 r7:80a4d5f0 r6:80a23bb4 r5:868d0c10
[    1.506438]  r4:00000000
[    1.509116] [<8042cc84>] (platform_drv_probe) from [<8042b064>] (driver_probe_device+0x2bc/0x334)
[    1.518068]  r7:80a4d5f0 r6:00000000 r5:80a4d5ec r4:868d0c10
[    1.523871] [<8042ada8>] (driver_probe_device) from [<8042b1c0>] (__driver_attach+0xe4/0xe8)
[    1.532469]  r10:8092b838 r9:80a03048 r8:00000000 r7:80a03048 r6:868d0c44 r5:80a23bb4
[    1.540445]  r4:868d0c10 r3:00000000
[    1.544098] [<8042b0dc>] (__driver_attach) from [<804290f8>] (bus_for_each_dev+0x70/0xbc)
[    1.552418]  r7:80a03048 r6:8042b0dc r5:80a23bb4 r4:00000000
[    1.558156] [<80429088>] (bus_for_each_dev) from [<8042a93c>] (driver_attach+0x24/0x28)
[    1.566303]  r7:00000000 r6:80a1e5d8 r5:86b9ff80 r4:80a23bb4
[    1.572114] [<8042a918>] (driver_attach) from [<8042a3b8>] (bus_add_driver+0x1a0/0x218)
[    1.580289] [<8042a218>] (bus_add_driver) from [<8042bb9c>] (driver_register+0x80/0x118)
[    1.588529]  r7:8091e514 r6:ffffe000 r5:80934e90 r4:80a23bb4
[    1.594271] [<8042bb1c>] (driver_register) from [<8042cc38>] (__platform_driver_register+0x48/0x50)
[    1.603458]  r5:80934e90 r4:80a30440
[    1.607118] [<8042cbf0>] (__platform_driver_register) from [<8091e530>] (fec_driver_init+0x1c/0x20)
[    1.616344] [<8091e514>] (fec_driver_init) from [<80102630>] (do_one_initcall+0x5c/0x1a4)
[    1.624703] [<801025d4>] (do_one_initcall) from [<80900f18>] (kernel_init_freeable+0x148/0x1e4)
[    1.633570]  r9:00000007 r8:80a30440 r7:8092b830 r6:80a30440 r5:80934e90 r4:8088ede8
[    1.641487] [<80900dd0>] (kernel_init_freeable) from [<80643f90>] (kernel_init+0x10/0x118)
[    1.649915]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80643f80
[    1.657809]  r4:00000000
[    1.660472] [<80643f80>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[    1.668111] Exception stack(0x86843fb0 to 0x86843ff8)
[    1.673291] 3fa0:                                     00000000 00000000 00000000 00000000
[    1.681623] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.689951] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    1.696628]  r5:80643f80 r4:00000000
[    1.700309] ---[ end trace 14801d0875acda00 ]---
[    1.705007] fec 400d1000.ethernet: coherent DMA mask is unset
[    1.710888] ------------[ cut here ]------------
[    1.715590] WARNING: CPU: 0 PID: 1 at ../include/linux/dma-mapping.h:516 dmam_alloc_coherent+0x140/0x160
[    1.725197] Modules linked in:
[    1.728401] CPU: 0 PID: 1 Comm: swapper Tainted: G        W         4.18.0-rc6-00011-g12be1e1a09c8 #394
[    1.737868] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[    1.744416] Backtrace:
[    1.746951] [<8010c580>] (dump_backtrace) from [<8010c848>] (show_stack+0x18/0x1c)
[    1.754663]  r7:00000009 r6:00000000 r5:80808bfc r4:00000000
[    1.760484] [<8010c830>] (show_stack) from [<8062f28c>] (dump_stack+0x24/0x28)
[    1.767799] [<8062f268>] (dump_stack) from [<8011bf50>] (__warn+0x100/0x118)
[    1.774990] [<8011be50>] (__warn) from [<8011c088>] (warn_slowpath_null+0x48/0x50)
[    1.782713]  r8:00001000 r7:807013d8 r6:801563a0 r5:00000204 r4:80808bfc
[    1.789566] [<8011c040>] (warn_slowpath_null) from [<801563a0>] (dmam_alloc_coherent+0x140/0x160)
[    1.798592]  r6:86b96b10 r5:80a03048 r4:868d0c10
[    1.803289] [<80156260>] (dmam_alloc_coherent) from [<804a5a38>] (fec_probe+0xb24/0x14d4)
[    1.811619]  r10:86eef3e8 r9:868d0c00 r8:80a4e574 r7:80a03048 r6:00001000 r5:868d0c10
[    1.819588]  r4:86832000
[    1.822211] [<804a4f14>] (fec_probe) from [<8042ccf8>] (platform_drv_probe+0x74/0xac)
[    1.830188]  r10:00000000 r9:00000000 r8:80a23bb4 r7:80a4d5f0 r6:80a23bb4 r5:868d0c10
[    1.838088]  r4:00000000
[    1.840757] [<8042cc84>] (platform_drv_probe) from [<8042b064>] (driver_probe_device+0x2bc/0x334)
[    1.849785]  r7:80a4d5f0 r6:00000000 r5:80a4d5ec r4:868d0c10
[    1.855528] [<8042ada8>] (driver_probe_device) from [<8042b1c0>] (__driver_attach+0xe4/0xe8)
[    1.864116]  r10:8092b838 r9:80a03048 r8:00000000 r7:80a03048 r6:868d0c44 r5:80a23bb4
[    1.872088]  r4:868d0c10 r3:00000000
[    1.875742] [<8042b0dc>] (__driver_attach) from [<804290f8>] (bus_for_each_dev+0x70/0xbc)
[    1.884059]  r7:80a03048 r6:8042b0dc r5:80a23bb4 r4:00000000
[    1.889864] [<80429088>] (bus_for_each_dev) from [<8042a93c>] (driver_attach+0x24/0x28)
[    1.897954]  r7:00000000 r6:80a1e5d8 r5:86b9ff80 r4:80a23bb4
[    1.903752] [<8042a918>] (driver_attach) from [<8042a3b8>] (bus_add_driver+0x1a0/0x218)
[    1.911930] [<8042a218>] (bus_add_driver) from [<8042bb9c>] (driver_register+0x80/0x118)
[    1.920172]  r7:8091e514 r6:ffffe000 r5:80934e90 r4:80a23bb4
[    1.925910] [<8042bb1c>] (driver_register) from [<8042cc38>] (__platform_driver_register+0x48/0x50)
[    1.935095]  r5:80934e90 r4:80a30440
[    1.938829] [<8042cbf0>] (__platform_driver_register) from [<8091e530>] (fec_driver_init+0x1c/0x20)
[    1.947981] [<8091e514>] (fec_driver_init) from [<80102630>] (do_one_initcall+0x5c/0x1a4)
[    1.956325] [<801025d4>] (do_one_initcall) from [<80900f18>] (kernel_init_freeable+0x148/0x1e4)
[    1.965188]  r9:00000007 r8:80a30440 r7:8092b830 r6:80a30440 r5:80934e90 r4:8088ede8
[    1.973100] [<80900dd0>] (kernel_init_freeable) from [<80643f90>] (kernel_init+0x10/0x118)
[    1.981522]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80643f80
[    1.989488]  r4:00000000
[    1.992091] [<80643f80>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[    1.999794] Exception stack(0x86843fb0 to 0x86843ff8)
[    2.004905] 3fa0:                                     00000000 00000000 00000000 00000000
[    2.013226] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.021557] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    2.028298]  r5:80643f80 r4:00000000
[    2.031921] ---[ end trace 14801d0875acda01 ]---
[    2.036594] fec 400d1000.ethernet: coherent DMA mask is unset
[    2.042838] fec: probe of 400d1000.ethernet failed with error -12
[    2.049422] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.056777] usbcore: registered new interface driver usb-storage
[    2.063449] usbcore: registered new interface driver usbserial_generic
[    2.070346] usbserial: USB Serial support registered for generic
[    2.076580] usbcore: registered new interface driver ftdi_sio
[    2.082664] usbserial: USB Serial support registered for FTDI USB Serial Device
[    2.090332] usbcore: registered new interface driver pl2303
[    2.096124] usbserial: USB Serial support registered for pl2303
[    2.104021] usbmisc_imx 40034800.usb: DMA mask not set
[    2.109963] usbmisc_imx 400b4800.usb: DMA mask not set
[    2.116227] imx_usb 40034000.usb: DMA mask not set
[    2.125897] ------------[ cut here ]------------
[    2.130757] WARNING: CPU: 0 PID: 1 at ../include/linux/dma-mapping.h:516 dma_pool_alloc+0x260/0x268
[    2.139958] Modules linked in:
[    2.143098] CPU: 0 PID: 1 Comm: swapper Tainted: G        W         4.18.0-rc6-00011-g12be1e1a09c8 #394
[    2.152627] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[    2.159183] Backtrace:
[    2.161722] [<8010c580>] (dump_backtrace) from [<8010c848>] (show_stack+0x18/0x1c)
[    2.169446]  r7:00000009 r6:00000000 r5:80808bfc r4:00000000
[    2.175200] [<8010c830>] (show_stack) from [<8062f28c>] (dump_stack+0x24/0x28)
[    2.182586] [<8062f268>] (dump_stack) from [<8011bf50>] (__warn+0x100/0x118)
[    2.189783] [<8011be50>] (__warn) from [<8011c088>] (warn_slowpath_null+0x48/0x50)
[    2.197434]  r8:868cc210 r7:006080c0 r6:801d7fc0 r5:00000204 r4:80808bfc
[    2.204273] [<8011c040>] (warn_slowpath_null) from [<801d7fc0>] (dma_pool_alloc+0x260/0x268)
[    2.212863]  r6:80a03048 r5:86b96ac0 r4:86b96b80
[    2.217567] [<801d7d60>] (dma_pool_alloc) from [<804dda7c>] (ci_hdrc_gadget_init+0x2a0/0x3e8)
[    2.226241]  r10:00000064 r9:00000000 r8:86982484 r7:00000000 r6:86982010 r5:00000000
[    2.234208]  r4:86982010
[    2.236818] [<804dd7dc>] (ci_hdrc_gadget_init) from [<804d9fc4>] (ci_hdrc_probe+0x610/0x7f4)
[    2.245411]  r10:00000000 r9:00000000 r8:868c2510 r7:86b9dc10 r6:86b9dc00 r5:86983010
[    2.253381]  r4:86982010
[    2.255999] [<804d99b4>] (ci_hdrc_probe) from [<8042ccf8>] (platform_drv_probe+0x74/0xac)
[    2.264328]  r10:00000000 r9:00000000 r8:80a28120 r7:80a4d5f0 r6:80a28120 r5:86b9dc10
[    2.272298]  r4:00000000
[    2.274914] [<8042cc84>] (platform_drv_probe) from [<8042b064>] (driver_probe_device+0x2bc/0x334)
[    2.283934]  r7:80a4d5f0 r6:00000000 r5:80a4d5ec r4:86b9dc10
[    2.289741] [<8042ada8>] (driver_probe_device) from [<8042b264>] (__device_attach_driver+0xa0/0xd4)
[    2.298949]  r10:00000000 r9:80a4d5c8 r8:00000001 r7:8042b1c4 r6:86b9dc10 r5:86843c04
[    2.306847]  r4:80a28120 r3:00000000
[    2.310559] [<8042b1c4>] (__device_attach_driver) from [<804291e4>] (bus_for_each_drv+0x7c/0xc0)
[    2.319500]  r7:8042b1c4 r6:80a03048 r5:86843c04 r4:00000000
[    2.325245] [<80429168>] (bus_for_each_drv) from [<8042ac80>] (__device_attach+0xd8/0x140)
[    2.333654]  r7:80a03048 r6:86b9dc44 r5:80a03048 r4:86b9dc10
[    2.339462] [<8042aba8>] (__device_attach) from [<8042b2e4>] (device_initial_probe+0x14/0x18)
[    2.348073]  r8:86b9dc10 r7:80a03048 r6:80a1e5d8 r5:86b9dc10 r4:86b9dc18
[    2.354924] [<8042b2d0>] (device_initial_probe) from [<8042a110>] (bus_probe_device+0x8c/0x94)
[    2.363700] [<8042a084>] (bus_probe_device) from [<80428124>] (device_add+0x39c/0x5bc)
[    2.371771]  r7:80a03048 r6:00000000 r5:868cc210 r4:86b9dc18
[    2.377508] [<80427d88>] (device_add) from [<8042ca14>] (platform_device_add+0x110/0x238)
[    2.385838]  r10:86eec848 r9:86b9dc10 r8:80a08a68 r7:80a08a48 r6:86b9dc00 r5:86b968a0
[    2.393807]  r4:00000002
[    2.396426] [<8042c904>] (platform_device_add) from [<804da568>] (ci_hdrc_add_device+0x3c0/0x4a4)
[    2.405451]  r9:86b9dc00 r8:00000002 r7:868ca200 r6:868cc210 r5:00000000 r4:86843d20
[    2.413364] [<804da1a8>] (ci_hdrc_add_device) from [<804df8c4>] (ci_hdrc_imx_probe+0x278/0x384)
[    2.422230]  r10:86eec848 r9:86b96710 r8:86b96710 r7:80a03048 r6:868cc200 r5:868cc210
[    2.430202]  r4:00000000
[    2.432813] [<804df64c>] (ci_hdrc_imx_probe) from [<8042ccf8>] (platform_drv_probe+0x74/0xac)
[    2.441491]  r10:00000000 r9:00000000 r8:80a28400 r7:80a4d5f0 r6:80a28400 r5:868cc210
[    2.449461]  r4:00000000
[    2.452073] [<8042cc84>] (platform_drv_probe) from [<8042b064>] (driver_probe_device+0x2bc/0x334)
[    2.461088]  r7:80a4d5f0 r6:00000000 r5:80a4d5ec r4:868cc210
[    2.466826] [<8042ada8>] (driver_probe_device) from [<8042b1c0>] (__driver_attach+0xe4/0xe8)
[    2.475415]  r10:8092b838 r9:80a03048 r8:00000000 r7:80a03048 r6:868cc244 r5:80a28400
[    2.483390]  r4:868cc210 r3:00000000
[    2.487042] [<8042b0dc>] (__driver_attach) from [<804290f8>] (bus_for_each_dev+0x70/0xbc)
[    2.495369]  r7:80a03048 r6:8042b0dc r5:80a28400 r4:00000000
[    2.501175] [<80429088>] (bus_for_each_dev) from [<8042a93c>] (driver_attach+0x24/0x28)
[    2.509334]  r7:00000000 r6:80a1e5d8 r5:86b93900 r4:80a28400
[    2.515072] [<8042a918>] (driver_attach) from [<8042a3b8>] (bus_add_driver+0x1a0/0x218)
[    2.523234] [<8042a218>] (bus_add_driver) from [<8042bb9c>] (driver_register+0x80/0x118)
[    2.531479]  r7:8091eab8 r6:ffffe000 r5:80934ec4 r4:80a28400
[    2.537218] [<8042bb1c>] (driver_register) from [<8042cc38>] (__platform_driver_register+0x48/0x50)
[    2.546403]  r5:80934ec4 r4:80a30440
[    2.550131] [<8042cbf0>] (__platform_driver_register) from [<8091ead4>] (ci_hdrc_imx_driver_init+0x1c/0x20)
[    2.560058] [<8091eab8>] (ci_hdrc_imx_driver_init) from [<80102630>] (do_one_initcall+0x5c/0x1a4)
[    2.569118] [<801025d4>] (do_one_initcall) from [<80900f18>] (kernel_init_freeable+0x148/0x1e4)
[    2.577913]  r9:00000007 r8:80a30440 r7:8092b830 r6:80a30440 r5:80934ec4 r4:8088ede8
[    2.585820] [<80900dd0>] (kernel_init_freeable) from [<80643f90>] (kernel_init+0x10/0x118)
[    2.594244]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80643f80
[    2.602211]  r4:00000000
[    2.604815] [<80643f80>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[    2.612518] Exception stack(0x86843fb0 to 0x86843ff8)
[    2.617636] 3fa0:                                     00000000 00000000 00000000 00000000
[    2.625959] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.634280] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    2.641027]  r5:80643f80 r4:00000000
[    2.644650] ---[ end trace 14801d0875acda02 ]---
[    2.649399] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.655150] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.660965] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.666703] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.672510] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.678329] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.684066] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.689871] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.695603] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.701405] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.707143] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.712955] imx_usb 40034000.usb: coherent DMA mask is unset
[    2.718898] ci_hdrc: probe of ci_hdrc.0 failed with error -12
[    2.725319] imx_usb 400b4000.usb: DMA mask not set
[    2.732100] snvs_rtc 400a7000.snvs:snvs-rtc-lp: DMA mask not set
[    2.739771] snvs_rtc 400a7000.snvs:snvs-rtc-lp: rtc core: registered 400a7000.snvs:snvs-rtc-lp as rtc0
[    2.749684] i2c /dev entries driver
[    2.755275] syscon-reboot syscon-reboot: DMA mask not set
[    2.762020] iio_hwmon iio-hwmon: DMA mask not set
[    2.767519] imx2-wdt 4003e000.wdog: DMA mask not set
[    2.774339] imx2-wdt 4003e000.wdog: timeout 60 sec (nowayout=0)
[    2.781955] sdhci: Secure Digital Host Controller Interface driver
[    2.788340] sdhci: Copyright(c) Pierre Ossman
[    2.792760] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.799477] sdhci-esdhc-imx 400b2000.esdhc: DMA mask not set
[    2.805825] sdhci-esdhc-imx 400b2000.esdhc: Got CD GPIO
[    2.840559] mmc0: SDHCI controller on 400b2000.esdhc [400b2000.esdhc] using ADMA
[    2.850817] vf610-adc 4003b000.adc: DMA mask not set
[    2.862460] vf610-adc 400bb000.adc: DMA mask not set
[    2.873018] vf610-ocotp 400a5000.ocotp: DMA mask not set
[    2.881315] NET: Registered protocol family 17
[    2.886240] Key type dns_resolver registered
[    2.891125] Registering SWP/SWPB emulation handler
[    2.899162] registered taskstats version 1
[    2.903419] Loading compiled-in X.509 certificates
[    2.913697] VCC_USB[1-4]: supplied by 5V
[    2.924686] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    2.929825] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[    2.938318] imx_usb 400b4000.usb: coherent DMA mask is unset
[    2.944130] ci_hdrc ci_hdrc.1: can't setup: -12
[    2.948981] ci_hdrc ci_hdrc.1: USB bus 1 deregistered
[    2.954332] ci_hdrc ci_hdrc.1: can't start host role
[    2.959807] ci_hdrc: probe of ci_hdrc.1 failed with error -12
[    2.969131] snvs_rtc 400a7000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:00 UTC (0)
[   15.448694] +V3.3: disabling
[   15.451677] 5V: disabling
[   15.454342] VCC_USB[1-4]: disabling
[   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
[   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
[   15.472086] Root-NFS: no NFS server address
[   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
[   15.484228] VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
[   15.491664] Please append a correct "root=" boot option; here are the available partitions:
[   15.500188] 0100           16384 ram0
[   15.500200]  (driver?)
[   15.506406] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) ]---


[-- Attachment #3: defconfig --]
[-- Type: application/octet-stream, Size: 6644 bytes --]

CONFIG_KERNEL_LZO=y
CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_CGROUPS=y
CONFIG_NAMESPACES=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
CONFIG_KALLSYMS_ALL=y
CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_ARCH_MXC=y
CONFIG_SOC_VF610=y
CONFIG_ARCH_VEXPRESS=y
CONFIG_SWP_EMULATE=y
CONFIG_VMSPLIT_2G=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_AEABI=y
CONFIG_CMA=y
CONFIG_KEXEC=y
# CONFIG_ATAGS_PROC is not set
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_KERNEL_MODE_NEON=y
CONFIG_BINFMT_MISC=y
# CONFIG_COREDUMP is not set
CONFIG_PM_WAKELOCKS=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
CONFIG_BRIDGE=y
# CONFIG_BRIDGE_IGMP_SNOOPING is not set
CONFIG_WIRELESS_EXT_OUT_OF_TREE=y
CONFIG_CFG80211=m
CONFIG_MAC80211=m
CONFIG_RFKILL=y
CONFIG_RFKILL_INPUT=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
CONFIG_DMA_CMA=y
CONFIG_CONNECTOR=y
CONFIG_MTD=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_VF610_NFC=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_FASTMAP=y
CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_VIRTIO_BLK=y
CONFIG_SCSI=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SCAN_ASYNC=y
# CONFIG_SCSI_LOWLEVEL is not set
CONFIG_NETDEVICES=y
CONFIG_VIRTIO_NET=y
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_CADENCE is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_FARADAY is not set
CONFIG_FSL_L2_SWITCH=y
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
CONFIG_MICREL_PHY=y
CONFIG_USB_NET_DRIVERS=m
CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=m
# CONFIG_USB_NET_CDC_NCM is not set
# CONFIG_USB_NET_NET1080 is not set
# CONFIG_USB_NET_CDC_SUBSET is not set
# CONFIG_USB_NET_ZAURUS is not set
CONFIG_ATH_CARDS=m
# CONFIG_ATH9K_BTCOEX_SUPPORT is not set
CONFIG_ATH9K_HTC=m
# CONFIG_RTL_CARDS is not set
CONFIG_INPUT_POLLDEV=y
# CONFIG_INPUT_MOUSEDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_DEVKMEM is not set
CONFIG_SERIAL_FSL_LPUART=y
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_I2C=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_IMX=y
CONFIG_SPI=y
CONFIG_SPI_FSL_DSPI=y
CONFIG_SPI_SPIDEV=y
CONFIG_GPIO_SYSFS=y
CONFIG_BATTERY_BQ27XXX=y
CONFIG_POWER_RESET_GPIO=y
CONFIG_POWER_RESET_GPIO_RESTART=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_SENSORS_IIO_HWMON=y
CONFIG_WATCHDOG=y
CONFIG_IMX2_WDT=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_GPIO=y
# CONFIG_HID is not set
# CONFIG_USB_HID is not set
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_ACM=m
CONFIG_USB_STORAGE=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_SERIAL_OPTION=m
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_MXS_PHY=y
CONFIG_USB_GADGET=y
CONFIG_USB_FSL_USB2=y
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_MMC=y
CONFIG_MMC_ARMMMCI=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_ESDHC_IMX=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_PWM=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_GPIO=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_SNVS=y
CONFIG_DMADEVICES=y
CONFIG_FSL_EDMA=y
# CONFIG_MX3_IPU is not set
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_SOC_BUS_VF610=y
CONFIG_EXTCON_USB_GPIO=y
CONFIG_IIO=y
CONFIG_VF610_ADC=y
CONFIG_VF610_DAC=y
CONFIG_IIO_SYSFS_TRIGGER=y
CONFIG_PWM=y
CONFIG_PWM_FSL_FTM=y
CONFIG_NVMEM=y
CONFIG_NVMEM_VF610_OCOTP=y
CONFIG_EXT4_FS=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
CONFIG_VFAT_FS=y
CONFIG_NTFS_FS=y
CONFIG_NTFS_RW=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
# CONFIG_NFS_V2 is not set
# CONFIG_NFS_V3 is not set
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
CONFIG_NLS_DEFAULT="cp437"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_UTF8=y
CONFIG_PRINTK_TIME=y
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=2
CONFIG_LOCKUP_DETECTOR=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
# CONFIG_SCHED_DEBUG is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_FTRACE is not set
# CONFIG_ARM_UNWIND is not set
CONFIG_DEBUG_USER=y
CONFIG_SECURITYFS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_MD4=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_DES=y
# CONFIG_CRYPTO_HW is not set
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_XZ_DEC=y

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-27 13:11 [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask) Krzysztof Kozlowski
@ 2018-07-27 13:18 ` Krzysztof Kozlowski
  2018-07-27 14:04   ` Christoph Hellwig
  0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2018-07-27 13:18 UTC (permalink / raw)
  To: Robin Murphy, Ard Biesheuvel, Christoph Hellwig, Rob Herring,
	Frank Rowand, devicetree, linux-kernel, Stefan Agner,
	Fugang Duan

On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> Hi,
>
> On today's next, the bisect pointed commit
> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>
> Author: Robin Murphy <robin.murphy@arm.com>
> Date:   Mon Jul 23 23:16:12 2018 +0100
>     OF: Don't set default coherent DMA mask
>
> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
> with DMA) on Iris Carrier.
>
> It looks like problem with Freescale Ethernet driver:
> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
> [   15.472086] Root-NFS: no NFS server address
> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
> [   15.484228] VFS: Cannot open root device "nfs" or
> unknown-block(2,0): error -6
> [   15.491664] Please append a correct "root=" boot option; here are
> the available partitions:
> [   15.500188] 0100           16384 ram0
> [   15.500200]  (driver?)
> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
> fs on unknown-block(2,0)
> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
> mount root fs on unknown-block(2,0) ]---
>
> Attached - defconfig and full boot log.
>
> Any hints?
> Let me know if you need any more information.

My Exynos boards also fail to boot on missing network:
https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0

As expected there are plenty of "DMA mask not set" warnings... and
later dwc3 driver fails with:
    dwc3: probe of 12400000.dwc3 failed with error -12
which is probably the answer why LAN attached to USB is not present.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-27 13:18 ` Krzysztof Kozlowski
@ 2018-07-27 14:04   ` Christoph Hellwig
  2018-07-28 16:58     ` Guenter Roeck
  0 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2018-07-27 14:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Robin Murphy, Ard Biesheuvel, Christoph Hellwig, Rob Herring,
	Frank Rowand, devicetree, linux-kernel, Stefan Agner,
	Fugang Duan

On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > Hi,
> >
> > On today's next, the bisect pointed commit
> > ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
> > with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
> >
> > Author: Robin Murphy <robin.murphy@arm.com>
> > Date:   Mon Jul 23 23:16:12 2018 +0100
> >     OF: Don't set default coherent DMA mask
> >
> > Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
> > with DMA) on Iris Carrier.
> >
> > It looks like problem with Freescale Ethernet driver:
> > [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
> > [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
> > [   15.472086] Root-NFS: no NFS server address
> > [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
> > [   15.484228] VFS: Cannot open root device "nfs" or
> > unknown-block(2,0): error -6
> > [   15.491664] Please append a correct "root=" boot option; here are
> > the available partitions:
> > [   15.500188] 0100           16384 ram0
> > [   15.500200]  (driver?)
> > [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
> > fs on unknown-block(2,0)
> > [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
> > mount root fs on unknown-block(2,0) ]---
> >
> > Attached - defconfig and full boot log.
> >
> > Any hints?
> > Let me know if you need any more information.
> 
> My Exynos boards also fail to boot on missing network:
> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
> 
> As expected there are plenty of "DMA mask not set" warnings... and
> later dwc3 driver fails with:
>     dwc3: probe of 12400000.dwc3 failed with error -12
> which is probably the answer why LAN attached to USB is not present.

Looks like all the drivers failed to set a dma mask and were lucky.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-27 14:04   ` Christoph Hellwig
@ 2018-07-28 16:58     ` Guenter Roeck
  2018-07-30  9:23       ` Christoph Hellwig
  2018-07-30 14:38       ` Robin Murphy
  0 siblings, 2 replies; 19+ messages in thread
From: Guenter Roeck @ 2018-07-28 16:58 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Krzysztof Kozlowski, Robin Murphy, Ard Biesheuvel, Rob Herring,
	Frank Rowand, devicetree, linux-kernel, Stefan Agner,
	Fugang Duan

On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
> > On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > > Hi,
> > >
> > > On today's next, the bisect pointed commit
> > > ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
> > > with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
> > >
> > > Author: Robin Murphy <robin.murphy@arm.com>
> > > Date:   Mon Jul 23 23:16:12 2018 +0100
> > >     OF: Don't set default coherent DMA mask
> > >
> > > Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
> > > with DMA) on Iris Carrier.
> > >
> > > It looks like problem with Freescale Ethernet driver:
> > > [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
> > > [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
> > > [   15.472086] Root-NFS: no NFS server address
> > > [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
> > > [   15.484228] VFS: Cannot open root device "nfs" or
> > > unknown-block(2,0): error -6
> > > [   15.491664] Please append a correct "root=" boot option; here are
> > > the available partitions:
> > > [   15.500188] 0100           16384 ram0
> > > [   15.500200]  (driver?)
> > > [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
> > > fs on unknown-block(2,0)
> > > [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
> > > mount root fs on unknown-block(2,0) ]---
> > >
> > > Attached - defconfig and full boot log.
> > >
> > > Any hints?
> > > Let me know if you need any more information.
> > 
> > My Exynos boards also fail to boot on missing network:
> > https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
> > 
> > As expected there are plenty of "DMA mask not set" warnings... and
> > later dwc3 driver fails with:
> >     dwc3: probe of 12400000.dwc3 failed with error -12
> > which is probably the answer why LAN attached to USB is not present.
> 
> Looks like all the drivers failed to set a dma mask and were lucky.

I would call it a serious regression. Also, no longer setting a default
coherent DMA mask is a quite substantial behavioral change, especially
if and since the code worked just fine up to now.

Crash when booting sam460ex attached below, as is a bisect log.

Guenter

---
irq: type mismatch, failed to map hwirq-0 for interrupt-controller3!
WARNING: CPU: 0 PID: 1 at ppc4xx_msi_probe+0x2dc/0x3b8
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-rc6-00010-gff33d1030a6c #1
NIP:  c001c460 LR: c001c29c CTR: 00000000
REGS: cf82db60 TRAP: 0700   Not tainted  (4.18.0-rc6-00010-gff33d1030a6c)
MSR:  00029000 <CE,EE,ME>  CR: 24002028  XER: 00000000

GPR00: c001c29c cf82dc10 cf828000 d1021000 d1021000 cf882108 cf82db78 00000000 
GPR08: 00000000 c0377ae4 00000000 1000051b 24002028 00000000 c00025e8 00000000 
GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a 
GPR24: 00029000 0000000c 10000000 cf8de410 c0494d60 00029000 cf8bebc0 cf8de400 
NIP [c001c460] ppc4xx_msi_probe+0x2dc/0x3b8
LR [c001c29c] ppc4xx_msi_probe+0x118/0x3b8
Call Trace:
[cf82dc10] [c001c29c] ppc4xx_msi_probe+0x118/0x3b8 (unreliable)
[cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
[cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
[cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
[cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
[cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
[cf82dd40] [c02050c8] device_add+0x404/0x5c4
[cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
[cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
[cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
[cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
[cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
[cf82dea0] [c0002404] do_one_initcall+0x40/0x188
[cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
[cf82df30] [c0002600] kernel_init+0x18/0x104
[cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
Instruction dump:
3860000e 4bffa2a5 3860000f 7f44d378 4bffa299 4bfffe30 3860000e 4bffa28d 
3860000f 7f24cb78 4bffa281 4bfffde4 <0fe00000> 81290000 2f890000 409efe6c 
---[ end trace 8cf551077ecfc429 ]---
ppc4xx-msi c10000000.ppc4xx-msi: coherent DMA mask is unset
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc001bff0
Oops: Kernel access of bad area, sig: 11 [#1]
BE Canyonlands
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Tainted: G        W         4.18.0-rc6-00010-gff33d1030a6c #1
NIP:  c001bff0 LR: c001c418 CTR: c01faa7c
REGS: cf82db40 TRAP: 0300   Tainted: G        W          (4.18.0-rc6-00010-gff33d1030a6c)
MSR:  00029000 <CE,EE,ME>  CR: 28002024  XER: 00000000
DEAR: 00000000 ESR: 00000000 
GPR00: c001c418 cf82dbf0 cf828000 cf8de400 00000000 00000000 000000c4 000000c4 
GPR08: c0481ea4 00000000 00000000 000000c4 22002024 00000000 c00025e8 00000000 
GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a 
GPR24: 00029000 0000000c 00000000 cf8de410 c0494d60 c0494d60 cf8bebc0 00000001 
NIP [c001bff0] ppc4xx_of_msi_remove+0x48/0xa0
LR [c001c418] ppc4xx_msi_probe+0x294/0x3b8
Call Trace:
[cf82dbf0] [00029000] 0x29000 (unreliable)
[cf82dc10] [c001c418] ppc4xx_msi_probe+0x294/0x3b8
[cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
[cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
[cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
[cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
[cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
[cf82dd40] [c02050c8] device_add+0x404/0x5c4
[cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
[cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
[cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
[cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
[cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
[cf82dea0] [c0002404] do_one_initcall+0x40/0x188
[cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
[cf82df30] [c0002600] kernel_init+0x18/0x104
[cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
Instruction dump:
90010024 813d0024 2f890000 83c30058 41bd0014 48000038 813d0024 7f89f800 
409d002c 813e000c 57ea103a 3bff0001 <7c69502e> 2f830000 419effe0 4803b26d 
---[ end trace 8cf551077ecfc42a ]---

Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

---
# bad: [639d109b21f1413c54ca7042e40a57856e7679bb] Add linux-next specific files for 20180727
# good: [d72e90f33aa4709ebecc5005562f52335e106a60] Linux 4.18-rc6
git bisect start 'HEAD' 'v4.18-rc6'
# bad: [7bc81125a936a25af28f2172b593bca390b0c539] Merge remote-tracking branch 'spi-nor/spi-nor/next'
git bisect bad 7bc81125a936a25af28f2172b593bca390b0c539
# bad: [659868e6488dbad1181ad21888521ff41ae45f65] Merge remote-tracking branch 'vfs/for-next'
git bisect bad 659868e6488dbad1181ad21888521ff41ae45f65
# bad: [453ff4bb24c3fa4af40995f2615ec22176e71500] Merge remote-tracking branch 'mvebu/for-next'
git bisect bad 453ff4bb24c3fa4af40995f2615ec22176e71500
# good: [ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90] Merge branch 'next/soc' into for-next
git bisect good ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90
# good: [fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8] Merge remote-tracking branch 'leaks/leaks-next'
git bisect good fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8
# good: [53b9c41f0d9c35e41ea884bae6ad4b6fadc59035] Merge branch 'next/drivers' into for-next
git bisect good 53b9c41f0d9c35e41ea884bae6ad4b6fadc59035
# bad: [cd67b2d4c0ca61f7e93e622dba0164fb176975b4] Merge remote-tracking branch 'arm-soc/for-next'
git bisect bad cd67b2d4c0ca61f7e93e622dba0164fb176975b4
# good: [a0c166140d2e63a069263b6d3c39a42c61749d96] Merge branch 'next/drivers' into for-next
git bisect good a0c166140d2e63a069263b6d3c39a42c61749d96
# bad: [e5e08751da47170e6a05c09364595ec1abad7cec] Merge remote-tracking branch 'arm/for-next'
git bisect bad e5e08751da47170e6a05c09364595ec1abad7cec
# good: [52e19c3c1eaf103c2eb4f764825136abcfea1538] Merge branches 'clkdev', 'fixes', 'misc' and 'spectre' into for-next
git bisect good 52e19c3c1eaf103c2eb4f764825136abcfea1538
# good: [e8d4162413ecbf3b3d1451808bdbd212cec8b70c] ACPI/IORT: Set bus DMA mask as appropriate
git bisect good e8d4162413ecbf3b3d1451808bdbd212cec8b70c
# good: [186e2e8cc462aed36cc6845c938547833377582f] ACPI/IORT: Don't set default coherent DMA mask
git bisect good 186e2e8cc462aed36cc6845c938547833377582f
# bad: [deff076d4ce359c2d83983a75765b4ac8f635d2f] Merge remote-tracking branch 'dma-mapping/for-next'
git bisect bad deff076d4ce359c2d83983a75765b4ac8f635d2f
# bad: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask
git bisect bad ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d
# first bad commit: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-28 16:58     ` Guenter Roeck
@ 2018-07-30  9:23       ` Christoph Hellwig
  2018-07-30 14:38       ` Robin Murphy
  1 sibling, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2018-07-30  9:23 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Christoph Hellwig, Krzysztof Kozlowski, Robin Murphy,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Stefan Agner, Fugang Duan

On Sat, Jul 28, 2018 at 09:58:20AM -0700, Guenter Roeck wrote:
> I would call it a serious regression. Also, no longer setting a default
> coherent DMA mask is a quite substantial behavioral change, especially
> if and since the code worked just fine up to now.
> 
> Crash when booting sam460ex attached below, as is a bisect log.

Things should be ok again with:

commit a5516219b10218a87abb3352c82248ce3088e94a
Author: Robin Murphy <robin.murphy@arm.com>
Date:   Fri Jul 27 15:14:15 2018 +0100

    of/platform: Initialise default DMA masks

from the lastest dma-mapping tree as of Friday.  It isn't in the
latest linux-next tree yet but be in the next one.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-28 16:58     ` Guenter Roeck
  2018-07-30  9:23       ` Christoph Hellwig
@ 2018-07-30 14:38       ` Robin Murphy
  2018-07-31  0:50         ` Guenter Roeck
  2018-07-31  8:19         ` Stefan Agner
  1 sibling, 2 replies; 19+ messages in thread
From: Robin Murphy @ 2018-07-30 14:38 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Christoph Hellwig, Krzysztof Kozlowski, Ard Biesheuvel,
	Rob Herring, Frank Rowand, devicetree, linux-kernel,
	Stefan Agner, Fugang Duan

On 28/07/18 17:58, Guenter Roeck wrote:
> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>> Hi,
>>>>
>>>> On today's next, the bisect pointed commit
>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>
>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>      OF: Don't set default coherent DMA mask
>>>>
>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>> with DMA) on Iris Carrier.
>>>>
>>>> It looks like problem with Freescale Ethernet driver:
>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>> [   15.472086] Root-NFS: no NFS server address
>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>> unknown-block(2,0): error -6
>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>> the available partitions:
>>>> [   15.500188] 0100           16384 ram0
>>>> [   15.500200]  (driver?)
>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>> fs on unknown-block(2,0)
>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>> mount root fs on unknown-block(2,0) ]---
>>>>
>>>> Attached - defconfig and full boot log.
>>>>
>>>> Any hints?
>>>> Let me know if you need any more information.
>>>
>>> My Exynos boards also fail to boot on missing network:
>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>
>>> As expected there are plenty of "DMA mask not set" warnings... and
>>> later dwc3 driver fails with:
>>>      dwc3: probe of 12400000.dwc3 failed with error -12
>>> which is probably the answer why LAN attached to USB is not present.
>>
>> Looks like all the drivers failed to set a dma mask and were lucky.
> 
> I would call it a serious regression. Also, no longer setting a default
> coherent DMA mask is a quite substantial behavioral change, especially
> if and since the code worked just fine up to now.

To reiterate, that particular side-effect was an unintentional 
oversight, and I was simply (un)lucky enough that none of the drivers I 
did test depended on that default mask. Sorry for the blip; please check 
whether it's now fixed in next-20180730 as it should be.

> Crash when booting sam460ex attached below, as is a bisect log.

Nevertheless, like most of the others that came out of the woodwork, 
that appears to be a crash due to a broken cleanup path down the line 
from dma_alloc_coherent() returning NULL - that warrants fixing (or just 
removing) in its own right, because cleanup code which has never been 
tested and doesn't actually work is little more than a pointless waste 
of space.

Robin.

> 
> Guenter
> 
> ---
> irq: type mismatch, failed to map hwirq-0 for interrupt-controller3!
> WARNING: CPU: 0 PID: 1 at ppc4xx_msi_probe+0x2dc/0x3b8
> Modules linked in:
> CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-rc6-00010-gff33d1030a6c #1
> NIP:  c001c460 LR: c001c29c CTR: 00000000
> REGS: cf82db60 TRAP: 0700   Not tainted  (4.18.0-rc6-00010-gff33d1030a6c)
> MSR:  00029000 <CE,EE,ME>  CR: 24002028  XER: 00000000
> 
> GPR00: c001c29c cf82dc10 cf828000 d1021000 d1021000 cf882108 cf82db78 00000000
> GPR08: 00000000 c0377ae4 00000000 1000051b 24002028 00000000 c00025e8 00000000
> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a
> GPR24: 00029000 0000000c 10000000 cf8de410 c0494d60 00029000 cf8bebc0 cf8de400
> NIP [c001c460] ppc4xx_msi_probe+0x2dc/0x3b8
> LR [c001c29c] ppc4xx_msi_probe+0x118/0x3b8
> Call Trace:
> [cf82dc10] [c001c29c] ppc4xx_msi_probe+0x118/0x3b8 (unreliable)
> [cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
> [cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
> [cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
> [cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
> [cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
> [cf82dd40] [c02050c8] device_add+0x404/0x5c4
> [cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
> [cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
> [cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
> [cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
> [cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
> [cf82dea0] [c0002404] do_one_initcall+0x40/0x188
> [cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
> [cf82df30] [c0002600] kernel_init+0x18/0x104
> [cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
> Instruction dump:
> 3860000e 4bffa2a5 3860000f 7f44d378 4bffa299 4bfffe30 3860000e 4bffa28d
> 3860000f 7f24cb78 4bffa281 4bfffde4 <0fe00000> 81290000 2f890000 409efe6c
> ---[ end trace 8cf551077ecfc429 ]---
> ppc4xx-msi c10000000.ppc4xx-msi: coherent DMA mask is unset
> Unable to handle kernel paging request for data at address 0x00000000
> Faulting instruction address: 0xc001bff0
> Oops: Kernel access of bad area, sig: 11 [#1]
> BE Canyonlands
> Modules linked in:
> CPU: 0 PID: 1 Comm: swapper Tainted: G        W         4.18.0-rc6-00010-gff33d1030a6c #1
> NIP:  c001bff0 LR: c001c418 CTR: c01faa7c
> REGS: cf82db40 TRAP: 0300   Tainted: G        W          (4.18.0-rc6-00010-gff33d1030a6c)
> MSR:  00029000 <CE,EE,ME>  CR: 28002024  XER: 00000000
> DEAR: 00000000 ESR: 00000000
> GPR00: c001c418 cf82dbf0 cf828000 cf8de400 00000000 00000000 000000c4 000000c4
> GPR08: c0481ea4 00000000 00000000 000000c4 22002024 00000000 c00025e8 00000000
> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a
> GPR24: 00029000 0000000c 00000000 cf8de410 c0494d60 c0494d60 cf8bebc0 00000001
> NIP [c001bff0] ppc4xx_of_msi_remove+0x48/0xa0
> LR [c001c418] ppc4xx_msi_probe+0x294/0x3b8
> Call Trace:
> [cf82dbf0] [00029000] 0x29000 (unreliable)
> [cf82dc10] [c001c418] ppc4xx_msi_probe+0x294/0x3b8
> [cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
> [cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
> [cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
> [cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
> [cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
> [cf82dd40] [c02050c8] device_add+0x404/0x5c4
> [cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
> [cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
> [cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
> [cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
> [cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
> [cf82dea0] [c0002404] do_one_initcall+0x40/0x188
> [cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
> [cf82df30] [c0002600] kernel_init+0x18/0x104
> [cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
> Instruction dump:
> 90010024 813d0024 2f890000 83c30058 41bd0014 48000038 813d0024 7f89f800
> 409d002c 813e000c 57ea103a 3bff0001 <7c69502e> 2f830000 419effe0 4803b26d
> ---[ end trace 8cf551077ecfc42a ]---
> 
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> 
> ---
> # bad: [639d109b21f1413c54ca7042e40a57856e7679bb] Add linux-next specific files for 20180727
> # good: [d72e90f33aa4709ebecc5005562f52335e106a60] Linux 4.18-rc6
> git bisect start 'HEAD' 'v4.18-rc6'
> # bad: [7bc81125a936a25af28f2172b593bca390b0c539] Merge remote-tracking branch 'spi-nor/spi-nor/next'
> git bisect bad 7bc81125a936a25af28f2172b593bca390b0c539
> # bad: [659868e6488dbad1181ad21888521ff41ae45f65] Merge remote-tracking branch 'vfs/for-next'
> git bisect bad 659868e6488dbad1181ad21888521ff41ae45f65
> # bad: [453ff4bb24c3fa4af40995f2615ec22176e71500] Merge remote-tracking branch 'mvebu/for-next'
> git bisect bad 453ff4bb24c3fa4af40995f2615ec22176e71500
> # good: [ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90] Merge branch 'next/soc' into for-next
> git bisect good ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90
> # good: [fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8] Merge remote-tracking branch 'leaks/leaks-next'
> git bisect good fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8
> # good: [53b9c41f0d9c35e41ea884bae6ad4b6fadc59035] Merge branch 'next/drivers' into for-next
> git bisect good 53b9c41f0d9c35e41ea884bae6ad4b6fadc59035
> # bad: [cd67b2d4c0ca61f7e93e622dba0164fb176975b4] Merge remote-tracking branch 'arm-soc/for-next'
> git bisect bad cd67b2d4c0ca61f7e93e622dba0164fb176975b4
> # good: [a0c166140d2e63a069263b6d3c39a42c61749d96] Merge branch 'next/drivers' into for-next
> git bisect good a0c166140d2e63a069263b6d3c39a42c61749d96
> # bad: [e5e08751da47170e6a05c09364595ec1abad7cec] Merge remote-tracking branch 'arm/for-next'
> git bisect bad e5e08751da47170e6a05c09364595ec1abad7cec
> # good: [52e19c3c1eaf103c2eb4f764825136abcfea1538] Merge branches 'clkdev', 'fixes', 'misc' and 'spectre' into for-next
> git bisect good 52e19c3c1eaf103c2eb4f764825136abcfea1538
> # good: [e8d4162413ecbf3b3d1451808bdbd212cec8b70c] ACPI/IORT: Set bus DMA mask as appropriate
> git bisect good e8d4162413ecbf3b3d1451808bdbd212cec8b70c
> # good: [186e2e8cc462aed36cc6845c938547833377582f] ACPI/IORT: Don't set default coherent DMA mask
> git bisect good 186e2e8cc462aed36cc6845c938547833377582f
> # bad: [deff076d4ce359c2d83983a75765b4ac8f635d2f] Merge remote-tracking branch 'dma-mapping/for-next'
> git bisect bad deff076d4ce359c2d83983a75765b4ac8f635d2f
> # bad: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask
> git bisect bad ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d
> # first bad commit: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-30 14:38       ` Robin Murphy
@ 2018-07-31  0:50         ` Guenter Roeck
  2018-07-31  8:19         ` Stefan Agner
  1 sibling, 0 replies; 19+ messages in thread
From: Guenter Roeck @ 2018-07-31  0:50 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Christoph Hellwig, Krzysztof Kozlowski, Ard Biesheuvel,
	Rob Herring, Frank Rowand, devicetree, linux-kernel,
	Stefan Agner, Fugang Duan

On 07/30/2018 07:38 AM, Robin Murphy wrote:
> On 28/07/18 17:58, Guenter Roeck wrote:
>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>> Hi,
>>>>>
>>>>> On today's next, the bisect pointed commit
>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>
>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>      OF: Don't set default coherent DMA mask
>>>>>
>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>>> with DMA) on Iris Carrier.
>>>>>
>>>>> It looks like problem with Freescale Ethernet driver:
>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>> unknown-block(2,0): error -6
>>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>>> the available partitions:
>>>>> [   15.500188] 0100           16384 ram0
>>>>> [   15.500200]  (driver?)
>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>>> fs on unknown-block(2,0)
>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>
>>>>> Attached - defconfig and full boot log.
>>>>>
>>>>> Any hints?
>>>>> Let me know if you need any more information.
>>>>
>>>> My Exynos boards also fail to boot on missing network:
>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>
>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>> later dwc3 driver fails with:
>>>>      dwc3: probe of 12400000.dwc3 failed with error -12
>>>> which is probably the answer why LAN attached to USB is not present.
>>>
>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>
>> I would call it a serious regression. Also, no longer setting a default
>> coherent DMA mask is a quite substantial behavioral change, especially
>> if and since the code worked just fine up to now.
> 
> To reiterate, that particular side-effect was an unintentional oversight, and I was simply (un)lucky enough that none of the drivers I did test depended on that default mask. Sorry for the blip; please check whether it's now fixed in next-20180730 as it should be.
> 

Yes, I don't see the warnings and crashes anymore.

>> Crash when booting sam460ex attached below, as is a bisect log.
> 
> Nevertheless, like most of the others that came out of the woodwork, that appears to be a crash due to a broken cleanup path down the line from dma_alloc_coherent() returning NULL - that warrants fixing (or just removing) in its own right, because cleanup code which has never been tested and doesn't actually work is little more than a pointless waste of space.
> 

I had a  quick look into the code. I agree, the error path in
ppc4xx_msi_probe() is completely messed up. It will crash for all
kinds of errors (and in many cases erroneously return -EPERM
as error, but that doesn't really matter since it crashes anyway).

Guenter

> Robin.
> 
>>
>> Guenter
>>
>> ---
>> irq: type mismatch, failed to map hwirq-0 for interrupt-controller3!
>> WARNING: CPU: 0 PID: 1 at ppc4xx_msi_probe+0x2dc/0x3b8
>> Modules linked in:
>> CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-rc6-00010-gff33d1030a6c #1
>> NIP:  c001c460 LR: c001c29c CTR: 00000000
>> REGS: cf82db60 TRAP: 0700   Not tainted  (4.18.0-rc6-00010-gff33d1030a6c)
>> MSR:  00029000 <CE,EE,ME>  CR: 24002028  XER: 00000000
>>
>> GPR00: c001c29c cf82dc10 cf828000 d1021000 d1021000 cf882108 cf82db78 00000000
>> GPR08: 00000000 c0377ae4 00000000 1000051b 24002028 00000000 c00025e8 00000000
>> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a
>> GPR24: 00029000 0000000c 10000000 cf8de410 c0494d60 00029000 cf8bebc0 cf8de400
>> NIP [c001c460] ppc4xx_msi_probe+0x2dc/0x3b8
>> LR [c001c29c] ppc4xx_msi_probe+0x118/0x3b8
>> Call Trace:
>> [cf82dc10] [c001c29c] ppc4xx_msi_probe+0x118/0x3b8 (unreliable)
>> [cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
>> [cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
>> [cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
>> [cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
>> [cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
>> [cf82dd40] [c02050c8] device_add+0x404/0x5c4
>> [cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
>> [cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
>> [cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
>> [cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
>> [cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
>> [cf82dea0] [c0002404] do_one_initcall+0x40/0x188
>> [cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
>> [cf82df30] [c0002600] kernel_init+0x18/0x104
>> [cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
>> Instruction dump:
>> 3860000e 4bffa2a5 3860000f 7f44d378 4bffa299 4bfffe30 3860000e 4bffa28d
>> 3860000f 7f24cb78 4bffa281 4bfffde4 <0fe00000> 81290000 2f890000 409efe6c
>> ---[ end trace 8cf551077ecfc429 ]---
>> ppc4xx-msi c10000000.ppc4xx-msi: coherent DMA mask is unset
>> Unable to handle kernel paging request for data at address 0x00000000
>> Faulting instruction address: 0xc001bff0
>> Oops: Kernel access of bad area, sig: 11 [#1]
>> BE Canyonlands
>> Modules linked in:
>> CPU: 0 PID: 1 Comm: swapper Tainted: G        W         4.18.0-rc6-00010-gff33d1030a6c #1
>> NIP:  c001bff0 LR: c001c418 CTR: c01faa7c
>> REGS: cf82db40 TRAP: 0300   Tainted: G        W          (4.18.0-rc6-00010-gff33d1030a6c)
>> MSR:  00029000 <CE,EE,ME>  CR: 28002024  XER: 00000000
>> DEAR: 00000000 ESR: 00000000
>> GPR00: c001c418 cf82dbf0 cf828000 cf8de400 00000000 00000000 000000c4 000000c4
>> GPR08: c0481ea4 00000000 00000000 000000c4 22002024 00000000 c00025e8 00000000
>> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a
>> GPR24: 00029000 0000000c 00000000 cf8de410 c0494d60 c0494d60 cf8bebc0 00000001
>> NIP [c001bff0] ppc4xx_of_msi_remove+0x48/0xa0
>> LR [c001c418] ppc4xx_msi_probe+0x294/0x3b8
>> Call Trace:
>> [cf82dbf0] [00029000] 0x29000 (unreliable)
>> [cf82dc10] [c001c418] ppc4xx_msi_probe+0x294/0x3b8
>> [cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
>> [cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
>> [cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
>> [cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
>> [cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
>> [cf82dd40] [c02050c8] device_add+0x404/0x5c4
>> [cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
>> [cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
>> [cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
>> [cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
>> [cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
>> [cf82dea0] [c0002404] do_one_initcall+0x40/0x188
>> [cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
>> [cf82df30] [c0002600] kernel_init+0x18/0x104
>> [cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
>> Instruction dump:
>> 90010024 813d0024 2f890000 83c30058 41bd0014 48000038 813d0024 7f89f800
>> 409d002c 813e000c 57ea103a 3bff0001 <7c69502e> 2f830000 419effe0 4803b26d
>> ---[ end trace 8cf551077ecfc42a ]---
>>
>> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>>
>> ---
>> # bad: [639d109b21f1413c54ca7042e40a57856e7679bb] Add linux-next specific files for 20180727
>> # good: [d72e90f33aa4709ebecc5005562f52335e106a60] Linux 4.18-rc6
>> git bisect start 'HEAD' 'v4.18-rc6'
>> # bad: [7bc81125a936a25af28f2172b593bca390b0c539] Merge remote-tracking branch 'spi-nor/spi-nor/next'
>> git bisect bad 7bc81125a936a25af28f2172b593bca390b0c539
>> # bad: [659868e6488dbad1181ad21888521ff41ae45f65] Merge remote-tracking branch 'vfs/for-next'
>> git bisect bad 659868e6488dbad1181ad21888521ff41ae45f65
>> # bad: [453ff4bb24c3fa4af40995f2615ec22176e71500] Merge remote-tracking branch 'mvebu/for-next'
>> git bisect bad 453ff4bb24c3fa4af40995f2615ec22176e71500
>> # good: [ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90] Merge branch 'next/soc' into for-next
>> git bisect good ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90
>> # good: [fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8] Merge remote-tracking branch 'leaks/leaks-next'
>> git bisect good fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8
>> # good: [53b9c41f0d9c35e41ea884bae6ad4b6fadc59035] Merge branch 'next/drivers' into for-next
>> git bisect good 53b9c41f0d9c35e41ea884bae6ad4b6fadc59035
>> # bad: [cd67b2d4c0ca61f7e93e622dba0164fb176975b4] Merge remote-tracking branch 'arm-soc/for-next'
>> git bisect bad cd67b2d4c0ca61f7e93e622dba0164fb176975b4
>> # good: [a0c166140d2e63a069263b6d3c39a42c61749d96] Merge branch 'next/drivers' into for-next
>> git bisect good a0c166140d2e63a069263b6d3c39a42c61749d96
>> # bad: [e5e08751da47170e6a05c09364595ec1abad7cec] Merge remote-tracking branch 'arm/for-next'
>> git bisect bad e5e08751da47170e6a05c09364595ec1abad7cec
>> # good: [52e19c3c1eaf103c2eb4f764825136abcfea1538] Merge branches 'clkdev', 'fixes', 'misc' and 'spectre' into for-next
>> git bisect good 52e19c3c1eaf103c2eb4f764825136abcfea1538
>> # good: [e8d4162413ecbf3b3d1451808bdbd212cec8b70c] ACPI/IORT: Set bus DMA mask as appropriate
>> git bisect good e8d4162413ecbf3b3d1451808bdbd212cec8b70c
>> # good: [186e2e8cc462aed36cc6845c938547833377582f] ACPI/IORT: Don't set default coherent DMA mask
>> git bisect good 186e2e8cc462aed36cc6845c938547833377582f
>> # bad: [deff076d4ce359c2d83983a75765b4ac8f635d2f] Merge remote-tracking branch 'dma-mapping/for-next'
>> git bisect bad deff076d4ce359c2d83983a75765b4ac8f635d2f
>> # bad: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask
>> git bisect bad ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d
>> # first bad commit: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask
>>
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-30 14:38       ` Robin Murphy
  2018-07-31  0:50         ` Guenter Roeck
@ 2018-07-31  8:19         ` Stefan Agner
  2018-07-31 12:32           ` Robin Murphy
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Agner @ 2018-07-31  8:19 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Guenter Roeck, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On 30.07.2018 16:38, Robin Murphy wrote:
> On 28/07/18 17:58, Guenter Roeck wrote:
>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>> Hi,
>>>>>
>>>>> On today's next, the bisect pointed commit
>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>
>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>      OF: Don't set default coherent DMA mask
>>>>>
>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>>> with DMA) on Iris Carrier.
>>>>>
>>>>> It looks like problem with Freescale Ethernet driver:
>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>> unknown-block(2,0): error -6
>>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>>> the available partitions:
>>>>> [   15.500188] 0100           16384 ram0
>>>>> [   15.500200]  (driver?)
>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>>> fs on unknown-block(2,0)
>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>
>>>>> Attached - defconfig and full boot log.
>>>>>
>>>>> Any hints?
>>>>> Let me know if you need any more information.
>>>>
>>>> My Exynos boards also fail to boot on missing network:
>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>
>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>> later dwc3 driver fails with:
>>>>      dwc3: probe of 12400000.dwc3 failed with error -12
>>>> which is probably the answer why LAN attached to USB is not present.
>>>
>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>
>> I would call it a serious regression. Also, no longer setting a default
>> coherent DMA mask is a quite substantial behavioral change, especially
>> if and since the code worked just fine up to now.
> 
> To reiterate, that particular side-effect was an unintentional
> oversight, and I was simply (un)lucky enough that none of the drivers
> I did test depended on that default mask. Sorry for the blip; please
> check whether it's now fixed in next-20180730 as it should be.
> 

Just for my understanding:

Your first patch ("OF: Don't set default coherent DMA mask") sounded
like that *not* setting default coherent DMA mask was intentionally.
Since the commit message reads: "...the bus code has not initialised any
default value" that was assuming that all bus code sets a default DMA
mask which wasn't the case for "simple-bus".

So I guess that is what ("of/platform: Initialise default DMA masks")
makes up for in the typical device tree case ("simple-bus")?

Now, since almost all drivers are inside a soc "simple-bus" and DMA mask
is set again, can/should we rely on the coherent DMA mask set?

Or is the expectation still that this is set on driver level too?

It seems that many drivers were affected in the vf610 case (according to
the log in Krzysztof initial message), e.g.
[    0.237851] gpio-vf610 4004d000.gpio: DMA mask not set
[    0.240304] fsl-ftm-pwm 40038000.pwm: DMA mask not set
[    0.886031] fsl-lpuart 40028000.serial: DMA mask not set
[    0.958600] vf610_nfc 400e0000.nand: DMA mask not set
[    1.055900] fsl-dspi 4002d000.dspi1: DMA mask not set
[    1.393539] fec 400d1000.ethernet: DMA mask not set

--
Stefan


>> Crash when booting sam460ex attached below, as is a bisect log.
> 
> Nevertheless, like most of the others that came out of the woodwork,
> that appears to be a crash due to a broken cleanup path down the line
> from dma_alloc_coherent() returning NULL - that warrants fixing (or
> just removing) in its own right, because cleanup code which has never
> been tested and doesn't actually work is little more than a pointless
> waste of space.
> 
> Robin.
> 
>>
>> Guenter
>>
>> ---
>> irq: type mismatch, failed to map hwirq-0 for interrupt-controller3!
>> WARNING: CPU: 0 PID: 1 at ppc4xx_msi_probe+0x2dc/0x3b8
>> Modules linked in:
>> CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-rc6-00010-gff33d1030a6c #1
>> NIP:  c001c460 LR: c001c29c CTR: 00000000
>> REGS: cf82db60 TRAP: 0700   Not tainted  (4.18.0-rc6-00010-gff33d1030a6c)
>> MSR:  00029000 <CE,EE,ME>  CR: 24002028  XER: 00000000
>>
>> GPR00: c001c29c cf82dc10 cf828000 d1021000 d1021000 cf882108 cf82db78 00000000
>> GPR08: 00000000 c0377ae4 00000000 1000051b 24002028 00000000 c00025e8 00000000
>> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a
>> GPR24: 00029000 0000000c 10000000 cf8de410 c0494d60 00029000 cf8bebc0 cf8de400
>> NIP [c001c460] ppc4xx_msi_probe+0x2dc/0x3b8
>> LR [c001c29c] ppc4xx_msi_probe+0x118/0x3b8
>> Call Trace:
>> [cf82dc10] [c001c29c] ppc4xx_msi_probe+0x118/0x3b8 (unreliable)
>> [cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
>> [cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
>> [cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
>> [cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
>> [cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
>> [cf82dd40] [c02050c8] device_add+0x404/0x5c4
>> [cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
>> [cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
>> [cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
>> [cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
>> [cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
>> [cf82dea0] [c0002404] do_one_initcall+0x40/0x188
>> [cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
>> [cf82df30] [c0002600] kernel_init+0x18/0x104
>> [cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
>> Instruction dump:
>> 3860000e 4bffa2a5 3860000f 7f44d378 4bffa299 4bfffe30 3860000e 4bffa28d
>> 3860000f 7f24cb78 4bffa281 4bfffde4 <0fe00000> 81290000 2f890000 409efe6c
>> ---[ end trace 8cf551077ecfc429 ]---
>> ppc4xx-msi c10000000.ppc4xx-msi: coherent DMA mask is unset
>> Unable to handle kernel paging request for data at address 0x00000000
>> Faulting instruction address: 0xc001bff0
>> Oops: Kernel access of bad area, sig: 11 [#1]
>> BE Canyonlands
>> Modules linked in:
>> CPU: 0 PID: 1 Comm: swapper Tainted: G        W         4.18.0-rc6-00010-gff33d1030a6c #1
>> NIP:  c001bff0 LR: c001c418 CTR: c01faa7c
>> REGS: cf82db40 TRAP: 0300   Tainted: G        W          (4.18.0-rc6-00010-gff33d1030a6c)
>> MSR:  00029000 <CE,EE,ME>  CR: 28002024  XER: 00000000
>> DEAR: 00000000 ESR: 00000000
>> GPR00: c001c418 cf82dbf0 cf828000 cf8de400 00000000 00000000 000000c4 000000c4
>> GPR08: c0481ea4 00000000 00000000 000000c4 22002024 00000000 c00025e8 00000000
>> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0492380 0000004a
>> GPR24: 00029000 0000000c 00000000 cf8de410 c0494d60 c0494d60 cf8bebc0 00000001
>> NIP [c001bff0] ppc4xx_of_msi_remove+0x48/0xa0
>> LR [c001c418] ppc4xx_msi_probe+0x294/0x3b8
>> Call Trace:
>> [cf82dbf0] [00029000] 0x29000 (unreliable)
>> [cf82dc10] [c001c418] ppc4xx_msi_probe+0x294/0x3b8
>> [cf82dc70] [c0209fbc] platform_drv_probe+0x40/0x9c
>> [cf82dc90] [c0208240] driver_probe_device+0x2a8/0x350
>> [cf82dcc0] [c0206204] bus_for_each_drv+0x60/0xac
>> [cf82dcf0] [c0207e88] __device_attach+0xe8/0x160
>> [cf82dd20] [c02071e0] bus_probe_device+0xa0/0xbc
>> [cf82dd40] [c02050c8] device_add+0x404/0x5c4
>> [cf82dd90] [c0288978] of_platform_device_create_pdata+0x88/0xd8
>> [cf82ddb0] [c0288b70] of_platform_bus_create+0x134/0x220
>> [cf82de10] [c0288bcc] of_platform_bus_create+0x190/0x220
>> [cf82de70] [c0288cf4] of_platform_bus_probe+0x98/0xec
>> [cf82de90] [c0449650] __machine_initcall_canyonlands_ppc460ex_device_probe+0x38/0x54
>> [cf82dea0] [c0002404] do_one_initcall+0x40/0x188
>> [cf82df00] [c043daec] kernel_init_freeable+0x130/0x1d0
>> [cf82df30] [c0002600] kernel_init+0x18/0x104
>> [cf82df40] [c000c23c] ret_from_kernel_thread+0x14/0x1c
>> Instruction dump:
>> 90010024 813d0024 2f890000 83c30058 41bd0014 48000038 813d0024 7f89f800
>> 409d002c 813e000c 57ea103a 3bff0001 <7c69502e> 2f830000 419effe0 4803b26d
>> ---[ end trace 8cf551077ecfc42a ]---
>>
>> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>>
>> ---
>> # bad: [639d109b21f1413c54ca7042e40a57856e7679bb] Add linux-next specific files for 20180727
>> # good: [d72e90f33aa4709ebecc5005562f52335e106a60] Linux 4.18-rc6
>> git bisect start 'HEAD' 'v4.18-rc6'
>> # bad: [7bc81125a936a25af28f2172b593bca390b0c539] Merge remote-tracking branch 'spi-nor/spi-nor/next'
>> git bisect bad 7bc81125a936a25af28f2172b593bca390b0c539
>> # bad: [659868e6488dbad1181ad21888521ff41ae45f65] Merge remote-tracking branch 'vfs/for-next'
>> git bisect bad 659868e6488dbad1181ad21888521ff41ae45f65
>> # bad: [453ff4bb24c3fa4af40995f2615ec22176e71500] Merge remote-tracking branch 'mvebu/for-next'
>> git bisect bad 453ff4bb24c3fa4af40995f2615ec22176e71500
>> # good: [ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90] Merge branch 'next/soc' into for-next
>> git bisect good ebc949ee3c7e28b6554f00fcdaf2c0c8aae54d90
>> # good: [fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8] Merge remote-tracking branch 'leaks/leaks-next'
>> git bisect good fef31ecbe2ecbb518ad1db37282eb97ca6dd29b8
>> # good: [53b9c41f0d9c35e41ea884bae6ad4b6fadc59035] Merge branch 'next/drivers' into for-next
>> git bisect good 53b9c41f0d9c35e41ea884bae6ad4b6fadc59035
>> # bad: [cd67b2d4c0ca61f7e93e622dba0164fb176975b4] Merge remote-tracking branch 'arm-soc/for-next'
>> git bisect bad cd67b2d4c0ca61f7e93e622dba0164fb176975b4
>> # good: [a0c166140d2e63a069263b6d3c39a42c61749d96] Merge branch 'next/drivers' into for-next
>> git bisect good a0c166140d2e63a069263b6d3c39a42c61749d96
>> # bad: [e5e08751da47170e6a05c09364595ec1abad7cec] Merge remote-tracking branch 'arm/for-next'
>> git bisect bad e5e08751da47170e6a05c09364595ec1abad7cec
>> # good: [52e19c3c1eaf103c2eb4f764825136abcfea1538] Merge branches 'clkdev', 'fixes', 'misc' and 'spectre' into for-next
>> git bisect good 52e19c3c1eaf103c2eb4f764825136abcfea1538
>> # good: [e8d4162413ecbf3b3d1451808bdbd212cec8b70c] ACPI/IORT: Set bus DMA mask as appropriate
>> git bisect good e8d4162413ecbf3b3d1451808bdbd212cec8b70c
>> # good: [186e2e8cc462aed36cc6845c938547833377582f] ACPI/IORT: Don't set default coherent DMA mask
>> git bisect good 186e2e8cc462aed36cc6845c938547833377582f
>> # bad: [deff076d4ce359c2d83983a75765b4ac8f635d2f] Merge remote-tracking branch 'dma-mapping/for-next'
>> git bisect bad deff076d4ce359c2d83983a75765b4ac8f635d2f
>> # bad: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask
>> git bisect bad ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d
>> # first bad commit: [ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d] OF: Don't set default coherent DMA mask
>>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31  8:19         ` Stefan Agner
@ 2018-07-31 12:32           ` Robin Murphy
  2018-07-31 13:26             ` Guenter Roeck
  2018-07-31 15:53             ` Stefan Agner
  0 siblings, 2 replies; 19+ messages in thread
From: Robin Murphy @ 2018-07-31 12:32 UTC (permalink / raw)
  To: Stefan Agner
  Cc: Guenter Roeck, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On 31/07/18 09:19, Stefan Agner wrote:
> On 30.07.2018 16:38, Robin Murphy wrote:
>> On 28/07/18 17:58, Guenter Roeck wrote:
>>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> On today's next, the bisect pointed commit
>>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>>
>>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>>       OF: Don't set default coherent DMA mask
>>>>>>
>>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>>>> with DMA) on Iris Carrier.
>>>>>>
>>>>>> It looks like problem with Freescale Ethernet driver:
>>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>>> unknown-block(2,0): error -6
>>>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>>>> the available partitions:
>>>>>> [   15.500188] 0100           16384 ram0
>>>>>> [   15.500200]  (driver?)
>>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>>>> fs on unknown-block(2,0)
>>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>>
>>>>>> Attached - defconfig and full boot log.
>>>>>>
>>>>>> Any hints?
>>>>>> Let me know if you need any more information.
>>>>>
>>>>> My Exynos boards also fail to boot on missing network:
>>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>>
>>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>>> later dwc3 driver fails with:
>>>>>       dwc3: probe of 12400000.dwc3 failed with error -12
>>>>> which is probably the answer why LAN attached to USB is not present.
>>>>
>>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>>
>>> I would call it a serious regression. Also, no longer setting a default
>>> coherent DMA mask is a quite substantial behavioral change, especially
>>> if and since the code worked just fine up to now.
>>
>> To reiterate, that particular side-effect was an unintentional
>> oversight, and I was simply (un)lucky enough that none of the drivers
>> I did test depended on that default mask. Sorry for the blip; please
>> check whether it's now fixed in next-20180730 as it should be.
>>
> 
> Just for my understanding:
> 
> Your first patch ("OF: Don't set default coherent DMA mask") sounded
> like that *not* setting default coherent DMA mask was intentionally.
> Since the commit message reads: "...the bus code has not initialised any
> default value" that was assuming that all bus code sets a default DMA
> mask which wasn't the case for "simple-bus".

Yes, reading the patches in the order they were written is perhaps a 
little unclear, but hopefully the order in which they are now applied 
makes more sense.

> So I guess that is what ("of/platform: Initialise default DMA masks")
> makes up for in the typical device tree case ("simple-bus")?

Indeed, I'd missed the fact that the now-out-of-place-looking 
initialisation in of_dma_configure() still actually belonged to 
of_platform_device_create_pdata() - that patch should make the 
assumptions of "OF: Don't set default coherent DMA mask" true again, 
even for OF-platform devices.

> Now, since almost all drivers are inside a soc "simple-bus" and DMA mask
> is set again, can/should we rely on the coherent DMA mask set?
> 
> Or is the expectation still that this is set on driver level too?

Ideally, we'd like all drivers to explicitly request their masks as the 
documentation in DMA-API-HOWTO.txt recommends, if only to ensure DMA is 
actually possible - there can be systems where even the default 32-bit 
mask is no good - but clearly we're a little way off trying to enforce 
that just yet.

Robin.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 12:32           ` Robin Murphy
@ 2018-07-31 13:26             ` Guenter Roeck
  2018-07-31 14:09               ` Robin Murphy
  2018-07-31 15:53             ` Stefan Agner
  1 sibling, 1 reply; 19+ messages in thread
From: Guenter Roeck @ 2018-07-31 13:26 UTC (permalink / raw)
  To: Robin Murphy, Stefan Agner
  Cc: Christoph Hellwig, Krzysztof Kozlowski, Ard Biesheuvel,
	Rob Herring, Frank Rowand, devicetree, linux-kernel, Fugang Duan

On 07/31/2018 05:32 AM, Robin Murphy wrote:
> On 31/07/18 09:19, Stefan Agner wrote:
>> On 30.07.2018 16:38, Robin Murphy wrote:
>>> On 28/07/18 17:58, Guenter Roeck wrote:
>>>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> On today's next, the bisect pointed commit
>>>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>>>
>>>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>>>       OF: Don't set default coherent DMA mask
>>>>>>>
>>>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>>>>> with DMA) on Iris Carrier.
>>>>>>>
>>>>>>> It looks like problem with Freescale Ethernet driver:
>>>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>>>> unknown-block(2,0): error -6
>>>>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>>>>> the available partitions:
>>>>>>> [   15.500188] 0100           16384 ram0
>>>>>>> [   15.500200]  (driver?)
>>>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>>>>> fs on unknown-block(2,0)
>>>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>>>
>>>>>>> Attached - defconfig and full boot log.
>>>>>>>
>>>>>>> Any hints?
>>>>>>> Let me know if you need any more information.
>>>>>>
>>>>>> My Exynos boards also fail to boot on missing network:
>>>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>>>
>>>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>>>> later dwc3 driver fails with:
>>>>>>       dwc3: probe of 12400000.dwc3 failed with error -12
>>>>>> which is probably the answer why LAN attached to USB is not present.
>>>>>
>>>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>>>
>>>> I would call it a serious regression. Also, no longer setting a default
>>>> coherent DMA mask is a quite substantial behavioral change, especially
>>>> if and since the code worked just fine up to now.
>>>
>>> To reiterate, that particular side-effect was an unintentional
>>> oversight, and I was simply (un)lucky enough that none of the drivers
>>> I did test depended on that default mask. Sorry for the blip; please
>>> check whether it's now fixed in next-20180730 as it should be.
>>>
>>
>> Just for my understanding:
>>
>> Your first patch ("OF: Don't set default coherent DMA mask") sounded
>> like that *not* setting default coherent DMA mask was intentionally.
>> Since the commit message reads: "...the bus code has not initialised any
>> default value" that was assuming that all bus code sets a default DMA
>> mask which wasn't the case for "simple-bus".
> 
> Yes, reading the patches in the order they were written is perhaps a little unclear, but hopefully the order in which they are now applied makes more sense.
> 
>> So I guess that is what ("of/platform: Initialise default DMA masks")
>> makes up for in the typical device tree case ("simple-bus")?
> 
> Indeed, I'd missed the fact that the now-out-of-place-looking initialisation in of_dma_configure() still actually belonged to of_platform_device_create_pdata() - that patch should make the assumptions of "OF: Don't set default coherent DMA mask" true again, even for OF-platform devices.
> 
>> Now, since almost all drivers are inside a soc "simple-bus" and DMA mask
>> is set again, can/should we rely on the coherent DMA mask set?
>>
>> Or is the expectation still that this is set on driver level too?
> 
> Ideally, we'd like all drivers to explicitly request their masks as the documentation in DMA-API-HOWTO.txt recommends, if only to ensure DMA is actually possible - there can be systems where even the default 32-bit mask is no good - but clearly we're a little way off trying to enforce that just yet.
> 
> Robin.
> 

Please note that sparc images still generate the warning (next-20180731).

sunlance ffd35110: DMA mask not set
sunlance.c:v2.02 8/24/03 Miguel de Icaza (miguel@nuclecu.unam.mx)
ioremap: done with statics, switching to malloc
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 sparc_lance_probe_one+0x428/0x4f4

esp ffd38e90: DMA mask not set
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 esp_sbus_probe+0x408/0x6e8

Guenter


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 13:26             ` Guenter Roeck
@ 2018-07-31 14:09               ` Robin Murphy
  2018-07-31 15:43                 ` Guenter Roeck
  0 siblings, 1 reply; 19+ messages in thread
From: Robin Murphy @ 2018-07-31 14:09 UTC (permalink / raw)
  To: Guenter Roeck, Stefan Agner
  Cc: Christoph Hellwig, Krzysztof Kozlowski, Ard Biesheuvel,
	Rob Herring, Frank Rowand, devicetree, linux-kernel, Fugang Duan

On 31/07/18 14:26, Guenter Roeck wrote:
> On 07/31/2018 05:32 AM, Robin Murphy wrote:
>> On 31/07/18 09:19, Stefan Agner wrote:
>>> On 30.07.2018 16:38, Robin Murphy wrote:
>>>> On 28/07/18 17:58, Guenter Roeck wrote:
>>>>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>>>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> 
>>>>>>> wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> On today's next, the bisect pointed commit
>>>>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot 
>>>>>>>> failures
>>>>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>>>>
>>>>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>>>>       OF: Don't set default coherent DMA mask
>>>>>>>>
>>>>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial 
>>>>>>>> configured
>>>>>>>> with DMA) on Iris Carrier.
>>>>>>>>
>>>>>>>> It looks like problem with Freescale Ethernet driver:
>>>>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA 
>>>>>>>> mask is unset
>>>>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic 
>>>>>>>> DMA
>>>>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>>>>> unknown-block(2,0): error -6
>>>>>>>> [   15.491664] Please append a correct "root=" boot option; here 
>>>>>>>> are
>>>>>>>> the available partitions:
>>>>>>>> [   15.500188] 0100           16384 ram0
>>>>>>>> [   15.500200]  (driver?)
>>>>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount 
>>>>>>>> root
>>>>>>>> fs on unknown-block(2,0)
>>>>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>>>>
>>>>>>>> Attached - defconfig and full boot log.
>>>>>>>>
>>>>>>>> Any hints?
>>>>>>>> Let me know if you need any more information.
>>>>>>>
>>>>>>> My Exynos boards also fail to boot on missing network:
>>>>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>>>>
>>>>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>>>>> later dwc3 driver fails with:
>>>>>>>       dwc3: probe of 12400000.dwc3 failed with error -12
>>>>>>> which is probably the answer why LAN attached to USB is not present.
>>>>>>
>>>>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>>>>
>>>>> I would call it a serious regression. Also, no longer setting a 
>>>>> default
>>>>> coherent DMA mask is a quite substantial behavioral change, especially
>>>>> if and since the code worked just fine up to now.
>>>>
>>>> To reiterate, that particular side-effect was an unintentional
>>>> oversight, and I was simply (un)lucky enough that none of the drivers
>>>> I did test depended on that default mask. Sorry for the blip; please
>>>> check whether it's now fixed in next-20180730 as it should be.
>>>>
>>>
>>> Just for my understanding:
>>>
>>> Your first patch ("OF: Don't set default coherent DMA mask") sounded
>>> like that *not* setting default coherent DMA mask was intentionally.
>>> Since the commit message reads: "...the bus code has not initialised any
>>> default value" that was assuming that all bus code sets a default DMA
>>> mask which wasn't the case for "simple-bus".
>>
>> Yes, reading the patches in the order they were written is perhaps a 
>> little unclear, but hopefully the order in which they are now applied 
>> makes more sense.
>>
>>> So I guess that is what ("of/platform: Initialise default DMA masks")
>>> makes up for in the typical device tree case ("simple-bus")?
>>
>> Indeed, I'd missed the fact that the now-out-of-place-looking 
>> initialisation in of_dma_configure() still actually belonged to 
>> of_platform_device_create_pdata() - that patch should make the 
>> assumptions of "OF: Don't set default coherent DMA mask" true again, 
>> even for OF-platform devices.
>>
>>> Now, since almost all drivers are inside a soc "simple-bus" and DMA mask
>>> is set again, can/should we rely on the coherent DMA mask set?
>>>
>>> Or is the expectation still that this is set on driver level too?
>>
>> Ideally, we'd like all drivers to explicitly request their masks as 
>> the documentation in DMA-API-HOWTO.txt recommends, if only to ensure 
>> DMA is actually possible - there can be systems where even the default 
>> 32-bit mask is no good - but clearly we're a little way off trying to 
>> enforce that just yet.
>>
>> Robin.
>>
> 
> Please note that sparc images still generate the warning (next-20180731).

Ugh, OK, any ideas what sparc does to create these platform devices that 
isn't of_platform_device_create_pdata() and has somehow grown an 
implicit dependency on of_dma_configure() since 4.12? I'm looking, but 
nothing jumps out...

Robin.

> sunlance ffd35110: DMA mask not set
> sunlance.c:v2.02 8/24/03 Miguel de Icaza (miguel@nuclecu.unam.mx)
> ioremap: done with statics, switching to malloc
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 
> sparc_lance_probe_one+0x428/0x4f4
> 
> esp ffd38e90: DMA mask not set
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 
> esp_sbus_probe+0x408/0x6e8
> 
> Guenter
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 14:09               ` Robin Murphy
@ 2018-07-31 15:43                 ` Guenter Roeck
  2018-07-31 15:58                   ` Robin Murphy
  0 siblings, 1 reply; 19+ messages in thread
From: Guenter Roeck @ 2018-07-31 15:43 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Stefan Agner, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On Tue, Jul 31, 2018 at 03:09:34PM +0100, Robin Murphy wrote:
> >Please note that sparc images still generate the warning (next-20180731).
> 
> Ugh, OK, any ideas what sparc does to create these platform devices that
> isn't of_platform_device_create_pdata() and has somehow grown an implicit
> dependency on of_dma_configure() since 4.12? I'm looking, but nothing jumps
> out...
> 

I suspect it might be of_device_register(), called from
	arch/sparc/kernel/of_device_64.c:scan_one_device()
	arch/sparc/kernel/of_device_32.c:scan_one_device()

Guenter

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 12:32           ` Robin Murphy
  2018-07-31 13:26             ` Guenter Roeck
@ 2018-07-31 15:53             ` Stefan Agner
  2018-07-31 16:29               ` Robin Murphy
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Agner @ 2018-07-31 15:53 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Guenter Roeck, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On 31.07.2018 14:32, Robin Murphy wrote:
> On 31/07/18 09:19, Stefan Agner wrote:
>> On 30.07.2018 16:38, Robin Murphy wrote:
>>> On 28/07/18 17:58, Guenter Roeck wrote:
>>>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> On today's next, the bisect pointed commit
>>>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>>>
>>>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>>>       OF: Don't set default coherent DMA mask
>>>>>>>
>>>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>>>>> with DMA) on Iris Carrier.
>>>>>>>
>>>>>>> It looks like problem with Freescale Ethernet driver:
>>>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>>>> unknown-block(2,0): error -6
>>>>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>>>>> the available partitions:
>>>>>>> [   15.500188] 0100           16384 ram0
>>>>>>> [   15.500200]  (driver?)
>>>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>>>>> fs on unknown-block(2,0)
>>>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>>>
>>>>>>> Attached - defconfig and full boot log.
>>>>>>>
>>>>>>> Any hints?
>>>>>>> Let me know if you need any more information.
>>>>>>
>>>>>> My Exynos boards also fail to boot on missing network:
>>>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>>>
>>>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>>>> later dwc3 driver fails with:
>>>>>>       dwc3: probe of 12400000.dwc3 failed with error -12
>>>>>> which is probably the answer why LAN attached to USB is not present.
>>>>>
>>>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>>>
>>>> I would call it a serious regression. Also, no longer setting a default
>>>> coherent DMA mask is a quite substantial behavioral change, especially
>>>> if and since the code worked just fine up to now.
>>>
>>> To reiterate, that particular side-effect was an unintentional
>>> oversight, and I was simply (un)lucky enough that none of the drivers
>>> I did test depended on that default mask. Sorry for the blip; please
>>> check whether it's now fixed in next-20180730 as it should be.
>>>
>>
>> Just for my understanding:
>>
>> Your first patch ("OF: Don't set default coherent DMA mask") sounded
>> like that *not* setting default coherent DMA mask was intentionally.
>> Since the commit message reads: "...the bus code has not initialised any
>> default value" that was assuming that all bus code sets a default DMA
>> mask which wasn't the case for "simple-bus".
> 
> Yes, reading the patches in the order they were written is perhaps a
> little unclear, but hopefully the order in which they are now applied
> makes more sense.
> 
>> So I guess that is what ("of/platform: Initialise default DMA masks")
>> makes up for in the typical device tree case ("simple-bus")?
> 
> Indeed, I'd missed the fact that the now-out-of-place-looking
> initialisation in of_dma_configure() still actually belonged to
> of_platform_device_create_pdata() - that patch should make the
> assumptions of "OF: Don't set default coherent DMA mask" true again,
> even for OF-platform devices.
> 
>> Now, since almost all drivers are inside a soc "simple-bus" and DMA mask
>> is set again, can/should we rely on the coherent DMA mask set?
>>
>> Or is the expectation still that this is set on driver level too?
> 
> Ideally, we'd like all drivers to explicitly request their masks as
> the documentation in DMA-API-HOWTO.txt recommends, if only to ensure
> DMA is actually possible - there can be systems where even the default
> 32-bit mask is no good - but clearly we're a little way off trying to
> enforce that just yet.

In the FEC driver case, there is an integrated DMA (uDMA). It has
alignment restrictions, but can otherwise address the full 32-bit range.

So something like this should do it right?

	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) {
		dev_warn(dev, "No suitable DMA available\n");
		return -ENODEV;
	}

However, that, as far as I understand, still requires that the bus set
up dma_mask properly.

Should I be using dma_coerce_mask_and_coherent?

--
Stefan

> 
> Robin.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 15:43                 ` Guenter Roeck
@ 2018-07-31 15:58                   ` Robin Murphy
  2018-07-31 17:38                     ` Guenter Roeck
  0 siblings, 1 reply; 19+ messages in thread
From: Robin Murphy @ 2018-07-31 15:58 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Stefan Agner, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On 31/07/18 16:43, Guenter Roeck wrote:
> On Tue, Jul 31, 2018 at 03:09:34PM +0100, Robin Murphy wrote:
>>> Please note that sparc images still generate the warning (next-20180731).
>>
>> Ugh, OK, any ideas what sparc does to create these platform devices that
>> isn't of_platform_device_create_pdata() and has somehow grown an implicit
>> dependency on of_dma_configure() since 4.12? I'm looking, but nothing jumps
>> out...
>>
> 
> I suspect it might be of_device_register(), called from
> 	arch/sparc/kernel/of_device_64.c:scan_one_device()
> 	arch/sparc/kernel/of_device_32.c:scan_one_device()

Right, that's as far as I got as well, so I'm struggling to see how 
these things ever got DMA masks set before the of_dma_configure() call 
moved out of of_platform_device_create_pdata(), or why it wasn't a 
problem prior to the generic dma_ops rework if they didn't :/

Robin.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 15:53             ` Stefan Agner
@ 2018-07-31 16:29               ` Robin Murphy
  2018-07-31 19:02                 ` Stefan Agner
  0 siblings, 1 reply; 19+ messages in thread
From: Robin Murphy @ 2018-07-31 16:29 UTC (permalink / raw)
  To: Stefan Agner
  Cc: Guenter Roeck, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On 31/07/18 16:53, Stefan Agner wrote:
> On 31.07.2018 14:32, Robin Murphy wrote:
>> On 31/07/18 09:19, Stefan Agner wrote:
>>> On 30.07.2018 16:38, Robin Murphy wrote:
>>>> On 28/07/18 17:58, Guenter Roeck wrote:
>>>>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>>>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> On today's next, the bisect pointed commit
>>>>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>>>>
>>>>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>>>>        OF: Don't set default coherent DMA mask
>>>>>>>>
>>>>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>>>>>> with DMA) on Iris Carrier.
>>>>>>>>
>>>>>>>> It looks like problem with Freescale Ethernet driver:
>>>>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>>>>> unknown-block(2,0): error -6
>>>>>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>>>>>> the available partitions:
>>>>>>>> [   15.500188] 0100           16384 ram0
>>>>>>>> [   15.500200]  (driver?)
>>>>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>>>>>> fs on unknown-block(2,0)
>>>>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>>>>
>>>>>>>> Attached - defconfig and full boot log.
>>>>>>>>
>>>>>>>> Any hints?
>>>>>>>> Let me know if you need any more information.
>>>>>>>
>>>>>>> My Exynos boards also fail to boot on missing network:
>>>>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>>>>
>>>>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>>>>> later dwc3 driver fails with:
>>>>>>>        dwc3: probe of 12400000.dwc3 failed with error -12
>>>>>>> which is probably the answer why LAN attached to USB is not present.
>>>>>>
>>>>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>>>>
>>>>> I would call it a serious regression. Also, no longer setting a default
>>>>> coherent DMA mask is a quite substantial behavioral change, especially
>>>>> if and since the code worked just fine up to now.
>>>>
>>>> To reiterate, that particular side-effect was an unintentional
>>>> oversight, and I was simply (un)lucky enough that none of the drivers
>>>> I did test depended on that default mask. Sorry for the blip; please
>>>> check whether it's now fixed in next-20180730 as it should be.
>>>>
>>>
>>> Just for my understanding:
>>>
>>> Your first patch ("OF: Don't set default coherent DMA mask") sounded
>>> like that *not* setting default coherent DMA mask was intentionally.
>>> Since the commit message reads: "...the bus code has not initialised any
>>> default value" that was assuming that all bus code sets a default DMA
>>> mask which wasn't the case for "simple-bus".
>>
>> Yes, reading the patches in the order they were written is perhaps a
>> little unclear, but hopefully the order in which they are now applied
>> makes more sense.
>>
>>> So I guess that is what ("of/platform: Initialise default DMA masks")
>>> makes up for in the typical device tree case ("simple-bus")?
>>
>> Indeed, I'd missed the fact that the now-out-of-place-looking
>> initialisation in of_dma_configure() still actually belonged to
>> of_platform_device_create_pdata() - that patch should make the
>> assumptions of "OF: Don't set default coherent DMA mask" true again,
>> even for OF-platform devices.
>>
>>> Now, since almost all drivers are inside a soc "simple-bus" and DMA mask
>>> is set again, can/should we rely on the coherent DMA mask set?
>>>
>>> Or is the expectation still that this is set on driver level too?
>>
>> Ideally, we'd like all drivers to explicitly request their masks as
>> the documentation in DMA-API-HOWTO.txt recommends, if only to ensure
>> DMA is actually possible - there can be systems where even the default
>> 32-bit mask is no good - but clearly we're a little way off trying to
>> enforce that just yet.
> 
> In the FEC driver case, there is an integrated DMA (uDMA). It has
> alignment restrictions, but can otherwise address the full 32-bit range.
> 
> So something like this should do it right?
> 
> 	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) {
> 		dev_warn(dev, "No suitable DMA available\n");
> 		return -ENODEV;
> 	}
> 

Yup, precisely.

> However, that, as far as I understand, still requires that the bus set
> up dma_mask properly.
> 
> Should I be using dma_coerce_mask_and_coherent?

AFAICS for FEC, the ColdFire instances have statically-set masks, the 
i.MX boardfiles get them set via platform+device_register_full(), and 
now that the bug-which-never-should-have-been is fixed the DT-based 
instances should be fine too, so you should be good to go. In general 
I'd say that the dma_coerce_mask*() routines are only really for generic 
interface drivers like *HCI where they don't really know what the 
underlying device is and it may be on any old random bus. Drivers for 
specific IP blocks normally only have one or two known buses to deal 
with, so in most cases it's more reasonable to make the bus code 
well-behaved if it isn't already.

Robin.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 15:58                   ` Robin Murphy
@ 2018-07-31 17:38                     ` Guenter Roeck
  2018-08-01 16:33                       ` Robin Murphy
  0 siblings, 1 reply; 19+ messages in thread
From: Guenter Roeck @ 2018-07-31 17:38 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Stefan Agner, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On Tue, Jul 31, 2018 at 04:58:41PM +0100, Robin Murphy wrote:
> On 31/07/18 16:43, Guenter Roeck wrote:
> >On Tue, Jul 31, 2018 at 03:09:34PM +0100, Robin Murphy wrote:
> >>>Please note that sparc images still generate the warning (next-20180731).
> >>
> >>Ugh, OK, any ideas what sparc does to create these platform devices that
> >>isn't of_platform_device_create_pdata() and has somehow grown an implicit
> >>dependency on of_dma_configure() since 4.12? I'm looking, but nothing jumps
> >>out...
> >>
> >
> >I suspect it might be of_device_register(), called from
> >	arch/sparc/kernel/of_device_64.c:scan_one_device()
> >	arch/sparc/kernel/of_device_32.c:scan_one_device()
> 
> Right, that's as far as I got as well, so I'm struggling to see how these
> things ever got DMA masks set before the of_dma_configure() call moved out
> of of_platform_device_create_pdata(), or why it wasn't a problem prior to
> the generic dma_ops rework if they didn't :/
> 
Ah, ok. No idea, sorry. All I know is that the messages were first seen
with next-20180727.

Guenter

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 16:29               ` Robin Murphy
@ 2018-07-31 19:02                 ` Stefan Agner
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Agner @ 2018-07-31 19:02 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Guenter Roeck, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On 31.07.2018 18:29, Robin Murphy wrote:
> On 31/07/18 16:53, Stefan Agner wrote:
>> On 31.07.2018 14:32, Robin Murphy wrote:
>>> On 31/07/18 09:19, Stefan Agner wrote:
>>>> On 30.07.2018 16:38, Robin Murphy wrote:
>>>>> On 28/07/18 17:58, Guenter Roeck wrote:
>>>>>> On Fri, Jul 27, 2018 at 04:04:48PM +0200, Christoph Hellwig wrote:
>>>>>>> On Fri, Jul 27, 2018 at 03:18:14PM +0200, Krzysztof Kozlowski wrote:
>>>>>>>> On 27 July 2018 at 15:11, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> On today's next, the bisect pointed commit
>>>>>>>>> ff33d1030a6ca87cea9a41e1a2ea7750a781ab3d as fault for my boot failures
>>>>>>>>> with NFSv4 root on Toradex Colibri VF50 (Iris carrier board).
>>>>>>>>>
>>>>>>>>> Author: Robin Murphy <robin.murphy@arm.com>
>>>>>>>>> Date:   Mon Jul 23 23:16:12 2018 +0100
>>>>>>>>>        OF: Don't set default coherent DMA mask
>>>>>>>>>
>>>>>>>>> Board: Toradex Colibri VF50 (NXP VF500, Cortex A5, serial configured
>>>>>>>>> with DMA) on Iris Carrier.
>>>>>>>>>
>>>>>>>>> It looks like problem with Freescale Ethernet driver:
>>>>>>>>> [   15.458477] fsl-edma 40018000.dma-controller: coherent DMA mask is unset
>>>>>>>>> [   15.465284] fsl-lpuart 40027000.serial: Cannot prepare cyclic DMA
>>>>>>>>> [   15.472086] Root-NFS: no NFS server address
>>>>>>>>> [   15.476359] VFS: Unable to mount root fs via NFS, trying floppy.
>>>>>>>>> [   15.484228] VFS: Cannot open root device "nfs" or
>>>>>>>>> unknown-block(2,0): error -6
>>>>>>>>> [   15.491664] Please append a correct "root=" boot option; here are
>>>>>>>>> the available partitions:
>>>>>>>>> [   15.500188] 0100           16384 ram0
>>>>>>>>> [   15.500200]  (driver?)
>>>>>>>>> [   15.506406] Kernel panic - not syncing: VFS: Unable to mount root
>>>>>>>>> fs on unknown-block(2,0)
>>>>>>>>> [   15.514747] ---[ end Kernel panic - not syncing: VFS: Unable to
>>>>>>>>> mount root fs on unknown-block(2,0) ]---
>>>>>>>>>
>>>>>>>>> Attached - defconfig and full boot log.
>>>>>>>>>
>>>>>>>>> Any hints?
>>>>>>>>> Let me know if you need any more information.
>>>>>>>>
>>>>>>>> My Exynos boards also fail to boot on missing network:
>>>>>>>> https://krzk.eu/#/builders/21/builds/799/steps/10/logs/serial0
>>>>>>>>
>>>>>>>> As expected there are plenty of "DMA mask not set" warnings... and
>>>>>>>> later dwc3 driver fails with:
>>>>>>>>        dwc3: probe of 12400000.dwc3 failed with error -12
>>>>>>>> which is probably the answer why LAN attached to USB is not present.
>>>>>>>
>>>>>>> Looks like all the drivers failed to set a dma mask and were lucky.
>>>>>>
>>>>>> I would call it a serious regression. Also, no longer setting a default
>>>>>> coherent DMA mask is a quite substantial behavioral change, especially
>>>>>> if and since the code worked just fine up to now.
>>>>>
>>>>> To reiterate, that particular side-effect was an unintentional
>>>>> oversight, and I was simply (un)lucky enough that none of the drivers
>>>>> I did test depended on that default mask. Sorry for the blip; please
>>>>> check whether it's now fixed in next-20180730 as it should be.
>>>>>
>>>>
>>>> Just for my understanding:
>>>>
>>>> Your first patch ("OF: Don't set default coherent DMA mask") sounded
>>>> like that *not* setting default coherent DMA mask was intentionally.
>>>> Since the commit message reads: "...the bus code has not initialised any
>>>> default value" that was assuming that all bus code sets a default DMA
>>>> mask which wasn't the case for "simple-bus".
>>>
>>> Yes, reading the patches in the order they were written is perhaps a
>>> little unclear, but hopefully the order in which they are now applied
>>> makes more sense.
>>>
>>>> So I guess that is what ("of/platform: Initialise default DMA masks")
>>>> makes up for in the typical device tree case ("simple-bus")?
>>>
>>> Indeed, I'd missed the fact that the now-out-of-place-looking
>>> initialisation in of_dma_configure() still actually belonged to
>>> of_platform_device_create_pdata() - that patch should make the
>>> assumptions of "OF: Don't set default coherent DMA mask" true again,
>>> even for OF-platform devices.
>>>
>>>> Now, since almost all drivers are inside a soc "simple-bus" and DMA mask
>>>> is set again, can/should we rely on the coherent DMA mask set?
>>>>
>>>> Or is the expectation still that this is set on driver level too?
>>>
>>> Ideally, we'd like all drivers to explicitly request their masks as
>>> the documentation in DMA-API-HOWTO.txt recommends, if only to ensure
>>> DMA is actually possible - there can be systems where even the default
>>> 32-bit mask is no good - but clearly we're a little way off trying to
>>> enforce that just yet.
>>
>> In the FEC driver case, there is an integrated DMA (uDMA). It has
>> alignment restrictions, but can otherwise address the full 32-bit range.
>>
>> So something like this should do it right?
>>
>> 	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) {
>> 		dev_warn(dev, "No suitable DMA available\n");
>> 		return -ENODEV;
>> 	}
>>
> 
> Yup, precisely.
> 
>> However, that, as far as I understand, still requires that the bus set
>> up dma_mask properly.
>>
>> Should I be using dma_coerce_mask_and_coherent?
> 
> AFAICS for FEC, the ColdFire instances have statically-set masks, the
> i.MX boardfiles get them set via platform+device_register_full(), and
> now that the bug-which-never-should-have-been is fixed the DT-based
> instances should be fine too, so you should be good to go. In general
> I'd say that the dma_coerce_mask*() routines are only really for
> generic interface drivers like *HCI where they don't really know what
> the underlying device is and it may be on any old random bus. Drivers
> for specific IP blocks normally only have one or two known buses to
> deal with, so in most cases it's more reasonable to make the bus code
> well-behaved if it isn't already.

Got it, with your patch the underlying bus of the DT case is well
behaving again.

Will send a patch which makes use of dma_set_mask_and_coherent.

Thanks for your clarification!

--
Stefan

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-07-31 17:38                     ` Guenter Roeck
@ 2018-08-01 16:33                       ` Robin Murphy
  2018-08-01 18:23                         ` Guenter Roeck
  0 siblings, 1 reply; 19+ messages in thread
From: Robin Murphy @ 2018-08-01 16:33 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Stefan Agner, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On 31/07/18 18:38, Guenter Roeck wrote:
> On Tue, Jul 31, 2018 at 04:58:41PM +0100, Robin Murphy wrote:
>> On 31/07/18 16:43, Guenter Roeck wrote:
>>> On Tue, Jul 31, 2018 at 03:09:34PM +0100, Robin Murphy wrote:
>>>>> Please note that sparc images still generate the warning (next-20180731).
>>>>
>>>> Ugh, OK, any ideas what sparc does to create these platform devices that
>>>> isn't of_platform_device_create_pdata() and has somehow grown an implicit
>>>> dependency on of_dma_configure() since 4.12? I'm looking, but nothing jumps
>>>> out...
>>>>
>>>
>>> I suspect it might be of_device_register(), called from
>>> 	arch/sparc/kernel/of_device_64.c:scan_one_device()
>>> 	arch/sparc/kernel/of_device_32.c:scan_one_device()
>>
>> Right, that's as far as I got as well, so I'm struggling to see how these
>> things ever got DMA masks set before the of_dma_configure() call moved out
>> of of_platform_device_create_pdata(), or why it wasn't a problem prior to
>> the generic dma_ops rework if they didn't :/
>>
> Ah, ok. No idea, sorry. All I know is that the messages were first seen
> with next-20180727.

OK, I spent this afternoon wrangling toolchains and QEMU to boot an 
instrumented 4.11 kernel, and the answer is that the warnings are 
arguably correct. These masks have indeed never been set where they 
should have been, but then the sbus_dma_ops don't reference them anyway.

The coherent mask WARN_ON *should* have started appearing in 4.16 with 
205e1b7f51e4("dma-mapping: warn when there is no coherent_dma_mask"), 
but happened to be hidden by the inadvertent side-effect of the prior 
dma_configure() change. Since there's seemingly no actual regression of 
functionality, I'm inclined to leave this in the hands of whoever cares 
about sparc32.

Robin.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask)
  2018-08-01 16:33                       ` Robin Murphy
@ 2018-08-01 18:23                         ` Guenter Roeck
  0 siblings, 0 replies; 19+ messages in thread
From: Guenter Roeck @ 2018-08-01 18:23 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Stefan Agner, Christoph Hellwig, Krzysztof Kozlowski,
	Ard Biesheuvel, Rob Herring, Frank Rowand, devicetree,
	linux-kernel, Fugang Duan

On Wed, Aug 01, 2018 at 05:33:30PM +0100, Robin Murphy wrote:
> On 31/07/18 18:38, Guenter Roeck wrote:
> >On Tue, Jul 31, 2018 at 04:58:41PM +0100, Robin Murphy wrote:
> >>On 31/07/18 16:43, Guenter Roeck wrote:
> >>>On Tue, Jul 31, 2018 at 03:09:34PM +0100, Robin Murphy wrote:
> >>>>>Please note that sparc images still generate the warning (next-20180731).
> >>>>
> >>>>Ugh, OK, any ideas what sparc does to create these platform devices that
> >>>>isn't of_platform_device_create_pdata() and has somehow grown an implicit
> >>>>dependency on of_dma_configure() since 4.12? I'm looking, but nothing jumps
> >>>>out...
> >>>>
> >>>
> >>>I suspect it might be of_device_register(), called from
> >>>	arch/sparc/kernel/of_device_64.c:scan_one_device()
> >>>	arch/sparc/kernel/of_device_32.c:scan_one_device()
> >>
> >>Right, that's as far as I got as well, so I'm struggling to see how these
> >>things ever got DMA masks set before the of_dma_configure() call moved out
> >>of of_platform_device_create_pdata(), or why it wasn't a problem prior to
> >>the generic dma_ops rework if they didn't :/
> >>
> >Ah, ok. No idea, sorry. All I know is that the messages were first seen
> >with next-20180727.
> 
> OK, I spent this afternoon wrangling toolchains and QEMU to boot an
> instrumented 4.11 kernel, and the answer is that the warnings are arguably
> correct. These masks have indeed never been set where they should have been,
> but then the sbus_dma_ops don't reference them anyway.
> 
> The coherent mask WARN_ON *should* have started appearing in 4.16 with
> 205e1b7f51e4("dma-mapping: warn when there is no coherent_dma_mask"), but
> happened to be hidden by the inadvertent side-effect of the prior
> dma_configure() change. Since there's seemingly no actual regression of
> functionality, I'm inclined to leave this in the hands of whoever cares
> about sparc32.
> 

You mean there is now a warning stating that coherent_dma_mask is not set,
but coherent_dma_mask isn't used by sparc32 in the first place ?

Guenter

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-08-01 18:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 13:11 [BUG BISECT] Ethernet fail on VF50 (OF: Don't set default coherent DMA mask) Krzysztof Kozlowski
2018-07-27 13:18 ` Krzysztof Kozlowski
2018-07-27 14:04   ` Christoph Hellwig
2018-07-28 16:58     ` Guenter Roeck
2018-07-30  9:23       ` Christoph Hellwig
2018-07-30 14:38       ` Robin Murphy
2018-07-31  0:50         ` Guenter Roeck
2018-07-31  8:19         ` Stefan Agner
2018-07-31 12:32           ` Robin Murphy
2018-07-31 13:26             ` Guenter Roeck
2018-07-31 14:09               ` Robin Murphy
2018-07-31 15:43                 ` Guenter Roeck
2018-07-31 15:58                   ` Robin Murphy
2018-07-31 17:38                     ` Guenter Roeck
2018-08-01 16:33                       ` Robin Murphy
2018-08-01 18:23                         ` Guenter Roeck
2018-07-31 15:53             ` Stefan Agner
2018-07-31 16:29               ` Robin Murphy
2018-07-31 19:02                 ` Stefan Agner

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).