嵌入式 Buildroot 和 Yocto Linux 有 50% 的时间崩溃
Embedded Buildroot and Yocto Linux crash 50% of the time
在基于 STM32 的处理器 (OSD32MP15x) 启动期间,我有 50% 的时间遇到以下错误。
我已经尝试了 40 多个版本的配置和设置 none 工作,我承受着很大的压力来将这个硬件交付给客户。对我来说,这看起来像是某种时间问题,因为它并不总是发生。
我尝试禁用与 USB 相关的配置,更改 DTS 文件并删除不需要的所有内容,最后但并非最不重要的是更改 linux 配置和 DTS 中的电源配置。
问题:
我该如何调试以下内容?
您觉得这个错误是什么样的?
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.56 (yme@ubuntu18) (gcc version 9.3.0 (Buildroot 2020.02-00011-g7ea8a52)) #1 SMP PREEMPT Wed Nov 4 17:25:46 CET 2020
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: IM45
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created DMA memory pool at 0x10000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram2@10000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10040000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring0@10040000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10041000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring1@10041000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10042000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0buffer@10042000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x30000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram@30000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x38000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node retram@38000000, compatible id shared-dma-pool
[ 0.000000] cma: Reserved 128 MiB at 0xd2000000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.0
[ 0.000000] percpu: Embedded 20 pages/cpu s50124 r8192 d23604 u81920
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 113536
[ 0.000000] Kernel command line: root=/dev/mmcblk1p2 rootwait rw console=ttySTM0,115200
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 305152K/458752K available (11264K kernel code, 844K rwdata, 3364K rodata, 1024K init, 216K bss, 22528K reserved, 131072K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x31c/0x4f4 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000009] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000027] Switching to timer-based delay loop, resolution 41ns
[ 0.001228] Console: colour dummy device 80x30
[ 0.001276] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.001296] pid_max: default: 32768 minimum: 301
[ 0.001560] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.001581] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.002900] CPU: Testing write buffer coherency: ok
[ 0.003447] /cpus/cpu@0 missing clock-frequency property
[ 0.003484] /cpus/cpu@1 missing clock-frequency property
[ 0.003504] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.060001] Setting up static identity map for 0xc0100000 - 0xc0100060
[ 0.079971] rcu: Hierarchical SRCU implementation.
[ 0.104229] smp: Bringing up secondary CPUs ...
[ 0.180623] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.180859] smp: Brought up 1 node, 2 CPUs
[ 0.180884] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.180895] CPU: All CPU(s) started in SVC mode.
[ 0.181728] devtmpfs: initialized
[ 0.201048] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.201702] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.201736] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[ 0.208702] pinctrl core: initialized pinctrl subsystem
[ 0.211039] NET: Registered protocol family 16
[ 0.223325] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.225695] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.225715] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.226146] Serial: AMBA PL011 UART driver
[ 0.228991] stm32-pm-domain pm_domain: domain core-ret-power-domain registered
[ 0.229030] stm32-pm-domain pm_domain: subdomain core-power-domain registered
[ 0.229046] stm32-pm-domain pm_domain: domains probed
[ 0.264062] SCSI subsystem initialized
[ 0.264934] usbcore: registered new interface driver usbfs
[ 0.265017] usbcore: registered new interface driver hub
[ 0.265170] usbcore: registered new device driver usb
[ 0.265576] pps_core: LinuxPPS API ver. 1 registered
[ 0.265590] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.265624] PTP clock support registered
[ 0.265887] EDAC MC: Ver: 3.0.0
[ 0.267262] Advanced Linux Sound Architecture Driver Initialized.
[ 0.269092] clocksource: Switched to clocksource arch_sys_counter
[ 0.994946] thermal_sys: Registered thermal governor 'step_wise'
[ 0.995599] NET: Registered protocol family 2
[ 0.996743] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.996799] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.996866] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.996962] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.997119] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.997165] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.997480] NET: Registered protocol family 1
[ 0.998493] RPC: Registered named UNIX socket transport module.
[ 0.998514] RPC: Registered udp transport module.
[ 0.998525] RPC: Registered tcp transport module.
[ 0.998536] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.999750] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 1.001772] Initialise system trusted keyrings
[ 1.002136] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 1.015364] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 1.016787] NFS: Registering the id_resolver key type
[ 1.016838] Key type id_resolver registered
[ 1.016850] Key type id_legacy registered
[ 1.017081] ntfs: driver 2.1.32 [Flags: R/O].
[ 1.017623] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 1.018434] fuse: init (API version 7.31)
[ 1.019683] NET: Registered protocol family 38
[ 1.019706] Key type asymmetric registered
[ 1.019719] Asymmetric key parser 'x509' registered
[ 1.019785] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[ 1.019800] io scheduler mq-deadline registered
[ 1.019811] io scheduler kyber registered
[ 1.029372] STM32 USART driver initialized
[ 1.050170] brd: module loaded
[ 1.065205] loop: module loaded
[ 1.070532] libphy: Fixed MDIO Bus: probed
[ 1.072541] CAN device driver interface
[ 1.075529] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.075582] ehci-platform: EHCI generic platform driver
[ 1.076011] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.076048] ohci-platform: OHCI generic platform driver
[ 1.076725] usbcore: registered new interface driver cdc_acm
[ 1.076739] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1.080942] i2c /dev entries driver
[ 1.084746] stm32-cpufreq stm32-cpufreq: Failed to get chip info: -517
[ 1.087467] sdhci: Secure Digital Host Controller Interface driver
[ 1.087483] sdhci: Copyright(c) Pierre Ossman
[ 1.087493] Synopsys Designware Multimedia Card Interface Driver
[ 1.087913] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.088990] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.090464] usbcore: registered new interface driver usbhid
[ 1.090481] usbhid: USB HID core driver
[ 1.090775] arm-smc-mbox mailbox-0: ARM SMC mailbox enabled.
[ 1.090909] arm-smc-mbox mailbox-1: ARM SMC mailbox enabled.
[ 1.092452] remoteproc remoteproc0: releasing m4
[ 1.094961] Unable to get STM32 DDR PMU clock
[ 1.099244] drop_monitor: Initializing network drop monitor service
[ 1.099591] NET: Registered protocol family 17
[ 1.099625] can: controller area network core (rev 20170425 abi 9)
[ 1.099760] NET: Registered protocol family 29
[ 1.099779] can: raw protocol (rev 20170425)
[ 1.099791] can: broadcast manager protocol (rev 20170425 t)
[ 1.099809] can: netlink gateway (rev 20190810) max_hops=1
[ 1.100648] Key type dns_resolver registered
[ 1.100825] ThumbEE CPU extension supported.
[ 1.100855] Registering SWP/SWPB emulation handler
[ 1.101320] registered taskstats version 1
[ 1.101336] Loading compiled-in X.509 certificates
[ 1.112592] Loaded X.509 cert 'Build time autogenerated kernel key: a1bb00e898260e4deb50c76fbad98451248b76f2'
[ 1.132155] arm-scmi firmware:scmi-0: SCMI Protocol v2.0 'ST:' Firmware version 0x0
[ 1.135402] remoteproc remoteproc0: releasing m4
[ 1.136357] Unable to get STM32 DDR PMU clock
[ 1.159535] remoteproc remoteproc0: releasing m4
[ 1.160502] Unable to get STM32 DDR PMU clock
[ 1.199623] stm32-mdma 58000000.dma: STM32 MDMA driver registered
[ 1.202939] stm32-dma 48000000.dma: STM32 DMA driver registered
[ 1.229428] random: fast init done
[ 1.229493] stm32-crc32 58009000.crc: Initialized
[ 1.233994] random: crng init done
[ 1.241968] remoteproc remoteproc0: releasing m4
[ 1.243240] stm32-ddr-pmu: probed (ID=0x00140061 VER=0x00000010), DDR@533MHz
[ 1.243899] /soc/interrupt-controller@5000d000: bank0
[ 1.243916] /soc/interrupt-controller@5000d000: bank1
[ 1.243929] /soc/interrupt-controller@5000d000: bank2
[ 1.245454] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOA bank added
[ 1.245888] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOB bank added
[ 1.246272] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOC bank added
[ 1.246674] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOD bank added
[ 1.247034] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOE bank added
[ 1.247478] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOF bank added
[ 1.247852] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOG bank added
[ 1.248211] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOH bank added
[ 1.248577] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOI bank added
[ 1.248617] stm32mp157-pinctrl soc:pin-controller@50002000: Pinctrl STM32 initialized
[ 1.249706] stm32mp157-pinctrl soc:pin-controller-z@54004000: GPIOZ bank added
[ 1.249733] stm32mp157-pinctrl soc:pin-controller-z@54004000: Pinctrl STM32 initialized
[ 1.252232] 4000f000.serial: ttySTM1 at MMIO 0x4000f000 (irq = 36, base_baud = 6527435) is a stm32-usart
[ 1.253971] stm32-usart 40010000.serial: interrupt mode for rx (no dma)
[ 1.253994] stm32-usart 40010000.serial: interrupt mode for tx (no dma)
[ 1.254033] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 37, base_baud = 4000000) is a stm32-usart
[ 2.327555] printk: console [ttySTM0] enabled
[ 2.336702] stm32_rtc 5c004000.rtc: registered as rtc0
[ 2.341362] stm32_rtc 5c004000.rtc: Date/Time must be initialized
[ 2.346472] stm32_rtc 5c004000.rtc: registered rev:1.2
[ 2.373942] stm32f7-i2c 5c002000.i2c: doesn't use DMA
[ 2.379061] stpmic1 0-0033: PMIC Chip Version: 0x21
[ 2.383768] genirq: irq_chip stm32-exti-h did not update eff. affinity mask of irq 42
[ 2.391628] BUCK1: supplied by vin
[ 2.397045] BUCK2: supplied by vin
[ 2.402086] BUCK3: supplied by vin
[ 2.407216] BUCK4: supplied by vin
[ 2.412185] LDO1: supplied by v3v3
[ 2.417921] LDO2: supplied by vin
[ 2.423176] LDO3: supplied by vdd_ddr
[ 2.428498] LDO4: supplied by vin
[ 2.433721] LDO5: supplied by vin
[ 2.438846] LDO6: supplied by v3v3
[ 2.444180] VREF_DDR: supplied by vin
[ 2.449317] BOOST: supplied by vin
[ 2.454858] 8<--- cut here ---
[ 2.454968] VBUS_OTG: supplied by bst_out
[ 2.456448] Unable to handle kernel NULL pointer dereference at virtual address 00000050
[ 2.468540] pgd = 65ccf75c
[ 2.471247] [00000050] *pgd=00000000
[ 2.474801] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 2.480100] Modules linked in:
[ 2.483148] CPU: 0 PID: 73 Comm: irq/42-pmic_irq Not tainted 5.4.56 #1
[ 2.489664] Hardware name: STM32 (Device Tree Support)
[ 2.494809] PC is at mutex_trylock+0xc/0x84
[ 2.498977] LR is at regulator_lock+0x1c/0xbc
[ 2.503319] pc : [<c0b0dfec>] lr : [<c05d48ec>] psr: 60000013
[ 2.509580] sp : df7c7ecc ip : 010a1d00 fp : c0cbe554
[ 2.514798] r10: c0cbe984 r9 : df7c3800 r8 : 0000000e
[ 2.520016] r7 : df7eec68 r6 : 00000050 r5 : c11b5550 r4 : 00000000
[ 2.526539] r3 : df7c7ecc r2 : df7c600c r1 : 00000000 r0 : 00000050
[ 2.533064] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 2.540194] Control: 10c5387d Table: c000406a DAC: 00000051
[ 2.545935] Process irq/42-pmic_irq (pid: 73, stack limit = 0xa70e693e)
[ 2.552542] Stack: (0xdf7c7ecc to 0xdf7c8000)
[ 2.556897] 7ec0: c05d48ec df7ed0c0 c11b5550 df7eec00 c05e813c
[ 2.565073] 7ee0: df7f8bc0 00000000 df7eec00 c017fba0 00000020 00000024 df7ca800 00000001
[ 2.573247] 7f00: 0000000e c069b370 00000001 df1a6540 df7ca700 c1104c88 df7c6000 df7eb380
[ 2.581422] 7f20: df7ca700 df7c6000 00000001 df7eb380 c017c470 ffffe000 00000000 c017c48c
[ 2.589599] 7f40: df7ca700 df7eb3a4 df7c6000 c017c7a4 40000013 00000000 c017c59c c1104c88
[ 2.597774] 7f60: 00000000 df5a9d00 df7eb3c0 df1cbab4 df7c6000 df7eb380 c017c670 df5a9d1c
[ 2.605949] 7f80: 00000000 c0148a70 00000000 df7eb3c0 c0148954 00000000 00000000 00000000
[ 2.614124] 7fa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000
[ 2.622298] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 2.630473] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 2.638666] [<c0b0dfec>] (mutex_trylock) from [<c05d48ec>] (regulator_lock+0x1c/0xbc)
[ 2.646486] [<c05d48ec>] (regulator_lock) from [<c05e813c>] (stpmic1_boost_irq_handler+0x44/0x1cc)
[ 2.655438] [<c05e813c>] (stpmic1_boost_irq_handler) from [<c017fba0>] (handle_nested_irq+0xc4/0x130)
[ 2.664654] [<c017fba0>] (handle_nested_irq) from [<c069b370>] (regmap_irq_thread+0x328/0x508)
[ 2.673260] [<c069b370>] (regmap_irq_thread) from [<c017c48c>] (irq_thread_fn+0x1c/0x78)
[ 2.681344] [<c017c48c>] (irq_thread_fn) from [<c017c7a4>] (irq_thread+0x134/0x200)
[ 2.688999] [<c017c7a4>] (irq_thread) from [<c0148a70>] (kthread+0x11c/0x144)
[ 2.696132] [<c0148a70>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 2.703338] Exception stack(0xdf7c7fb0 to 0xdf7c7ff8)
[ 2.708385] 7fa0: 00000000 00000000 00000000 00000000
[ 2.716562] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 2.724735] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 2.731348] Code: e8bd81f0 e52de004 e1a0300d e3c32d7f (e5903000)
[ 2.737474] ---[ end trace 63a5f7bb4baf46f1 ]---
[ 2.742083] genirq: exiting task "irq/42-pmic_irq" (73) is an active IRQ thread (irq 42)
编辑 link linux 代码库:v5.4-stm32mp
编辑添加 DTS 配置:
pmic:stpmic@33{
compatible = "st,stpmic1";
reg = <0x33>;
interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <2>;
status = "okay";
regulators{
compatible = "st,stpmic1-regulators";
buck1-supply = <&vin>;
buck2-supply = <&vin>;
buck3-supply = <&vin>;
buck4-supply = <&vin>;
ldo1-supply = <&v3v3>;
ldo2-supply = <&vin>;
ldo3-supply = <&vdd_ddr>;
ldo4-supply = <&vin>;
ldo5-supply = <&vin>;
ldo6-supply = <&v3v3>;
vref_ddr-supply = <&vin>;
boost-supply = <&vin>;
pwr_sw1-supply = <&bst_out>;
pwr_sw2-supply = <&bst_out>;
vddcore:buck1{
regulator-name = "vddcore";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
vdd_ddr:buck2{
regulator-name = "vdd_ddr";
regulator-min-microvolt = <1350000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
vdd:buck3{
regulator-name = "vdd";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
st,mask-reset;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
v3v3:buck4{
regulator-name = "v3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
regulator-over-current-protection;
regulator-initial-mode = <0>;
};
v1v8_audio:ldo1{
regulator-name = "v1v8_audio";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
interrupts = <IT_CURLIM_LDO1 0>;
};
v3v3_hdmi:ldo2{
regulator-name = "v3v3_hdmi";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
interrupts = <IT_CURLIM_LDO2 0>;
};
vtt_ddr:ldo3{
regulator-name = "vtt_ddr";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <750000>;
regulator-always-on;
regulator-over-current-protection;
};
vdd_usb:ldo4{
regulator-name = "vdd_usb";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
interrupts = <IT_CURLIM_LDO4 0>;
regulator-always-on;
};
vdda:ldo5{
regulator-name = "vdda";
regulator-min-microvolt = <2900000>;
regulator-max-microvolt = <2900000>;
interrupts = <IT_CURLIM_LDO5 0>;
regulator-boot-on;
};
v1v2_hdmi:ldo6{
regulator-name = "v1v2_hdmi";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on;
interrupts = <IT_CURLIM_LDO6 0>;
};
vref_ddr:vref_ddr{
regulator-name = "vref_ddr";
regulator-always-on;
regulator-over-current-protection;
};
bst_out:boost{
regulator-name = "bst_out";
interrupts = <IT_OCP_BOOST 0>;
regulator-always-on;
};
vbus_otg:pwr_sw1{
regulator-name = "vbus_otg";
interrupts = <IT_OCP_OTG 0>;
};
vbus_sw:pwr_sw2{
regulator-name = "vbus_sw";
interrupts = <IT_OCP_SWOUT 0>;
regulator-active-discharge = <1>;
regulator-always-on;
};
};
onkey{
compatible = "st,stpmic1-onkey";
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
interrupt-names = "onkey-falling", "onkey-rising";
power-off-time-sec = <10>;
status = "okay";
};
watchdog {
compatible = "st,stpmic1-wdt";
status = "disabled";
};
};
看起来问题是由补丁引入的:regulator: stpmic1: Usb boost over-current protection workaround。
- “提升”中断处理程序
stpmic1_boost_irq_handler
调用 regulator_lock(usb_data->boost_rdev);
- “升压”中断处理程序(
stpmic1_boost_irq_handler
)由stpmic1_boost_register
函数设置,但此时usb_data->boost_rdev
仍为空
usb_data->boost_rdev
被stpmic1_regulator_probe
函数设置为stpmic1_boost_register
函数的return值。
- 如果在
stpmic1_regulator_probe
函数设置 usb_data->boost_rdev
之前调用“升压”中断处理程序 stpmic1_boost_irq_handler
,则会发生崩溃。
解决方法是在 stpmic1_boost_register
函数中设置 usb_data->boost_rdev = rdev;
在设置 rdev
之后但在设置中断处理程序之前。
这应该报告给补丁的作者。查看电子邮件地址补丁中的“Signed-off-by:”行。
在基于 STM32 的处理器 (OSD32MP15x) 启动期间,我有 50% 的时间遇到以下错误。
我已经尝试了 40 多个版本的配置和设置 none 工作,我承受着很大的压力来将这个硬件交付给客户。对我来说,这看起来像是某种时间问题,因为它并不总是发生。
我尝试禁用与 USB 相关的配置,更改 DTS 文件并删除不需要的所有内容,最后但并非最不重要的是更改 linux 配置和 DTS 中的电源配置。
问题: 我该如何调试以下内容? 您觉得这个错误是什么样的?
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.56 (yme@ubuntu18) (gcc version 9.3.0 (Buildroot 2020.02-00011-g7ea8a52)) #1 SMP PREEMPT Wed Nov 4 17:25:46 CET 2020
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: IM45
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created DMA memory pool at 0x10000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram2@10000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10040000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring0@10040000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10041000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring1@10041000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10042000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0buffer@10042000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x30000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram@30000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x38000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node retram@38000000, compatible id shared-dma-pool
[ 0.000000] cma: Reserved 128 MiB at 0xd2000000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.0
[ 0.000000] percpu: Embedded 20 pages/cpu s50124 r8192 d23604 u81920
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 113536
[ 0.000000] Kernel command line: root=/dev/mmcblk1p2 rootwait rw console=ttySTM0,115200
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 305152K/458752K available (11264K kernel code, 844K rwdata, 3364K rodata, 1024K init, 216K bss, 22528K reserved, 131072K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x31c/0x4f4 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000009] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000027] Switching to timer-based delay loop, resolution 41ns
[ 0.001228] Console: colour dummy device 80x30
[ 0.001276] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.001296] pid_max: default: 32768 minimum: 301
[ 0.001560] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.001581] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.002900] CPU: Testing write buffer coherency: ok
[ 0.003447] /cpus/cpu@0 missing clock-frequency property
[ 0.003484] /cpus/cpu@1 missing clock-frequency property
[ 0.003504] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.060001] Setting up static identity map for 0xc0100000 - 0xc0100060
[ 0.079971] rcu: Hierarchical SRCU implementation.
[ 0.104229] smp: Bringing up secondary CPUs ...
[ 0.180623] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.180859] smp: Brought up 1 node, 2 CPUs
[ 0.180884] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.180895] CPU: All CPU(s) started in SVC mode.
[ 0.181728] devtmpfs: initialized
[ 0.201048] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.201702] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.201736] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[ 0.208702] pinctrl core: initialized pinctrl subsystem
[ 0.211039] NET: Registered protocol family 16
[ 0.223325] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.225695] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.225715] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.226146] Serial: AMBA PL011 UART driver
[ 0.228991] stm32-pm-domain pm_domain: domain core-ret-power-domain registered
[ 0.229030] stm32-pm-domain pm_domain: subdomain core-power-domain registered
[ 0.229046] stm32-pm-domain pm_domain: domains probed
[ 0.264062] SCSI subsystem initialized
[ 0.264934] usbcore: registered new interface driver usbfs
[ 0.265017] usbcore: registered new interface driver hub
[ 0.265170] usbcore: registered new device driver usb
[ 0.265576] pps_core: LinuxPPS API ver. 1 registered
[ 0.265590] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.265624] PTP clock support registered
[ 0.265887] EDAC MC: Ver: 3.0.0
[ 0.267262] Advanced Linux Sound Architecture Driver Initialized.
[ 0.269092] clocksource: Switched to clocksource arch_sys_counter
[ 0.994946] thermal_sys: Registered thermal governor 'step_wise'
[ 0.995599] NET: Registered protocol family 2
[ 0.996743] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.996799] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.996866] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.996962] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.997119] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.997165] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.997480] NET: Registered protocol family 1
[ 0.998493] RPC: Registered named UNIX socket transport module.
[ 0.998514] RPC: Registered udp transport module.
[ 0.998525] RPC: Registered tcp transport module.
[ 0.998536] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.999750] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 1.001772] Initialise system trusted keyrings
[ 1.002136] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 1.015364] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 1.016787] NFS: Registering the id_resolver key type
[ 1.016838] Key type id_resolver registered
[ 1.016850] Key type id_legacy registered
[ 1.017081] ntfs: driver 2.1.32 [Flags: R/O].
[ 1.017623] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 1.018434] fuse: init (API version 7.31)
[ 1.019683] NET: Registered protocol family 38
[ 1.019706] Key type asymmetric registered
[ 1.019719] Asymmetric key parser 'x509' registered
[ 1.019785] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[ 1.019800] io scheduler mq-deadline registered
[ 1.019811] io scheduler kyber registered
[ 1.029372] STM32 USART driver initialized
[ 1.050170] brd: module loaded
[ 1.065205] loop: module loaded
[ 1.070532] libphy: Fixed MDIO Bus: probed
[ 1.072541] CAN device driver interface
[ 1.075529] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.075582] ehci-platform: EHCI generic platform driver
[ 1.076011] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.076048] ohci-platform: OHCI generic platform driver
[ 1.076725] usbcore: registered new interface driver cdc_acm
[ 1.076739] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1.080942] i2c /dev entries driver
[ 1.084746] stm32-cpufreq stm32-cpufreq: Failed to get chip info: -517
[ 1.087467] sdhci: Secure Digital Host Controller Interface driver
[ 1.087483] sdhci: Copyright(c) Pierre Ossman
[ 1.087493] Synopsys Designware Multimedia Card Interface Driver
[ 1.087913] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.088990] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.090464] usbcore: registered new interface driver usbhid
[ 1.090481] usbhid: USB HID core driver
[ 1.090775] arm-smc-mbox mailbox-0: ARM SMC mailbox enabled.
[ 1.090909] arm-smc-mbox mailbox-1: ARM SMC mailbox enabled.
[ 1.092452] remoteproc remoteproc0: releasing m4
[ 1.094961] Unable to get STM32 DDR PMU clock
[ 1.099244] drop_monitor: Initializing network drop monitor service
[ 1.099591] NET: Registered protocol family 17
[ 1.099625] can: controller area network core (rev 20170425 abi 9)
[ 1.099760] NET: Registered protocol family 29
[ 1.099779] can: raw protocol (rev 20170425)
[ 1.099791] can: broadcast manager protocol (rev 20170425 t)
[ 1.099809] can: netlink gateway (rev 20190810) max_hops=1
[ 1.100648] Key type dns_resolver registered
[ 1.100825] ThumbEE CPU extension supported.
[ 1.100855] Registering SWP/SWPB emulation handler
[ 1.101320] registered taskstats version 1
[ 1.101336] Loading compiled-in X.509 certificates
[ 1.112592] Loaded X.509 cert 'Build time autogenerated kernel key: a1bb00e898260e4deb50c76fbad98451248b76f2'
[ 1.132155] arm-scmi firmware:scmi-0: SCMI Protocol v2.0 'ST:' Firmware version 0x0
[ 1.135402] remoteproc remoteproc0: releasing m4
[ 1.136357] Unable to get STM32 DDR PMU clock
[ 1.159535] remoteproc remoteproc0: releasing m4
[ 1.160502] Unable to get STM32 DDR PMU clock
[ 1.199623] stm32-mdma 58000000.dma: STM32 MDMA driver registered
[ 1.202939] stm32-dma 48000000.dma: STM32 DMA driver registered
[ 1.229428] random: fast init done
[ 1.229493] stm32-crc32 58009000.crc: Initialized
[ 1.233994] random: crng init done
[ 1.241968] remoteproc remoteproc0: releasing m4
[ 1.243240] stm32-ddr-pmu: probed (ID=0x00140061 VER=0x00000010), DDR@533MHz
[ 1.243899] /soc/interrupt-controller@5000d000: bank0
[ 1.243916] /soc/interrupt-controller@5000d000: bank1
[ 1.243929] /soc/interrupt-controller@5000d000: bank2
[ 1.245454] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOA bank added
[ 1.245888] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOB bank added
[ 1.246272] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOC bank added
[ 1.246674] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOD bank added
[ 1.247034] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOE bank added
[ 1.247478] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOF bank added
[ 1.247852] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOG bank added
[ 1.248211] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOH bank added
[ 1.248577] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOI bank added
[ 1.248617] stm32mp157-pinctrl soc:pin-controller@50002000: Pinctrl STM32 initialized
[ 1.249706] stm32mp157-pinctrl soc:pin-controller-z@54004000: GPIOZ bank added
[ 1.249733] stm32mp157-pinctrl soc:pin-controller-z@54004000: Pinctrl STM32 initialized
[ 1.252232] 4000f000.serial: ttySTM1 at MMIO 0x4000f000 (irq = 36, base_baud = 6527435) is a stm32-usart
[ 1.253971] stm32-usart 40010000.serial: interrupt mode for rx (no dma)
[ 1.253994] stm32-usart 40010000.serial: interrupt mode for tx (no dma)
[ 1.254033] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 37, base_baud = 4000000) is a stm32-usart
[ 2.327555] printk: console [ttySTM0] enabled
[ 2.336702] stm32_rtc 5c004000.rtc: registered as rtc0
[ 2.341362] stm32_rtc 5c004000.rtc: Date/Time must be initialized
[ 2.346472] stm32_rtc 5c004000.rtc: registered rev:1.2
[ 2.373942] stm32f7-i2c 5c002000.i2c: doesn't use DMA
[ 2.379061] stpmic1 0-0033: PMIC Chip Version: 0x21
[ 2.383768] genirq: irq_chip stm32-exti-h did not update eff. affinity mask of irq 42
[ 2.391628] BUCK1: supplied by vin
[ 2.397045] BUCK2: supplied by vin
[ 2.402086] BUCK3: supplied by vin
[ 2.407216] BUCK4: supplied by vin
[ 2.412185] LDO1: supplied by v3v3
[ 2.417921] LDO2: supplied by vin
[ 2.423176] LDO3: supplied by vdd_ddr
[ 2.428498] LDO4: supplied by vin
[ 2.433721] LDO5: supplied by vin
[ 2.438846] LDO6: supplied by v3v3
[ 2.444180] VREF_DDR: supplied by vin
[ 2.449317] BOOST: supplied by vin
[ 2.454858] 8<--- cut here ---
[ 2.454968] VBUS_OTG: supplied by bst_out
[ 2.456448] Unable to handle kernel NULL pointer dereference at virtual address 00000050
[ 2.468540] pgd = 65ccf75c
[ 2.471247] [00000050] *pgd=00000000
[ 2.474801] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 2.480100] Modules linked in:
[ 2.483148] CPU: 0 PID: 73 Comm: irq/42-pmic_irq Not tainted 5.4.56 #1
[ 2.489664] Hardware name: STM32 (Device Tree Support)
[ 2.494809] PC is at mutex_trylock+0xc/0x84
[ 2.498977] LR is at regulator_lock+0x1c/0xbc
[ 2.503319] pc : [<c0b0dfec>] lr : [<c05d48ec>] psr: 60000013
[ 2.509580] sp : df7c7ecc ip : 010a1d00 fp : c0cbe554
[ 2.514798] r10: c0cbe984 r9 : df7c3800 r8 : 0000000e
[ 2.520016] r7 : df7eec68 r6 : 00000050 r5 : c11b5550 r4 : 00000000
[ 2.526539] r3 : df7c7ecc r2 : df7c600c r1 : 00000000 r0 : 00000050
[ 2.533064] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 2.540194] Control: 10c5387d Table: c000406a DAC: 00000051
[ 2.545935] Process irq/42-pmic_irq (pid: 73, stack limit = 0xa70e693e)
[ 2.552542] Stack: (0xdf7c7ecc to 0xdf7c8000)
[ 2.556897] 7ec0: c05d48ec df7ed0c0 c11b5550 df7eec00 c05e813c
[ 2.565073] 7ee0: df7f8bc0 00000000 df7eec00 c017fba0 00000020 00000024 df7ca800 00000001
[ 2.573247] 7f00: 0000000e c069b370 00000001 df1a6540 df7ca700 c1104c88 df7c6000 df7eb380
[ 2.581422] 7f20: df7ca700 df7c6000 00000001 df7eb380 c017c470 ffffe000 00000000 c017c48c
[ 2.589599] 7f40: df7ca700 df7eb3a4 df7c6000 c017c7a4 40000013 00000000 c017c59c c1104c88
[ 2.597774] 7f60: 00000000 df5a9d00 df7eb3c0 df1cbab4 df7c6000 df7eb380 c017c670 df5a9d1c
[ 2.605949] 7f80: 00000000 c0148a70 00000000 df7eb3c0 c0148954 00000000 00000000 00000000
[ 2.614124] 7fa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000
[ 2.622298] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 2.630473] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 2.638666] [<c0b0dfec>] (mutex_trylock) from [<c05d48ec>] (regulator_lock+0x1c/0xbc)
[ 2.646486] [<c05d48ec>] (regulator_lock) from [<c05e813c>] (stpmic1_boost_irq_handler+0x44/0x1cc)
[ 2.655438] [<c05e813c>] (stpmic1_boost_irq_handler) from [<c017fba0>] (handle_nested_irq+0xc4/0x130)
[ 2.664654] [<c017fba0>] (handle_nested_irq) from [<c069b370>] (regmap_irq_thread+0x328/0x508)
[ 2.673260] [<c069b370>] (regmap_irq_thread) from [<c017c48c>] (irq_thread_fn+0x1c/0x78)
[ 2.681344] [<c017c48c>] (irq_thread_fn) from [<c017c7a4>] (irq_thread+0x134/0x200)
[ 2.688999] [<c017c7a4>] (irq_thread) from [<c0148a70>] (kthread+0x11c/0x144)
[ 2.696132] [<c0148a70>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 2.703338] Exception stack(0xdf7c7fb0 to 0xdf7c7ff8)
[ 2.708385] 7fa0: 00000000 00000000 00000000 00000000
[ 2.716562] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 2.724735] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 2.731348] Code: e8bd81f0 e52de004 e1a0300d e3c32d7f (e5903000)
[ 2.737474] ---[ end trace 63a5f7bb4baf46f1 ]---
[ 2.742083] genirq: exiting task "irq/42-pmic_irq" (73) is an active IRQ thread (irq 42)
编辑 link linux 代码库:v5.4-stm32mp
编辑添加 DTS 配置:
pmic:stpmic@33{
compatible = "st,stpmic1";
reg = <0x33>;
interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <2>;
status = "okay";
regulators{
compatible = "st,stpmic1-regulators";
buck1-supply = <&vin>;
buck2-supply = <&vin>;
buck3-supply = <&vin>;
buck4-supply = <&vin>;
ldo1-supply = <&v3v3>;
ldo2-supply = <&vin>;
ldo3-supply = <&vdd_ddr>;
ldo4-supply = <&vin>;
ldo5-supply = <&vin>;
ldo6-supply = <&v3v3>;
vref_ddr-supply = <&vin>;
boost-supply = <&vin>;
pwr_sw1-supply = <&bst_out>;
pwr_sw2-supply = <&bst_out>;
vddcore:buck1{
regulator-name = "vddcore";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
vdd_ddr:buck2{
regulator-name = "vdd_ddr";
regulator-min-microvolt = <1350000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
vdd:buck3{
regulator-name = "vdd";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
st,mask-reset;
regulator-initial-mode = <0>;
regulator-over-current-protection;
};
v3v3:buck4{
regulator-name = "v3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
regulator-over-current-protection;
regulator-initial-mode = <0>;
};
v1v8_audio:ldo1{
regulator-name = "v1v8_audio";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
interrupts = <IT_CURLIM_LDO1 0>;
};
v3v3_hdmi:ldo2{
regulator-name = "v3v3_hdmi";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
interrupts = <IT_CURLIM_LDO2 0>;
};
vtt_ddr:ldo3{
regulator-name = "vtt_ddr";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <750000>;
regulator-always-on;
regulator-over-current-protection;
};
vdd_usb:ldo4{
regulator-name = "vdd_usb";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
interrupts = <IT_CURLIM_LDO4 0>;
regulator-always-on;
};
vdda:ldo5{
regulator-name = "vdda";
regulator-min-microvolt = <2900000>;
regulator-max-microvolt = <2900000>;
interrupts = <IT_CURLIM_LDO5 0>;
regulator-boot-on;
};
v1v2_hdmi:ldo6{
regulator-name = "v1v2_hdmi";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on;
interrupts = <IT_CURLIM_LDO6 0>;
};
vref_ddr:vref_ddr{
regulator-name = "vref_ddr";
regulator-always-on;
regulator-over-current-protection;
};
bst_out:boost{
regulator-name = "bst_out";
interrupts = <IT_OCP_BOOST 0>;
regulator-always-on;
};
vbus_otg:pwr_sw1{
regulator-name = "vbus_otg";
interrupts = <IT_OCP_OTG 0>;
};
vbus_sw:pwr_sw2{
regulator-name = "vbus_sw";
interrupts = <IT_OCP_SWOUT 0>;
regulator-active-discharge = <1>;
regulator-always-on;
};
};
onkey{
compatible = "st,stpmic1-onkey";
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
interrupt-names = "onkey-falling", "onkey-rising";
power-off-time-sec = <10>;
status = "okay";
};
watchdog {
compatible = "st,stpmic1-wdt";
status = "disabled";
};
};
看起来问题是由补丁引入的:regulator: stpmic1: Usb boost over-current protection workaround。
- “提升”中断处理程序
stpmic1_boost_irq_handler
调用regulator_lock(usb_data->boost_rdev);
- “升压”中断处理程序(
stpmic1_boost_irq_handler
)由stpmic1_boost_register
函数设置,但此时usb_data->boost_rdev
仍为空 usb_data->boost_rdev
被stpmic1_regulator_probe
函数设置为stpmic1_boost_register
函数的return值。- 如果在
stpmic1_regulator_probe
函数设置usb_data->boost_rdev
之前调用“升压”中断处理程序stpmic1_boost_irq_handler
,则会发生崩溃。
解决方法是在 stpmic1_boost_register
函数中设置 usb_data->boost_rdev = rdev;
在设置 rdev
之后但在设置中断处理程序之前。
这应该报告给补丁的作者。查看电子邮件地址补丁中的“Signed-off-by:”行。