Post Go back to editing

AD463x linux driver panics on boot if no device is found during probe

Category: Software
Product Number: AD4630-24
Software Version: Linux analog 5.10.0-14457-gb9a2f0ae835b-dirty #5 SMP PREEMPT Wed Sep 14 11:15:42 EEST 2022 armv7l GNU/Linux

Hallo there,

Using a recent kernel build with the latest AD463x driver on a ZedBoard, the kernel panics at boot if the ad463x probe function cannot find or detect an AD463x type device, which is unexpected and undesirable behavior.  Can a fix be made so the driver probe fails more gracefully, letting boot continue, thanks.

Regards,

Michael.

Booting Linux on physical CPU 0x0
Linux version 5.10.0-14457-gb9a2f0ae835b-dirty (sergiu@ADI) (arm-xilinx-linux-gnueabi-gcc.real (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.0.20200730) #5 SMP PREEMPT Wed Sep 14 11:15:42 EEST 2022
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: Xilinx Zynq ZED
OF: fdt: earlycon: stdout-path /amba@0/uart@E0001000 not found
Memory policy: Data cache writealloc
cma: Reserved 128 MiB at 0x16800000
Zone ranges:
  Normal   [mem 0x0000000000000000-0x000000001fffffff]
  HighMem  empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000001fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
percpu: Embedded 15 pages/cpu s29900 r8192 d23348 u61440
Built 1 zonelists, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlycon rootfstype=ext4 rootwait clk_ignore_unused cpuidle.off=1
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 366112K/524288K available (11264K kernel code, 802K rwdata, 7484K rodata, 1024K init, 348K bss, 27104K reserved, 131072K cma-reserved, 0K highmem)
rcu: Preemptible hierarchical RCU implementation.
rcu:    RCU event tracing is enabled.
rcu:    RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
        Trampoline variant of Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to (ptrval)
slcr mapped to (ptrval)
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
random: get_random_bytes called from start_kernel+0x33c/0x4e0 with crng_init=0
zynq_clock_init: clkc starts at (ptrval)
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at (ptrval), irq=25
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (1333.33 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes, linear)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
thermal_sys: Registered thermal governor 'step_wise'
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0x(ptrval)
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 33, base_baud = 3125000) is a xuartps
printk: console [ttyPS0] enabled
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
mc: Linux media interface: v0.10
videodev: Linux video capture interface: v2.00
jesd204: found 0 devices and 0 topologies
FPGA manager framework
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: no interrupt-affinity property for /pmu@f8891000, guessing.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
workingset: timestamp_bits=30 max_order=17 bucket_order=0
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
fuse: init (API version 7.32)
io scheduler mq-deadline registered
io scheduler kyber registered
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
brd: module loaded
loop: module loaded
Registered mathworks_ip class
spi-nor spi1.0: found s25fl256s1, expected n25q128a11
spi-nor spi1.0: s25fl256s1 (32768 Kbytes)
5 fixed-partitions partitions found on MTD device spi1.0
Creating 5 MTD partitions on "spi1.0":
0x000000000000-0x000000500000 : "boot"
0x000000500000-0x000000520000 : "bootenv"
0x000000520000-0x000000540000 : "config"
0x000000540000-0x000000fc0000 : "image"
0x000000fc0000-0x000002000000 : "spare"
MACsec IEEE 802.1AE
libphy: Fixed MDIO Bus: probed
tun: Universal TUN/TAP device driver, 1.6
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 35 (00:0a:35:00:01:22)
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver cdc_ncm
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver uas
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver upd78f0730
usbserial: USB Serial support registered for upd78f0730
ULPI transceiver vendor/product ID 0x0451/0x1507
Found TI TUSB1210 ULPI transceiver.
ULPI integrity check: passed.
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 5.10.0-14457-gb9a2f0ae835b-dirty ehci_hcd
usb usb1: SerialNumber: ci_hdrc.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ci_hdrc ci_hdrc.0: remove, state 1
i2c /dev entries driver
usb usb1: USB disconnect, device number 1
adv7511 0-0039: supply avdd not found, using dummy regulator
ci_hdrc ci_hdrc.0: USB bus 1 deregistered
adv7511 0-0039: supply dvdd not found, using dummy regulator
adv7511 0-0039: supply pvdd not found, using dummy regulator
adv7511 0-0039: supply bgvdd not found, using dummy regulator
adv7511 0-0039: supply dvdd-3v not found, using dummy regulator
at24 1-0050: supply vcc not found, using dummy regulator
at24 1-0050: 256 byte 24c02 EEPROM, writable, 1 bytes/write
usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
gspca_main: v2.14.0 registered
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer with timeout 10s
Xilinx Zynq CpuIdle Driver started
failed to register cpuidle driver
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
ledtrig-cpu: registered to indicate activity on CPUs
hid: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
mmc0: SDHCI controller on e0100000.mmc [e0100000.mmc] using ADMA
mmc0: new high speed SDHC card at address aaaa
mmcblk0: mmc0:aaaa SS16G 14.8 GiB
 mmcblk0: p1 p2 p3
ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in OTGSC
spi_master spi0: Timeout occured while waiting for transfer to complete. Hardware is probably broken.
spi_master spi0: Timeout occured while waiting for transfer to complete. Hardware is probably broken.
8<--- cut here ---
Unable to handle kernel paging request at virtual address 74696e11
pgd = (ptrval)
[74696e11] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.10.0-14457-gb9a2f0ae835b-dirty #5
Hardware name: Xilinx Zynq Platform
PC is at spi_engine_rx_next+0x14/0x68
LR is at spi_engine_transfer_one_message+0xf4/0x164
pc : [<c057aa08>]    lr : [<c057b258>]    psr: 20000093
sp : c184bc38  ip : c2059782  fp : c1bb4400
r10: c1bb46e0  r9 : c184bcfc  r8 : c1bb3e8c
r7 : c1bb3ec8  r6 : 60000013  r5 : 00000000  r4 : c1bb3e80
r3 : 74696e0d  r2 : 74696e69  r1 : c184bcfc  r0 : c1bb3e80
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 18c5387d  Table: 0000404a  DAC: 00000051
Process swapper/0 (pid: 1, stack limit = 0x(ptrval))
Stack: (0xc184bc38 to 0xc184c000)
bc20:                                                       00000006 c1503ec8
bc40: c1bb4000 c1bb4400 c184bca0 00000000 c184bd20 c184bcfc c1bb466c c05781f0
bc60: dfb92040 c184bd10 c184bd4c c1bb45f8 c184bcb4 00000000 c1bb4000 c184bcfc
bc80: c1bb4400 c0575150 c1bb4220 c1bb46e0 c1bb4400 c0578668 c184bc94 60000013
bca0: c1bb460c c1bb460c 00000003 00000000 00000000 c184bcb4 c184bcb4 c1503ec8
bcc0: 00000000 c1bb4000 c184bcfc c1bb4000 c2059400 c2059700 c1918810 00000000
bce0: c134d0cc c05786b0 c184bda8 c184bcfc c1bb4000 c079e9d4 00000000 c184bda8
bd00: c184bda8 c1bb4000 00000000 c05744c4 c184bcac 00000003 00000000 ffffff8d
bd20: c184bd20 c184bd20 00000000 c184bd2c c184bd2c c1503ec8 00000006 c2059700
bd40: c184bde8 c079ea80 c1bb40f8 c2059780 c2059784 00000003 00000000 00000000
bd60: 00000000 00000000 00000000 00000000 00000000 00000000 00000812 00000000
bd80: 00000000 00000000 02625a00 00000000 00000000 00000000 00000000 00000000
bda0: 00000000 00000000 c184bcfc c184bcfc 00000000 c1503ec8 00000000 c184bde8
bdc0: c1bb4000 c079fb5c c2092cb8 c2059700 c1bb4000 00000000 c15e55cc c02b2de4
bde0: 00000001 00000000 c1bbdc08 c02b2948 00000000 c2092cb8 c2092d68 c1bbdc08
be00: 00000000 c02b4a48 00000000 00000004 c2092d68 c1503ec8 c12e6f90 00000000
be20: c1bb4000 c1552ec4 00000000 c15e55cc c1552ed4 00000000 c134d0cc c0574364
be40: c1bb4000 00000000 c15e55d4 c0511a94 00000000 c1bb4000 c1552ed4 c1bb4044
be60: c1552ed4 c143a854 c143a834 c15c9000 c134d0cc c0512154 c1bb4000 00000000
be80: c1bb4044 c0512438 00000000 c1552ed4 c1bb4000 c1537d80 c143a854 c05124c0
bea0: c1552ed4 c1552ed4 c0512440 c050faa8 c184bed0 c188da58 c1bb7434 c1503ec8
bec0: c1552ed4 c2091c00 00000000 c0510e0c c129e544 ffffe000 c1552ed4 c1552ed4
bee0: 00000000 ffffe000 00000000 c0512d20 c15c9000 c1426368 ffffe000 c0101834
bf00: c18cc5cf 00000000 c18cc5ce c013cc00 00000000 c12714c4 00000124 00000000
bf20: 00000000 c14003e0 00000006 00000006 00000000 c18cc5e1 c18cc5ed c1503ec8
bf40: 00000000 00000124 00000007 c1503ec8 c15c9000 c1446798 00000007 c18cc580
bf60: 00000124 c1400ff4 00000006 00000006 00000000 c14003e0 00000000 c14003e0
bf80: 00000000 00000000 c0b2b614 00000000 00000000 00000000 00000000 00000000
bfa0: 00000000 c0b2b61c 00000000 c0100148 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[<c057aa08>] (spi_engine_rx_next) from [<c057b258>] (spi_engine_transfer_one_message+0xf4/0x164)
[<c057b258>] (spi_engine_transfer_one_message) from [<c05781f0>] (__spi_pump_messages+0x394/0x5cc)
[<c05781f0>] (__spi_pump_messages) from [<c0578668>] (__spi_sync+0x234/0x258)
[<c0578668>] (__spi_sync) from [<c05786b0>] (spi_sync+0x24/0x3c)
[<c05786b0>] (spi_sync) from [<c079e9d4>] (spi_sync_transfer.constprop.0+0x68/0x8c)
[<c079e9d4>] (spi_sync_transfer.constprop.0) from [<c079ea80>] (ad4630_spi_read_reg+0x88/0xb8)
[<c079ea80>] (ad4630_spi_read_reg) from [<c079fb5c>] (ad4630_probe+0x578/0x7f0)
[<c079fb5c>] (ad4630_probe) from [<c0574364>] (spi_drv_probe+0x7c/0xa0)
[<c0574364>] (spi_drv_probe) from [<c0511a94>] (really_probe+0xf0/0x4b0)
[<c0511a94>] (really_probe) from [<c0512154>] (driver_probe_device+0x5c/0xb4)
[<c0512154>] (driver_probe_device) from [<c0512438>] (device_driver_attach+0xa8/0xb0)
[<c0512438>] (device_driver_attach) from [<c05124c0>] (__driver_attach+0x80/0x110)
[<c05124c0>] (__driver_attach) from [<c050faa8>] (bus_for_each_dev+0x78/0xc0)
[<c050faa8>] (bus_for_each_dev) from [<c0510e0c>] (bus_add_driver+0xf4/0x1dc)
[<c0510e0c>] (bus_add_driver) from [<c0512d20>] (driver_register+0x88/0x118)
[<c0512d20>] (driver_register) from [<c0101834>] (do_one_initcall+0x58/0x1d0)
[<c0101834>] (do_one_initcall) from [<c1400ff4>] (kernel_init_freeable+0x174/0x1d8)
[<c1400ff4>] (kernel_init_freeable) from [<c0b2b61c>] (kernel_init+0x8/0x118)
[<c0b2b61c>] (kernel_init) from [<c0100148>] (ret_from_fork+0x14/0x2c)
Exception stack(0xc184bfb0 to 0xc184bff8)
bfa0:                                     00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
Code: e5901014 ea000004 e3530000 0a00000a (e5932004)
---[ end trace 560cf0299b53454c ]---
note: swapper/0[1] exited with preempt_count 1
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D           5.10.0-14457-gb9a2f0ae835b-dirty #5
Hardware name: Xilinx Zynq Platform
[<c010da8c>] (unwind_backtrace) from [<c010a164>] (show_stack+0x10/0x14)
[<c010a164>] (show_stack) from [<c0b1daa4>] (dump_stack+0xc0/0xd4)
[<c0b1daa4>] (dump_stack) from [<c010bf58>] (do_handle_IPI+0x120/0x148)
[<c010bf58>] (do_handle_IPI) from [<c010bf98>] (ipi_handler+0x18/0x20)
[<c010bf98>] (ipi_handler) from [<c016f080>] (handle_percpu_devid_irq+0x78/0x150)
[<c016f080>] (handle_percpu_devid_irq) from [<c0169240>] (__handle_domain_irq+0x7c/0xd0)
[<c0169240>] (__handle_domain_irq) from [<c043b3d4>] (gic_handle_irq+0x80/0x94)
[<c043b3d4>] (gic_handle_irq) from [<c0100b0c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xc1501f20 to 0xc1501f68)
1f20: 00000000 00002a38 dfb92184 c0117280 c1500000 00000000 c1503f14 c1503f50
1f40: 00000000 c144cc10 00000000 c1501f78 c18e8040 c1501f70 c01075c4 c01075c8
1f60: 60000013 ffffffff
[<c0100b0c>] (__irq_svc) from [<c01075c8>] (arch_cpu_idle+0x38/0x3c)
[<c01075c8>] (arch_cpu_idle) from [<c014ab8c>] (do_idle+0x204/0x294)
[<c014ab8c>] (do_idle) from [<c014af1c>] (cpu_startup_entry+0x18/0x1c)
[<c014af1c>] (cpu_startup_entry) from [<c1400df8>] (start_kernel+0x4ac/0x4e0)
[<c1400df8>] (start_kernel) from [<00000000>] (0x0)
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]--

Top Replies

    •  Analog Employees 
    Nov 9, 2022 in reply to mbradley +1 verified

    Hi  ,

    It appears that the particular commit that your kernel has been built on is no longer in the ADI Linux git tree.

    I recommend you either build the kernel from scratch using the latest branch…