Crash with SPI and general load

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Crash with SPI and general load

Martin Oldfield
I've been driving an SPI LCD display from my MinnowBoard Max and things seem to work well, except that the machine crashes when it gets busy.

I include the kernel Oops below.

More details:

1. I'm using a locally compiled 3.18rc3 kernel, against which I compiled the low-speed-spider
    module from https://github.com/MinnowBoard/minnow-max-extras/tree/master/modules/low-speed-spidev
    to give me entries in /dev

2. The machine was running the example program from
    https://github.com/MinnowBoard/max-ILI9341-C-Driver-port

3. The machine was also compiling a kernel, and crashed after about an hour of doing that. I've seen three such crashes now, and whilst I didn't keep the earlier crash logs, they all mentioned the spi_pxa2xx.

Some questions:

1. Is there anything I can do to help fix this ?

2. There are both spi-pxa2xx-pci and spi-pxa2xx-platform modules: how are these connected ?

3. Is there any reason that the low-speed-spidev code isn't integrated into the mainline ?

Thanks in advance,
--
M.

1.

[23926.099955] BUG: unable to handle kernel NULL pointer dereference at 000000000000001c
[23926.103072] IP: [<ffffffffa0212653>] pump_transfers+0x33/0x6c0 [spi_pxa2xx_platform]
[23926.106170] PGD 731e8067 PUD 7339b067 PMD 0
[23926.109304] Oops: 0000 [#1] SMP
[23926.112371] Modules linked in: low_speed_spidev(OE) spidev(E) netconsole(E) configfs(E) snd_hda_codec_hdmi(E) snd_hda_intel(E) snd_hda_controller(E) snd_hda_codec(E) snd_hwdep(E) snd_pcm(E) snd_seq_midi(E) snd_seq_midi_event(E) dm_multipath(E) scsi_dh(E) snd_rawmidi(E) intel_powerclamp(E) coretemp(E) kvm_intel(E) kvm(E) crct10dif_pclmul(E) crc32_pclmul(E) ghash_clmulni_intel(E) snd_seq(E) aesni_intel(E) aes_x86_64(E) snd_seq_device(E) lrw(E) gf128mul(E) glue_helper(E) ablk_helper(E) cryptd(E) snd_timer(E) joydev(E) snd(E) lpc_ich(E) spi_pxa2xx_pci(E) soundcore(E) i2c_designware_pci(E) dw_dmac_pci(E) dw_dmac(E) dw_dmac_core(E) i2c_hid(E) intel_smartconnect(E) i2c_designware_platform(E) i2c_designware_core(E) rfkill_gpio(E) mac_hid(E) spi_pxa2xx_platform(E) 8250_dw(E) parport_pc(E) ppdev(E) lp(E) parport(E) nls_iso8859_1(E) dm_mirror(E) dm_region_hash(E) dm_log(E) hid_generic(E) usbhid(E) r8169(E) mii(E) hid(E) i915(E) i2c_algo_bit(E) video(E) drm_kms_helper(E) sdhci_pci(E) sdhci_acpi(E) drm(E) sdhci(E) [last unloaded: low_speed_spidev]
[23926.139611] CPU: 1 PID: 15 Comm: ksoftirqd/1 Tainted: G           OE  3.18.0-rc3-mjo #1
[23926.143933] Hardware name: Intel Corp. VALLEYVIEW B3 PLATFORM/NOTEBOOK, BIOS MNW2CRB1.X64.0071.R30.1408131301 08/13/2014
[23926.148409] task: ffff88007a8bb200 ti: ffff88007a90c000 task.ti: ffff88007a90c000
[23926.152942] RIP: 0010:[<ffffffffa0212653>]  [<ffffffffa0212653>] pump_transfers+0x33/0x6c0 [spi_pxa2xx_platform]
[23926.157613] RSP: 0018:ffff88007a90fd58  EFLAGS: 00010247
[23926.162260] RAX: 0000000000000000 RBX: ffff880078502440 RCX: ffffffff81c4e000
[23926.166943] RDX: ffff8800785024a0 RSI: 0000000000000000 RDI: ffff880078502440
[23926.171662] RBP: ffff88007a90fda8 R08: ffff88007a90c000 R09: ffff88007285e400
[23926.176385] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[23926.181129] R13: ffff88003585fe48 R14: ffffc9000442a000 R15: ffff88003585fde8
[23926.185857] FS:  0000000000000000(0000) GS:ffff880079a80000(0000) knlGS:0000000000000000
[23926.190631] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[23926.195415] CR2: 000000000000001c CR3: 0000000073399000 CR4: 00000000001007e0
[23926.200259] Stack:
[23926.205072]  ffff88007a8bb714 ffffffff81c3db00 ffff88007a8bb200 ffff88007a8bb200
[23926.210016]  ffff88007a90fd98 ffff8800785024a8 0000000000000000 0000000000000006
[23926.214988]  0000000000000100 ffff88007a8bb200 ffff88007a90fdc8 ffffffff8106d035
[23926.219995] Call Trace:
[23926.224969]  [<ffffffff8106d035>] tasklet_action+0xf5/0x100
[23926.229999]  [<ffffffff8106d557>] __do_softirq+0xf7/0x2e0
[23926.235017]  [<ffffffff8106d771>] run_ksoftirqd+0x31/0x50
[23926.240037]  [<ffffffff8108bcb7>] smpboot_thread_fn+0xf7/0x1a0
[23926.245088]  [<ffffffff8108bbc0>] ? SyS_setgroups+0x1a0/0x1a0
[23926.250154]  [<ffffffff81087f34>] kthread+0xd4/0xf0
[23926.255222]  [<ffffffff81087e60>] ? kthread_create_on_node+0x190/0x190
[23926.260342]  [<ffffffff81779ebc>] ret_from_fork+0x7c/0xb0
[23926.265505]  [<ffffffff81087e60>] ? kthread_create_on_node+0x190/0x190
[23926.270695] Code: e5 41 57 41 56 41 55 41 54 53 48 8d 1f 48 8d 64 24 d8 4c 8b a7 e0 00 00 00 4c 8b bf d0 00 00 00 4c 8b 77 38 4c 8b af d8 00 00 00 <41> 8b 44 24 1c 89 45 c8 41 8b 44 24 14 89 45 cc 49 8b 47 50 48
[23926.281873] RIP  [<ffffffffa0212653>] pump_transfers+0x33/0x6c0 [spi_pxa2xx_platform]
[23926.287378]  RSP <ffff88007a90fd58>
[23926.292815] CR2: 000000000000001c
[23926.324089] ---[ end trace 14b4e65c34f29523 ]---
[23926.329463] Kernel panic - not syncing: Fatal exception in interrupt
[23926.334873] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff)
[23926.340437] drm_kms_helper: panic occurred, switching back to text console
[23926.346043] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
Reply | Threaded
Open this post in threaded view
|

Re: Crash with SPI and general load

Martin Oldfield
This post was updated on .
The bug appears to still exist in the 3.18rc4 kernel, which I compiled with a (lightly modified) version of the recommended .config. You'll see that the module list is much shorter, and there's no spi-pxa2xx-pci.

This time I just left the machine running the max-ILI9341-C-Driver-port example, so the machine wasn't
particularly busy. It crashed after about 10 hours.

I include the log below.

Cheers,
--
M.


[57893.126478] BUG: unable to handle kernel NULL pointer dereference at 000000000000001c
[57893.130348] IP: [<ffffffffa00094fd>] pump_transfers+0x2d/0x6d0 [spi_pxa2xx_platform]
[57893.134213] PGD 72b80067 PUD 5e82f067 PMD 0
[57893.138043] Oops: 0000 [#1] SMP
[57893.141862] Modules linked in: i6300esb ie6xx_wdt spidev low_speed_spidev(O) netconsole lpc_ich mfd_core dw_dmac dw_dmac_core i2c_designware_platform i2c_designware_core spi_pxa2xx_platform pwm_lpss_platform pwm_lpss
[57893.150162] CPU: 1 PID: 11 Comm: ksoftirqd/1 Tainted: G           O   3.18.0-rc4-mjo #4
[57893.154360] Hardware name: Intel Corp. VALLEYVIEW B3 PLATFORM/NOTEBOOK, BIOS MNW2CRB1.X64.0071.R30.1408131301 08/13/2014
[57893.158673] task: ffff880077f9f290 ti: ffff88007a820000 task.ti: ffff88007a820000
[57893.163050] RIP: 0010:[<ffffffffa00094fd>]  [<ffffffffa00094fd>] pump_transfers+0x2d/0x6d0 [spi_pxa2xx_platform]
[57893.167549] RSP: 0018:ffff88007a823d58  EFLAGS: 00010292
[57893.172035] RAX: ffff88003778fc90 RBX: ffff88003778fc30 RCX: 0000000004208040
[57893.176583] RDX: 0000000000000000 RSI: ffff880077f9f290 RDI: ffff88003778fc30
[57893.181151] RBP: ffff88007a823da8 R08: ffff88007a820000 R09: 0000000000000000
[57893.185725] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[57893.190300] R13: ffff88005e82be48 R14: ffffc9000483e000 R15: ffff88005e82bde8
[57893.194925] FS:  0000000000000000(0000) GS:ffff880079a80000(0000) knlGS:0000000000000000
[57893.199630] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[57893.204308] CR2: 000000000000001c CR3: 0000000072b71000 CR4: 00000000001007e0
[57893.209020] Stack:
[57893.213682]  ffff88007a823dd8 ffffffff81076204 ffff880079a92bf0 0000000000012b80
[57893.218572]  ffff880077f9f788 ffff88003778fc98 0000000000000000 0000000000000006
[57893.223393]  0000000000000100 ffff880077f9f290 ffff88007a823dc8 ffffffff81049679
[57893.228232] Call Trace:
[57893.232986]  [<ffffffff81076204>] ? pick_next_task_fair+0x744/0x830
[57893.237778]  [<ffffffff81049679>] tasklet_action+0xa9/0xe0
[57893.242532]  [<ffffffff81049a0e>] __do_softirq+0xee/0x280
[57893.247274]  [<ffffffff81049bc0>] run_ksoftirqd+0x20/0x40
[57893.251994]  [<ffffffff810646df>] smpboot_thread_fn+0xff/0x1b0
[57893.256735]  [<ffffffff810645e0>] ? SyS_setgroups+0x150/0x150
[57893.261437]  [<ffffffff81060f9d>] kthread+0xcd/0xf0
[57893.266089]  [<ffffffff81060ed0>] ? kthread_create_on_node+0x180/0x180
[57893.270741]  [<ffffffff8187a82c>] ret_from_fork+0x7c/0xb0
[57893.275360]  [<ffffffff81060ed0>] ? kthread_create_on_node+0x180/0x180
[57893.279992] Code: 89 e5 41 57 41 56 41 55 41 54 53 48 89 fb 48 83 ec 28 4c 8b a7 e0 00 00 00 4c 8b bf d0 00 00 00 4c 8b 77 38 4c 8b af d8 00 00 00 <41> 8b 44 24 1c 89 45 c8 41 8b 44 24 14 89 45 cc 49 8b 47 50 48
[57893.290048] RIP  [<ffffffffa00094fd>] pump_transfers+0x2d/0x6d0 [spi_pxa2xx_platform]
[57893.294989]  RSP <ffff88007a823d58>
[57893.299892] CR2: 000000000000001c
[57893.330023] ---[ end trace 049f42cf22b75750 ]---
[57893.334931] Kernel panic - not syncing: Fatal exception in interrupt
[57893.340112] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff)
[57893.345281] drm_kms_helper: panic occurred, switching back to text console
[57893.350397] ---[ end Kernel panic - not syncing: Fatal exception in interrupt

Reply | Threaded
Open this post in threaded view
|

Re: Crash with SPI and general load

Martin Oldfield
In case anyone else encounters this problem, Mika Westerberg diagnosed the problem and provided me with a patch. In the fullness of time, I expect it will appear in the normal kernel.

Here's the patch:

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index d8a105f76837..3720d84f266b 100644
— a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -402,8 +402,8 @@ static void giveback(struct driver_data *drv_data)
                        cs_deassert(drv_data);
        }
                                                                       
- spi_finalize_current_message(drv_data->master);
        drv_data->cur_chip = NULL;
+ spi_finalize_current_message(drv_data->master);
}
                                                                       
static void reset_sccr1(struct driver_data *drv_data)