SD Card detect line on custom carrier boards

The Evaluation board uses an SD card detect line but our custom carrier board for Colibri V50 does not use one . How important is this line for the Linux Kernel? The reason we ask this question is the system boots all the through into the OS when the same Colibri V50 (with SD card) plugged in but when the colibri v50 is plugged in to our custom carrier board it experience a NMI watch dog event and crashes while trying to access the SD card . Please note we do not see this problem in boot code but only see when kernel is coming up.

Out of sample three board two board exhibit this situation but one is successful in booting all the way to the OSlink text

The only known difference is lack of SD card detect line on our custom board .

I am attaching the debug log to this question to see if it sheds any light.

Any idea to debug this really appreciated

Hi

I assume you did not customize the device tree to represent your changed hardware.
I.e. you could add the property [broken-cd] 2 and remove the existing property cd-gpios in

&esdhc1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_esdhc1>;
	bus-width = <4>;
	broken-cd;
	disable-wp;
};

Max

The property broken -cd did not make difference in my situation . We still have two boards which boot all way through and other two experience NMI watch dog event before getting to command prompt. I am here with attaching again the debug out from the CLI .

U-Boot 2015.04+fslc+g10bc451 (Jun 28 2016 - 13:25:52)

CPU: Freescale Vybrid VF500 at 396 MHz
Reset cause: POWER ON RESET
DRAM:  128 MiB
NAND:  128 MiB
MMC:   FSL_SDHC: 0
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri VF50 128MB IT V1.2A, Serial# 04892873
Net:   FEC
Hit any key to stop autoboot:  0
Booting from MMC/SD card...
4739032 bytes read in 385 ms (11.7 MiB/s)
24497 bytes read in 66 ms (362.3 KiB/s)
Kernel image @ 0x81000000 [ 0x000000 - 0x484fd8 ]
## Flattened Device Tree blob at 82000000
   Booting using the fdt blob at 0x82000000
   Using Device Tree in place at 82000000, end 82008fb0
   Updating MTD partitions...

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.14-v2.6b2+gefe965a (prutschman@doozer) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 Wed Sep 21 12:25:49 PDT 2016
[    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] Machine model: Toradex Colibri VF50 on Metafridge
[    0.000000] cma: Reserved 16 MiB at 0x86c00000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32004
[    0.000000] Kernel command line: root=/dev/mmcblk0p2 rw rootwait console=tty1 console=ttyLP0,115200n8 consoleblank=0
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    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: 102472K/129024K available (6071K kernel code, 216K rwdata, 2144K rodata, 228K init, 176K bss, 10168K 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 : 0x88000000 - 0xff800000   (1912 MB)
[    0.000000]     lowmem  : 0x80000000 - 0x87e00000   ( 126 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x8080e034   (8217 kB)
[    0.000000]       .init : 0x8080f000 - 0x80848000   ( 228 kB)
[    0.000000]       .data : 0x80848000 - 0x8087e240   ( 217 kB)
[    0.000000]        .bss : 0x8087e240 - 0x808aa338   ( 177 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000054] sched_clock: 64 bits at 132MHz, resolution 7ns, wraps every 2199023255551ns
[    0.000124] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x1e7178659b, max_idle_ns: 440795204301 ns
[    0.001284] Console: colour dummy device 80x30
[    0.002408] console [tty1] enabled
[    0.002500] Calibrating delay loop... 262.96 BogoMIPS (lpj=1314816)
[    0.070296] pid_max: default: 32768 minimum: 301
[    0.070670] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070793] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.072780] CPU: Testing write buffer coherency: ok
[    0.073783] Setting up static identity map for 0x80008200 - 0x80008258
[    0.077636] devtmpfs: initialized
[    0.093196] VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
[    0.094307] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.097578] pinctrl core: initialized pinctrl subsystem
[    0.101147] NET: Registered protocol family 16
[    0.104859] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.107730] cpuidle: using governor menu
[    0.143909] irq: no irq domain found for /soc/aips-bus@40000000/gpio@40049000 !
[    0.147266] PM: CKE/RESET pulls available, enable Suspend-to-RAM
[    0.148898] hw-breakpoint: found 2 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.149049] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.150166] vf610-pinctrl 40048000.iomuxc: initialized IMX pinctrl driver
[    0.190322] SCSI subsystem initialized
[    0.191488] usbcore: registered new interface driver usbfs
[    0.191820] usbcore: registered new interface driver hub
[    0.192203] usbcore: registered new device driver usb
[    0.195023] i2c i2c-0: IMX I2C adapter registered
[    0.195285] i2c i2c-0: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
[    0.195823] Linux video capture interface: v2.00
[    0.196236] pps_core: LinuxPPS API ver. 1 registered
[    0.196326] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.196553] PTP clock support registered
[    0.197964] Advanced Linux Sound Architecture Driver Initialized.
[    0.201365] clocksource: Switched to clocksource arm_global_timer
[    0.243056] NET: Registered protocol family 2
[    0.245408] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.245586] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.245703] TCP: Hash tables configured (established 1024 bind 1024)
[    0.246089] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.246219] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.246776] NET: Registered protocol family 1
[    0.247885] RPC: Registered named UNIX socket transport module.
[    0.248014] RPC: Registered udp transport module.
[    0.248088] RPC: Registered tcp transport module.
[    0.248154] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.250559] hw perfevents: enabled with armv7_cortex_a5 PMU driver, 3 counters available
[    0.253897] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.278270] NFS: Registering the id_resolver key type
[    0.278493] Key type id_resolver registered
[    0.278578] Key type id_legacy registered
[    0.278753] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.280751] ntfs: driver 2.1.32 [Flags: R/W].
[    0.282567] fuse init (API version 7.23)
[    0.292823] io scheduler noop registered
[    0.292963] io scheduler deadline registered
[    0.293647] io scheduler cfq registered (default)
[    0.309371] 40027000.serial: ttyLP0 at MMIO 0x40027000 (irq = 19, base_baud = 4125000) is a FSL_LPUART
[    0.813260] console [ttyLP0] enabled
[    0.818629] 40028000.serial: ttyLP1 at MMIO 0x40028000 (irq = 20, base_baud = 4125000) is a FSL_LPUART
[    0.829947] 40029000.serial: ttyLP2 at MMIO 0x40029000 (irq = 21, base_baud = 4125000) is a FSL_LPUART
[    0.842042] [drm] Initialized drm 1.1.0 20060810
[    0.857630] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    0.864486] [drm] No driver support for vblank timestamp query.
[    0.915617] Console: switching to colour frame buffer device 80x30
[    0.949579] fsl-dcu 40058000.dcu: fb0:  frame buffer device
[    0.966474] [drm] Initialized fsl-dcu-drm 1.0.0 20150213 on minor 0
[    1.007897] loop: module loaded
[    1.025937] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
[    1.043536] nand: Macronix NAND 128MiB 3,3V 8-bit
[    1.059196] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.089448] Bad block table found at page 65472, version 0x01
[    1.107059] Bad block table found at page 65408, version 0x01
[    1.124253] nand_read_bbt: bad block at 0x0000013c0000
[    1.140834] 4 ofpart partitions found on MTD device vf610_nfc
[    1.158030] Creating 4 MTD partitions on "vf610_nfc":
[    1.174661] 0x000000000000-0x000000020000 : "vf-bcb"
[    1.192813] 0x000000020000-0x000000180000 : "u-boot"
[    1.210540] 0x000000180000-0x000000200000 : "u-boot-env"
[    1.228196] 0x000000200000-0x000008000000 : "ubi"
[    1.249343] spidev spi1.0: buggy DT: spidev listed directly in DT
[    1.266359] ------------[ cut here ]------------
[    1.281574] WARNING: CPU: 0 PID: 1 at /home/prutschman/oe-core/build/out-glibc/work-shared/colibri-vf/kernel-source/drivers/spi/spidev.c:770 spidev_probe+0x1a8/0x1c4()
[    1.327755] Modules linked in:
[    1.341249] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.14-v2.6b2+gefe965a #1
[    1.359166] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[    1.376420] Backtrace:
[    1.389465] [<80013474>] (dump_backtrace) from [<8001366c>] (show_stack+0x18/0x1c)
[    1.418280]  r7:803b2598 r6:00000302 r5:00000009 r4:00000000
[    1.435343] [<80013654>] (show_stack) from [<802a016c>] (dump_stack+0x24/0x28)
[    1.464408] [<802a0148>] (dump_stack) from [<80021b64>] (warn_slowpath_common+0x88/0xb4)
[    1.494662] [<80021adc>] (warn_slowpath_common) from [<80021c34>] (warn_slowpath_null+0x24/0x2c)
[    1.526966]  r8:00000000 r7:80869b8c r6:80869b7c r5:86af4400 r4:86af4400
[    1.546462] [<80021c10>] (warn_slowpath_null) from [<803b2598>] (spidev_probe+0x1a8/0x1c4)
[    1.579227] [<803b23f0>] (spidev_probe) from [<803affd8>] (spi_drv_probe+0x84/0xb0)
[    1.612942]  r8:00000000 r7:80869b8c r6:80869b7c r5:00000000 r4:86af4400
[    1.634031] [<803aff54>] (spi_drv_probe) from [<80354644>] (driver_probe_device+0x204/0x2f8)
[    1.670173]  r7:80869b8c r6:00000000 r5:86af4400 r4:8089f82c
[    1.690313] [<80354440>] (driver_probe_device) from [<8035485c>] (__device_attach_driver+0x8c/0xb4)
[    1.726978]  r9:00000000 r8:8089f808 r7:00000001 r6:86af4400 r5:86843c78 r4:80869b8c
[    1.763459] [<803547d0>] (__device_attach_driver) from [<80352980>] (bus_for_each_drv+0x68/0x9c)
[    1.800920]  r7:00000001 r6:803547d0 r5:86843c78 r4:00000000
[    1.821524] [<80352918>] (bus_for_each_drv) from [<80354398>] (__device_attach+0xb8/0x11c)
[    1.858437]  r6:86af4434 r5:86af4400 r4:86af4400
[    1.877743] [<803542e0>] (__device_attach) from [<803548d0>] (device_initial_probe+0x14/0x18)
[    1.914716]  r7:00000000 r6:8086960c r5:86af4400 r4:86af4408
[    1.935054] [<803548bc>] (device_initial_probe) from [<803538ac>] (bus_probe_device+0x8c/0x94)
[    1.971791] [<80353820>] (bus_probe_device) from [<80351a1c>] (device_add+0x378/0x574)
[    2.007880]  r7:00000000 r6:86af4000 r5:86af4400 r4:86af4408
[    2.028180] [<803516a4>] (device_add) from [<803b06f8>] (spi_add_device+0xa0/0x138)
[    2.063643]  r10:807a3e30 r9:807a3e3c r8:80755c54 r7:868ac610 r6:86af4000 r5:00000000
[    2.099749]  r4:86af4400
[    2.116043] [<803b0658>] (spi_add_device) from [<803b1d58>] (spi_register_master+0x4b8/0x71c)
[    2.152035]  r7:87ce4c50 r6:86af4000 r5:00000000 r4:86af4400
[    2.171822] [<803b18a0>] (spi_register_master) from [<803b400c>] (dspi_probe+0x200/0x314)
[    2.207117]  r10:00000000 r9:87ce4924 r8:86aea780 r7:868ac610 r6:86af42a0 r5:868ac600
[    2.242410]  r4:86af4000
[    2.258281] [<803b3e0c>] (dspi_probe) from [<80356094>] (platform_drv_probe+0x54/0xb8)
[    2.292739]  r10:00000000 r9:00000007 r8:00000000 r7:fffffdfb r6:80869be0 r5:868ac610
[    2.327874]  r4:8089f82c
[    2.343621] [<80356040>] (platform_drv_probe) from [<80354644>] (driver_probe_device+0x204/0x2f8)
[    2.379041]  r7:80869be0 r6:00000000 r5:868ac610 r4:8089f82c
[    2.398495] [<80354440>] (driver_probe_device) from [<803547cc>] (__driver_attach+0x94/0x98)
[    2.433109]  r9:00000007 r8:8087e240 r7:00000000 r6:868ac644 r5:80869be0 r4:868ac610
[    2.467577] [<80354738>] (__driver_attach) from [<803528c0>] (bus_for_each_dev+0x70/0xa4)
[    2.502333]  r7:00000000 r6:80354738 r5:80869be0 r4:00000000
[    2.521672] [<80352850>] (bus_for_each_dev) from [<80353f30>] (driver_attach+0x24/0x28)
[    2.556697]  r6:80861a40 r5:86aad900 r4:80869be0
[    2.575115] [<80353f0c>] (driver_attach) from [<80353b68>] (bus_add_driver+0x1a8/0x220)
[    2.610021] [<803539c0>] (bus_add_driver) from [<80354f4c>] (driver_register+0x80/0x100)
[    2.645054]  r7:86aea180 r6:8084e1a0 r5:80828478 r4:80869be0
[    2.664705] [<80354ecc>] (driver_register) from [<80355fbc>] (__platform_driver_register+0x48/0x50)
[    2.701263]  r5:80828478 r4:8084e1a0
[    2.718622] [<80355f74>] (__platform_driver_register) from [<80828494>] (fsl_dspi_driver_init+0x1c/0x20)
[    2.755098] [<80828478>] (fsl_dspi_driver_init) from [<80009614>] (do_one_initcall+0x98/0x1e0)
[    2.791523] [<8000957c>] (do_one_initcall) from [<8080fe64>] (kernel_init_freeable+0x148/0x1e0)
[    2.828167]  r10:8083a838 r9:00000007 r8:8087e240 r7:8083a830 r6:8087e240 r5:80847a74
[    2.864557]  r4:8080b6f0
[    2.880821] [<8080fd1c>] (kernel_init_freeable) from [<805f07a8>] (kernel_init+0x10/0xf0)
[    2.916210]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:805f0798
[    2.951762]  r4:00000000
[    2.967754] [<805f0798>] (kernel_init) from [<8000f7f8>] (ret_from_fork+0x14/0x3c)
[    3.002124]  r5:805f0798 r4:00000000
[    3.019243] ---[ end trace ade595bfc0826987 ]---
[    3.041784] +V3.3: supplied by 3.3V
[    3.060123] pps pps0: new PPS source ptp0
[    3.086653] libphy: fec_enet_mii_bus: probed
[    3.105134] fec 400d1000.ethernet eth0: registered PHC device 0
[    3.124623] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.144548] usbcore: registered new interface driver usb-storage
[    3.163719] usbcore: registered new interface driver usbserial
[    3.181938] usbcore: registered new interface driver usbserial_generic
[    3.200400] usbserial: USB Serial support registered for generic
[    3.218398] usbcore: registered new interface driver ftdi_sio
[    3.235792] usbserial: USB Serial support registered for FTDI USB Serial Device
[    3.265054] usbcore: registered new interface driver pl2303
[    3.281826] usbserial: USB Serial support registered for pl2303
[    3.302831] 40034000.usb supply vbus not found, using dummy regulator
[    3.323407] mousedev: PS/2 mouse device common for all mice
[    3.342331] rtc-ds1307: probe of 0-0068 failed with error -5
[    3.361197] snvs_rtc 400a7000.snvs:snvs-rtc-lp: rtc core: registered 400a7000.snvs:snvs- as rtc0
[    3.391562] i2c /dev entries driver
[    3.411164] imx2-wdt 4003e000.wdog: timeout 60 sec (nowayout=0)
[    3.428682] sdhci: Secure Digital Host Controller Interface driver
[    3.445569] sdhci: Copyright(c) Pierre Ossman
[    3.460541] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.478495] /soc/aips-bus@40080000/esdhc@400b2000: voltage-ranges unspecified
[    3.496975] sdhci-esdhc-imx 400b2000.esdhc: Got CD GPIO
[    3.513830] sdhci-esdhc-imx 400b2000.esdhc: No vmmc regulator found
[    3.531449] sdhci-esdhc-imx 400b2000.esdhc: No vqmmc regulator found
[    3.581933] mmc0: SDHCI controller on 400b2000.esdhc [400b2000.esdhc] using ADMA
[    3.616498] hidraw: raw HID events driver (C) Jiri Kosina
[    3.634523] usbcore: registered new interface driver usbhid
[    3.651863] usbhid: USB HID core driver
[    3.690947] Netfilter messages via NETLINK v0.30.
[    3.707395] nfnl_acct: registering with nfnetlink.
[    3.723690] nf_conntrack version 0.5.0 (1857 buckets, 7428 max)
[    3.743361] nf_tables: (c) 2007-2009 Patrick McHardy <kaber@trash.net>
[    3.763406] ip_tables: (C) 2000-2006 Netfilter Core Team
[    3.782819] NET: Registered protocol family 10
[    3.799621] mmc0: new high speed SDHC card at address 0007
[    3.819690] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    3.838033] mmcblk0: mmc0:0007 SD08G 7.42 GiB
[    3.853510] sit: IPv6 over IPv4 tunneling driver
[    3.872388]  mmcblk0: p1 p2
[    3.887424] NET: Registered protocol family 17
[    3.905072] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    3.938997] Bridge firewalling registered
[    3.954072] 8021q: 802.1Q VLAN Support v1.8
[    3.968872] Key type dns_resolver registered
[    3.983736] Registering SWP/SWPB emulation handler
[    4.001624] registered taskstats version 1
[    4.023072] 40034000.usb supply vbus not found, using dummy regulator
[    4.046464] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    4.061777] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    4.091514] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    4.110075] hub 1-0:1.0: USB hub found
[    4.124206] hub 1-0:1.0: 1 port detected
[    4.140691] VCC_USB[1-4]: supplied by 5V
[    4.159342] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    4.174330] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2
[    4.211522] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    4.229652] hub 2-0:1.0: USB hub found
[    4.243974] hub 2-0:1.0: 1 port detected
[    4.261121] input: colibri-vf50-ts as /devices/platform/vf50-touchscreen/input/input0
[    4.295975] input: gpio-keys as /devices/platform/gpio-keys/input/input1
[    4.315854] snvs_rtc 400a7000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:00 UTC (0)
[    4.383212] ALSA device list:
[    4.396581]   No soundcards found.
[    4.446080] random: nonblocking pool is initialized
[   32.071386] NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [mmcqd/0:56]
[   32.098635] Modules linked in:
[   32.111762] CPU: 0 PID: 56 Comm: mmcqd/0 Tainted: G        W       4.4.14-v2.6b2+gefe965a #1
[   32.140612] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[   32.157573] task: 86aaa400 ti: 86b46000 task.ti: 86b46000
[   32.173524] PC is at __do_softirq+0xa0/0x25c
[   32.188236] LR is at 0x288840
[   32.201391] pc : [<80024894>]    lr : [<00288840>]    psr: 60000113
[   32.201391] sp : 86b47c88  ip : 8087ea80  fp : 86b47ce4
[   32.234241] r10: 868bda84  r9 : 88003100  r8 : 86806000
[   32.250111] r7 : 00000001  r6 : 00000000  r5 : 00000000  r4 : 00000002
[   32.267356] r3 : 00000000  r2 : 8087ea40  r1 : 00000100  r0 : 00288040
[   32.284438] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   32.302327] Control: 10c5387d  Table: 80004059  DAC: 00000051
[   32.319069] CPU: 0 PID: 56 Comm: mmcqd/0 Tainted: G        W       4.4.14-v2.6b2+gefe965a #1
[   32.348973] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
[   32.366279] Backtrace:
[   32.379265] [<80013474>] (dump_backtrace) from [<8001366c>] (show_stack+0x18/0x1c)
[   32.408143]  r7:86b47c38 r6:86b46000 r5:8084a180 r4:808540c8
[   32.425314] [<80013654>] (show_stack) from [<802a016c>] (dump_stack+0x24/0x28)
[   32.455153] [<802a0148>] (dump_stack) from [<8001031c>] (show_regs+0x14/0x18)
[   32.473982] [<80010308>] (show_regs) from [<80077984>] (watchdog_timer_fn+0x170/0x1a4)
[   32.505259] [<80077814>] (watchdog_timer_fn) from [<800587dc>] (__hrtimer_run_queues.constprop.6+0x110/0x18c)
[   32.539110]  r10:8087e089 r9:00000001 r8:80852fcc r7:00000000 r6:80852fc0 r5:808540d8
[   32.571518]  r4:80852f80
[   32.586227] [<800586cc>] (__hrtimer_run_queues.constprop.6) from [<80058a1c>] (hrtimer_interrupt+0x90/0x1b0)
[   32.621106]  r10:80853018 r9:80852f80 r8:80853038 r7:ffffffff r6:7fffffff r5:00000003
[   32.655267]  r4:80852f80
[   32.670920] [<8005898c>] (hrtimer_interrupt) from [<8044b7c0>] (gt_clockevent_interrupt+0x4c/0x6c)
[   32.706351]  r10:868bda84 r9:88003100 r8:87cd8140 r7:00000010 r6:86817fc0 r5:87cd8140
[   32.741233]  r4:00000001
[   32.756854] [<8044b774>] (gt_clockevent_interrupt) from [<80050ec0>] (handle_percpu_devid_irq+0x68/0x80)
[   32.792900]  r5:8085c084 r4:86804c00
[   32.809553] [<80050e58>] (handle_percpu_devid_irq) from [<8004d344>] (generic_handle_irq+0x2c/0x3c)
[   32.844818]  r9:88003100 r8:86806000 r7:00000001 r6:86b47d50 r5:00000000 r4:8085bf40
[   32.879071] [<8004d318>] (generic_handle_irq) from [<8004d5b0>] (__handle_domain_irq+0x5c/0xb0)
[   32.914321] [<8004d554>] (__handle_domain_irq) from [<800093ec>] (gic_handle_irq+0x50/0x84)
[   32.949178]  r9:88003100 r8:86b47c38 r7:88002100 r6:8800210c r5:8084a3a4 r4:8085c080
[   32.983669] [<8000939c>] (gic_handle_irq) from [<800140d4>] (__irq_svc+0x54/0x70)
[   33.018398] Exception stack(0x86b47c38 to 0x86b47c80)
[   33.037086] 7c20:                                                       00288040 00000100
[   33.071508] 7c40: 8087ea40 00000000 00000002 00000000 00000000 00000001 86806000 88003100
[   33.106330] 7c60: 868bda84 86b47ce4 8087ea80 86b47c88 00288840 80024894 60000113 ffffffff
[   33.141151]  r9:88003100 r8:86806000 r7:86b47c6c r6:ffffffff r5:60000113 r4:80024894
[   33.176178] [<800247f4>] (__do_softirq) from [<80024d24>] (irq_exit+0xe0/0x114)
[   33.210913]  r10:868bda84 r9:88003100 r8:86806000 r7:00000001 r6:00000000 r5:00000000
[   33.247104]  r4:8085bf40
[   33.263273] [<80024c44>] (irq_exit) from [<8004d5b4>] (__handle_domain_irq+0x60/0xb0)
[   33.298314]  r5:00000000 r4:8085bf40
[   33.315300] [<8004d554>] (__handle_domain_irq) from [<800093ec>] (gic_handle_irq+0x50/0x84)
[   33.350166]  r9:88003100 r8:86b47d50 r7:88002100 r6:8800210c r5:8084a3a4 r4:8085c080
[   33.384624] [<8000939c>] (gic_handle_irq) from [<800140d4>] (__irq_svc+0x54/0x70)
[   33.418501] Exception stack(0x86b47d50 to 0x86b47d98)
[   33.436738] 7d40:                                     a0000013 00000003 86aaa400 00000000
[   33.471158] 7d60: 808a11dc a0000013 86aff840 80852f40 80045850 86b46000 868bda84 86b47dbc
[   33.506334] 7d80: 86b47dc0 86b47da0 80464b48 80463fe4 60000013 ffffffff
[   33.526633]  r9:86b46000 r8:80045850 r7:86b47d84 r6:ffffffff r5:60000013 r4:80463fe4
[   33.561451] [<80463f8c>] (clk_enable_unlock) from [<80464b48>] (clk_enable+0x30/0x40)
[   33.596068]  r7:80852f40 r6:86aff840 r5:a0000013 r4:00000000
[   33.615445] [<80464b18>] (clk_enable) from [<80447360>] (sdhci_esdhc_runtime_resume+0xa8/0xbc)
[   33.650598]  r5:86afe490 r4:86ad1ac0
[   33.667271] [<804472b8>] (sdhci_esdhc_runtime_resume) from [<8035ad84>] (pm_generic_runtime_resume+0x34/0x40)
[   33.704057]  r7:80852f40 r6:8035ad50 r5:00000000 r4:868bda10
[   33.723388] [<8035ad50>] (pm_generic_runtime_resume) from [<8035c41c>] (rpm_callback+0x5c/0xcc)
[   33.759260] [<8035c3c0>] (rpm_callback) from [<8035d200>] (rpm_resume+0x304/0x4ec)
[   33.793965]  r5:868b9e10 r4:868bda10
[   33.810947] [<8035cefc>] (rpm_resume) from [<8035d444>] (__pm_runtime_resume+0x5c/0x78)
[   33.845423]  r10:86b46000 r9:86ad1a18 r8:ffffe000 r7:00000001 r6:86ad1800 r5:60000013
[   33.880363]  r4:868bda10
[   33.896210] [<8035d3e8>] (__pm_runtime_resume) from [<8042dd6c>] (__mmc_claim_host+0x140/0x190)
[   33.931552]  r5:60000013 r4:00000000
[   33.948303] [<8042dc2c>] (__mmc_claim_host) from [<8042dde4>] (mmc_get_card+0x28/0x2c)
[   33.982344]  r10:86b39340 r9:24590000 r8:ffffe000 r7:86b3e400 r6:86a05d40 r5:86ad2000
[   34.016546]  r4:86ad2000
[   34.031834] [<8042ddbc>] (mmc_get_card) from [<8043e2b0>] (mmc_blk_issue_rq+0x264/0x4e8)
[   34.065471]  r5:86ad2000 r4:86b3e404
[   34.081904] [<8043e04c>] (mmc_blk_issue_rq) from [<8043fc3c>] (mmc_queue_thread+0xa0/0x164)
[   34.115774]  r10:00000000 r9:24590000 r8:ffffe000 r7:86b3e40c r6:86a05d40 r5:86b46000
[   34.149622]  r4:86b3e404
[   34.164630] [<8043fb9c>] (mmc_queue_thread) from [<8003ab48>] (kthread+0xdc/0xf4)
[   34.196945]  r9:00000000 r8:00000000 r7:8043fb9c r6:86b3e404 r5:86b38180 r4:00000000
[   34.230491] [<8003aa6c>] (kthread) from [<8000f7f8>] (ret_from_fork+0x14/0x3c)
[   34.263185]  r7:00000000 r6:00000000 r5:8003aa6c r4:86b38180

Have you ever tried booting without an SD card being plugged in?

@colibriuser

Hi

Are you sure that you were successful in compiling the device tree and deploying it to the module?

I would expect that

[    3.496975] sdhci-esdhc-imx 400b2000.esdhc: Got CD GPIO

to be missing if you removed the cd-gpios property.

What is the output of

ls /proc/device-tree/soc/aips-bus@40080000/esdhc@400b2000

Max

Yes I understand your confusion the log attached above shows this

[3.478495] /soc/aips-bus@40080000/esdhc@400b2000: voltage-ranges unspecified
[3.496975] sdhci-esdhc-imx 400b2000.esdhc: Got CD GPIO

But please note that we tried to do it both ways and it did not make any difference in how couple of boards (out of sample of four) cannot boot all the way to the command prompt. While the remaining two did not care about that property and booted either ways.

I will attach two samples one working and one not working with property broken CD in the device tree. Here is the output of the command you have requested

root@colibri-vf:~# ls /proc/device-tree/soc/aips-bus@40080000/esdhc@400b2000
broken-cd      clocks         interrupts     pinctrl-names
bus-width      compatible     name           reg
clock-names    disable-wp     pinctrl-0      status
root@colibri-vf:~# 

Attached here with two files for your reference.

Please see attached document with infolink text

So it does appear that broken_CD property makes it worse

I suspect there being a hardware issue on those failing two boards. For easier testing I suggest for you to have a look what e.g. U-Boot tells us about the SD card interface e.g. as follows:

Colibri VFxx # mmc dev 0
switch to partitions #0, OK
mmc0 is current device
Colibri VFxx # mmc info
Device: FSL_SDHC
Manufacturer ID: 41
OEM: 3432
Name: SD4GB 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
Colibri VFxx # mmc part
...
Colibri VFxx # ls mmc 0:1
...

Does that work for you also on the failing boards?

Yes SD card interactions in U Boot code works but does not work after it starts to get the kernel up with our custom board and custom device tree . I attach herewith the log file for your perusal.

Please note the same SD card and toradex colibri module when placed in other working boards or in Toradex evaluation boards shows no issues

link text

Yes the issue lies with particular custom carrier boards . Now we have a sample of three non working carrier boards and two working board out of a sample of five boards.

Is there a way to log the number of times and types of interrupts the CPU is getting interrupted by ?

By using the broken-cd property things do not seem to work well as show in my earlier post

I will revert back with answers to your other questions.

I’m working on this issue as well (same board, same company).

In all cases this problem has followed the board, not the module.

On a Toradex Iris,Eval v3 board, and on our “good” eval boards, we can successfully boot a kernel/devicetree stored in flash whether or not an SD card is present.

On our “bad” eval boards (ostensibly identical hardware) there are two cases we’ve seen:

  1. broken-cd present in device tree, cd-gpios deleted: kernel panic whether or not a card is installed
  2. broken-cd not present in device tree, cd-gpios not deleted: kernel panic during boot if card is installed, successful boot to UBIFS if no card is installed.

What seems peculiar, and is hopefully a useful clue, is that, as my colleague said, adding broken-cd seems strictly worse than the alternative.

Additionally, on a bad board without ‘broken-cd’ specified, although I can boot successfully, I can trigger a kernel panic by attempting to unbind the driver: echo 400b2000.esdhc > /sys/bus/platform/drivers/sdhci-esdhc-imx/unbind (Also a watchdog, with clk_enable_unlock in the backtrace)

This operation succeeds on Toradex’s boards.

As my colleague said, uboot is able to read a kernel and device tree from the card without issue on a “bad” board.

I will now try Stephen’s suggestion of building a kernel without the SD card driver.

I disabled the SD card driver. This boots fine on a Toradex carrier board. On one of our bad boards we get a watchdog panic, though the backtrace is obviously not in the (now disabled) MMC driver. I’m attaching the kernel log.

Based on the contents of the backtrace, I tried removing the gpio-keys node from our device tree, and can now boot. I will next re-enable the MMC driver.

The problem was with gpio-keys. I have now a kernel with an MMC driver, and with broken-cd configured for the card. I have gpio-keys enabled, but modified the pinmux setting from the eval-v3 dts; it used to have no hysteresis enabled. Putting hysteresis in removed the crash. We will look into why SODIMM_45 is behaving inconsistently across our boards, but it seems quite likely that our watchdog was an interrupt storm due to floating or noise-coupled SODIMM_45 trace. The different behavior with and without a card is possibly explicable by coupling from the SD lines. (The hysteresis was just a band-aid; I’ll be checking into the hardware more closely)

Thank you for your assistance. Stephen’s suggestion that an interrupt storm may be the culprit was particularly helpful.

You can use cat /proc/interrupts to get the list of requested interrupts and their interrupt counts.

Just so I understand this right, you are always using the same Colibri VF50, just on different carrier boards. So the issue definitely “goes with the carrier board”, is this correct?

You should be using broken-cd and not specifying cd-gpios if you don’t use card detect. That will cause the driver to fall back on a polling mechanism. That seems to work reliable here using the Evaluation Carrier Board and an altered device tree.

I am not entirely convinced that this is a SD card issue. It looks to me as if there is an interrupt constantly keeping the CPU busy, and the mmcqd process just happens to be the last process on the stack (since clk_enable_unlock re-enables interrupts).

What other changes did you made to the device tree? Can you try with disabled SD card driver (CONFIG_MMC_SDHCI/CONFIG_MMC_SDHCI_ESDHC_IMX).

Glad I could help, thanks for your feedback!

Note that our Evaulation Carrier Board has a 100k Pull-Down on SODIMM_45. Check that internal/external pull resistors pull in the same direction…

The eval-v3 device tree configures a 100k pull-down as well, so in effect our board when running the device tree applied a 100k pull-down. SODIMM-45 was connected to an Atmel SAM4S. The SAM4S, in its reset state, engages a 100k pull-up. Some boards had previously been used to test Atmel-side software, and these boards, the “good boards”, drove SODIMM-45 low, eliminating the problem. SODIMM-45 was routed right next to the SD card clock; the line must have been balancing on the edge of the logic threshold, and crosstalk from the adjacent line perhaps pushed it over the edge.