Hi! continuing the journey of migrating the Yocto system and Linux kernel accordingly.
I am getting hangs when accessing SPI controllers 3 and 4. This stacktrace from RCU stall
seems to be in mx51_ecspi_rx_available.
This function is just reading a status register from the controller:
static int mx51_ecspi_rx_available(struct spi_imx_data *spi_imx) { return readl(spi_imx->base + MX51_ECSPI_STAT) & MX51_ECSPI_STAT_RR; }
I dont know where to start looking so any help would be highly appreciated.
Stacktrace:
[527.611875] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 527.617990] (detected by 0, t=8407 jiffies, g=5353, q=11513)
[ 527.623745] rcu: All QSes seen, last rcu_preempt kthread activity 8407 (22761-14354), jiffies_till_next_fqs=1, root ->qsmask 0x0
[ 527.635318] rcu: rcu_preempt kthread starved for 8407 jiffies! g5353 f0x2 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=0
[ 527.645500] rcu: Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
[ 527.654636] rcu: RCU grace-period kthread stack dump:
[ 527.659688] task:rcu_preempt state:R running task stack: 0 pid: 12 ppid: 2 flags:0x00000000
[ 527.669626] [<809ba668>] (__schedule) from [<809baf24>] (preempt_schedule_irq+0x4c/0x6c)
[ 527.677744] [<809baf24>] (preempt_schedule_irq) from [<80100bd0>] (svc_preempt+0x8/0x18)
[ 527.685853] Exception stack(0x8150fe80 to 0x8150fec8)
[ 527.690915] fe80: 00000001 00000002 00000000 00008600 814fc000 8150e000 8150fefc 80fdb7b8
[ 527.699100] fea0: 8108cea0 8150e000 00000001 8150fef4 83640040 8150fed4 809baabc 80152630
[ 527.707281] fec0: 20000113 ffffffff
[ 527.710774] [<80100bd0>] (svc_preempt) from [<80152630>] (preempt_count_add+0x8/0x144)
[ 527.718712] [<80152630>] (preempt_count_add) from [<809bf8b0>] (schedule_timeout+0x94/0x17c)
[ 527.727169] [<809bf8b0>] (schedule_timeout) from [<80182a38>] (rcu_gp_fqs_loop+0x12c/0x468)
[ 527.735539] [<80182a38>] (rcu_gp_fqs_loop) from [<80187808>] (rcu_gp_kthread+0x11c/0x1d4)
[ 527.743732] [<80187808>] (rcu_gp_kthread) from [<8014af58>] (kthread+0x154/0x188)
[ 527.751231] [<8014af58>] (kthread) from [<80100150>] (ret_from_fork+0x14/0x24)
[ 527.758465] Exception stack(0x8150ffb0 to 0x8150fff8)
[ 527.763524] ffa0: 00000000 00000000 00000000 00000000
[ 527.771709] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 527.779891] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 527.786507] rcu: Stack dump where RCU GP kthread last ran:
[ 527.791991] Task dump for CPU 0:
[ 527.795222] task:irq/188-spi4.0 state:R running task stack: 0 pid: 217 ppid: 2 flags:0x00000000
[ 527.805152] [<8010f91c>] (unwind_backtrace) from [<8010c19c>] (show_stack+0x10/0x14)
[ 527.812914] [<8010c19c>] (show_stack) from [<809af9f4>] (rcu_check_gp_kthread_starvation+0xe4/0xfc)
[ 527.821985] [<809af9f4>] (rcu_check_gp_kthread_starvation) from [<80188620>] (rcu_sched_clock_irq+0xbbc/0xe7c)
[ 527.832007] [<80188620>] (rcu_sched_clock_irq) from [<80191a3c>] (update_process_times+0x90/0xc4)
[ 527.840901] [<80191a3c>] (update_process_times) from [<801a3ac0>] (tick_sched_timer+0x78/0x128)
[ 527.849621] [<801a3ac0>] (tick_sched_timer) from [<80192038>] (__hrtimer_run_queues.constprop.0+0x1a0/0x324)
[ 527.859465] [<80192038>] (__hrtimer_run_queues.constprop.0) from [<80193268>] (hrtimer_interrupt+0xf4/0x2c8)
[ 527.869309] [<80193268>] (hrtimer_interrupt) from [<807a30f0>] (mxc_timer_interrupt+0x34/0x3c)
[ 527.877946] [<807a30f0>] (mxc_timer_interrupt) from [<8016da70>] (__handle_irq_event_percpu+0x5c/0x1ec)
[ 527.887363] [<8016da70>] (__handle_irq_event_percpu) from [<8016dcec>] (handle_irq_event+0x6c/0xec)
[ 527.896426] [<8016dcec>] (handle_irq_event) from [<80172030>] (handle_fasteoi_irq+0xa4/0x22c)
[ 527.904972] [<80172030>] (handle_fasteoi_irq) from [<8016d37c>] (handle_domain_irq+0x70/0xa0)
[ 527.913512] [<8016d37c>] (handle_domain_irq) from [<805b9a78>] (gic_handle_irq+0x70/0x84)
[ 527.921712] [<805b9a78>] (gic_handle_irq) from [<80100b8c>] (__irq_svc+0x6c/0xa8)
[ 527.929209] Exception stack(0x83641be0 to 0x83641c28)
[ 527.934270] 1be0: 00000083 83641d5c 00000730 c0180000 82250380 83598400 83641d5c 83598400
[ 527.942456] 1c00: 82250380 822502a8 83598620 00000001 00000040 83641c30 7f035f08 7f034140
[ 527.950635] 1c20: 20060113 ffffffff
[ 527.954127] [<80100b8c>] (__irq_svc) from [<7f034140>] (mx51_ecspi_rx_available+0xc/0x14 [spi_imx])
[ 527.963215] [<7f034140>] (mx51_ecspi_rx_available [spi_imx]) from [<7f035f08>] (spi_imx_transfer+0x38/0x62c [spi_imx])
[ 527.973949] [<7f035f08>] (spi_imx_transfer [spi_imx]) from [<7f00a4e0>] (spi_bitbang_transfer_one+0x50/0xa0 [spi_bitbang])
[ 527.985031] [<7f00a4e0>] (spi_bitbang_transfer_one [spi_bitbang]) from [<806db590>] (spi_transfer_one_message+0x2b4/0x6e8)
[ 527.996102] [<806db590>] (spi_transfer_one_message) from [<806dd58c>] (__spi_pump_messages+0x44c/0x8b8)
[ 528.005511] [<806dd58c>] (__spi_pump_messages) from [<806ddc74>] (__spi_sync+0x270/0x318)
[ 528.013703] [<806ddc74>] (__spi_sync) from [<806dde50>] (spi_write_then_read+0xf4/0x1c8)
[ 528.021804] [<806dde50>] (spi_write_then_read) from [<80696d18>] (_regmap_raw_read+0x10c/0x2a8)
[ 528.030519] [<80696d18>] (_regmap_raw_read) from [<80696ef4>] (_regmap_bus_read+0x40/0x6c)
[ 528.038795] [<80696ef4>] (_regmap_bus_read) from [<806958e4>] (_regmap_read+0x60/0x14c)
[ 528.046819] [<806958e4>] (_regmap_read) from [<80695a0c>] (regmap_read+0x3c/0x60)
[ 528.054320] [<80695a0c>] (regmap_read) from [<8065d374>] (sc16is7xx_irq+0x1d0/0x314)
[ 528.062088] [<8065d374>] (sc16is7xx_irq) from [<8016e9a8>] (irq_thread_fn+0x1c/0x78)
[ 528.069850] [<8016e9a8>] (irq_thread_fn) from [<8016ebb4>] (irq_thread+0x118/0x254)
[ 528.077522] [<8016ebb4>] (irq_thread) from [<8014af58>] (kthread+0x154/0x188)
[ 528.084672] [<8014af58>] (kthread) from [<80100150>] (ret_from_fork+0x14/0x24)
[ 528.091905] Exception stack(0x83641fb0 to 0x83641ff8)
[ 528.096962] 1fa0: 00000000 00000000 00000000 00000000
[ 528.105146] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 528.113327] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
DTS portion of the spi :
&ecspi4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi4>;
fsl,spi-num-chipselects = <2>;
cs-gpios = <&gpio7 4 GPIO_ACTIVE_LOW>, <&gpio6 5 GPIO_ACTIVE_LOW>;
status = "okay";
ethernet-switch@0x0 {
/* compatible = "b53-switch"; */
compatible = "smartoptics,bcm53125";
spi-max-frequency = <2000000>;
reg = <0>; /* CS0 GPIO7,4 */
spi-cpol;
spi-cpha;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ethernet_switch>;
/*
b53_reset-gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;
b53_reset-output-low;
*/
bcm53125_reset-gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;
bcm53125_reset-output-low;
};
/* UART, 2 SPI uarts "ttySCxx" on the CPU Board connected to the Preamp and PreAmp2 */
sc16is752@1 {
compatible = "nxp,sc16is752";
reg = <1>; /* CS1 GPIO6:5*/
clocks = <&sc16is752_clk>;
reset-gpios = <&gpio10 29 GPIO_ACTIVE_LOW>;
interrupt-parent = <&gpio6>;
interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
gpio-controller;
#gpio-cells = <2>;
spi-cs-high;
spi-max-frequency = <4000000>;
status = "okay";
/* External baudrate oscillator or X-tal, 14.745600 MHz */
sc16is752_clk: sc16is752_clk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <14745600>;
};
};
};