Hi Update on my SPI and DMA related problems with Beaglebone + ENC28J60: As I wrote in my previous mail, I could see that the data received by the SPI driver was not same as what I could see using an oscilloscope. The data I could see using the oscilloscope was 0x06 but the driver returned 0x3C. Then I switched from spi0 to spi1, and to my surprise that port works! However, as soon as there was substantial data available the driver and kernel crashed with a DMA related error (included below). I disabled DMA by setting DMA_MIN_LEN to a very big number, and finally I have a reliable network connection with ENC28J60! But I would prefer to use spi0, and I’m of course not happy with disabling DMA. I’m using kernel 4.7.1 at commit 95f15f5ed6e68b479c73da842012108c567c6999. There are no custom patches, except for a custom device tree. Any hints how to debug this further? Here’s the crash when using spi0 and dma enabled: [ 16.497543] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 18.014351] Unable to handle kernel paging request at virtual address 40000140 [ 18.021955] pgd = c0004000 [ 18.024781] [40000140] *pgd=00000000 [ 18.028526] Internal error: Oops: 805 [#1] ARM [ 18.033164] Modules linked in: enc28j60 [ 18.037182] CPU: 0 PID: 80 Comm: kworker/0:2 Not tainted 4.7.1-myeden-griffin-amun-bbg-dirty #17 [ 18.046352] Hardware name: Generic AM33XX (Flattened Device Tree) [ 18.052739] Workqueue: events enc28j60_irq_work_handler [enc28j60] [ 18.059194] task: ddc352c0 ti: ddc36000 task.ti: ddc36000 [ 18.064842] PC is at v7_dma_inv_range+0x2c/0x48 [ 18.069579] LR is at __dma_page_dev_to_cpu+0x90/0x154 [ 18.074852] pc : [<c0117b80>] lr : [<c011331c>] psr: 20070013 [ 18.074852] sp : ddc37b88 ip : de36d000 fp : dd8f0c48 [ 18.086835] r10: c0114304 r9 : 0000017b r8 : 00000fff [ 18.092286] r7 : 00000002 r6 : 00000000 r5 : 0000017b r4 : dd16d000 [ 18.099098] r3 : 0000003f r2 : 00000040 r1 : 40000140 r0 : 40000000 [ 18.105913] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 18.113360] Control: 10c5387d Table: 9dfe8019 DAC: 00000051 [ 18.119355] Process kworker/0:2 (pid: 80, stack limit = 0xddc36210) [ 18.125896] Stack: (0xddc37b88 to 0xddc38000) [ 18.130446] 7b80: c0117c14 ddc37df4 ddbc1000 ddc37df4 dd8f0c48 00000000 [ 18.138986] 7ba0: 00000000 c04c254c 00000000 00000000 ddc35798 ddc35790 9054e2a6 dd8f0c48 [ 18.147526] 7bc0: dd8f0800 ddbc1220 00000000 ddbc8d00 00000001 ddce9688 00000008 ddbc6810 [ 18.156065] 7be0: 00000000 0000017a 201113fc 0000017b c85480e1 00000002 00000000 0000017a [ 18.164605] 7c00: 00000000 00000000 481a013c 481a0138 00000001 00000001 00000001 00000001 [ 18.173145] 7c20: 00000000 00000000 00000001 00000080 00000000 c04bc7c0 ddbc1258 ddc357f8 [ 18.181684] 7c40: 00000003 00000004 00000006 00000000 481a013c 481a0138 00000001 00000001 [ 18.190224] 7c60: 00000001 00000001 00000000 00000000 dd8f0b90 ddc37df4 ddc37d80 dd8f0800 [ 18.198764] 7c80: ddbc1258 dd8f0b90 00000000 dd8f0b30 c0d251b8 c04becf4 ddbc1000 00000000 [ 18.207303] 7ca0: 00000001 00000000 dd8f0800 ddc37d80 00000000 00000000 00000000 ddbc1258 [ 18.215843] 7cc0: dd8f0b90 c04bf328 00000001 ddc37d80 dd8f0800 ddc37d00 00000000 ddbc1000 [ 18.224383] 7ce0: ddc37d80 dd8f0800 00000000 ddbc1258 dd8f0b90 c04bf6b8 60070013 dd8f0a3c [ 18.232923] 7d00: 00000000 00000001 dead4ead ffffffff ffffffff c152d520 00000000 00000000 [ 18.241463] 7d20: c0a98274 ddc37d24 ddc37d24 00000000 00000001 dead4ead ffffffff ffffffff [ 18.250003] 7d40: c152d520 00000000 00000000 c0a98274 ddc37d24 ddc37d24 c0eb7748 ddce95a0 [ 18.258543] 7d60: ddce9688 0000017b dc8ce5c2 00000466 000005ee ddce9000 ddce95a0 bf0006a4 [ 18.267083] 7d80: ddc37dec ddc37e28 ddbc1000 00000000 c04bd9a4 ddc37d00 0000017c 00000001 [ 18.275623] 7da0: ffffff8d ddc37da4 ddc37da4 00000000 ddc37db0 ddc37db0 ddce9684 00000000 [ 18.284162] 7dc0: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 18.292702] 7de0: 00000000 00000802 000f4240 ddc37e28 ddc37d80 00000000 ddce9688 0000017b [ 18.301241] 7e00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 18.309781] 7e20: 00000810 000f4240 ddc37d80 ddc37dec ddc37dc4 ddce95a0 ddce95a8 0000017b [ 18.318321] 7e40: dc8ce5c2 bf00070c 0000017b 000005e2 dde1b000 000019ff 00000001 bf000fa4 [ 18.326860] 7e60: 60070013 00000001 00000001 00000000 00000466 ddce95a0 00000001 ddce9610 [ 18.335401] 7e80: 7b05e201 0001c001 00000000 ddce9610 ddc14f80 c0d0fa2c de344400 ddc37ec8 [ 18.343940] 7ea0: 00000000 00000000 00000001 c01430bc 00000001 00000000 c014304c c0143490 [ 18.352480] 7ec0: 00000000 00000000 bf00265c c0ec08d8 00000000 bf002308 c0d0fa60 c0d0fa2c [ 18.361020] 7ee0: ddc14f98 00000008 c0d0fa60 c0d146c0 ddc36000 c0d0fa2c ddc14f80 c014341c [ 18.369560] 7f00: ddc36000 ddc11040 ddc14f80 00000000 ddc11040 ddc14f80 c01433e4 00000000 [ 18.378099] 7f20: 00000000 00000000 00000000 c0148d48 60000093 00000000 c014d114 ddc14f80 [ 18.386639] 7f40: 00000000 00000001 dead4ead ffffffff ffffffff c0d62280 00000000 00000000 [ 18.395179] 7f60: c0a98274 ddc37f64 ddc37f64 00000000 00000001 dead4ead ffffffff ffffffff [ 18.403720] 7f80: c0d62280 00000000 00000000 c0a98274 ddc37f90 ddc37f90 ddc37fac ddc11040 [ 18.412259] 7fa0: c0148c7c 00000000 00000000 c0108370 00000000 00000000 00000000 00000000 [ 18.420799] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 18.429338] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffff [ 18.437889] [<c0117b80>] (v7_dma_inv_range) from [<c011331c>] (__dma_page_dev_to_cpu+0x90/0x154) [ 18.447070] [<c011331c>] (__dma_page_dev_to_cpu) from [<c04c254c>] (omap2_mcspi_transfer_one+0xbd4/0x1340) [ 18.457169] [<c04c254c>] (omap2_mcspi_transfer_one) from [<c04becf4>] (spi_transfer_one_message+0xb0/0x350) [ 18.467345] [<c04becf4>] (spi_transfer_one_message) from [<c04bf328>] (__spi_pump_messages+0x394/0x520) [ 18.477156] [<c04bf328>] (__spi_pump_messages) from [<c04bf6b8>] (__spi_sync+0x1f0/0x204) [ 18.485702] [<c04bf6b8>] (__spi_sync) from [<bf0006a4>] (spi_read_buf+0xa0/0xc4 [enc28j60]) [ 18.494434] [<bf0006a4>] (spi_read_buf [enc28j60]) from [<bf00070c>] (enc28j60_mem_read+0x44/0x50 [enc28j60]) [ 18.504796] [<bf00070c>] (enc28j60_mem_read [enc28j60]) from [<bf000fa4>] (enc28j60_irq_work_handler+0x234/0x788 [enc28j60]) [ 18.516518] [<bf000fa4>] (enc28j60_irq_work_handler [enc28j60]) from [<c01430bc>] (process_one_work+0x18c/0x4b4) [ 18.527145] [<c01430bc>] (process_one_work) from [<c014341c>] (worker_thread+0x38/0x550) [ 18.535600] [<c014341c>] (worker_thread) from [<c0148d48>] (kthread+0xcc/0xe8) [ 18.543150] [<c0148d48>] (kthread) from [<c0108370>] (ret_from_fork+0x14/0x24) [ 18.550694] Code: e1c00003 1e070f3e e1110003 e1c11003 (1e071f3e) [ 18.557245] ---[ end trace 8e96c54388e95e93 ]--- [ 18.569289] Unable to handle kernel paging request at virtual address ffffffd0 [ 18.576853] pgd = c0004000 [ 18.579676] [ffffffd0] *pgd=9e7f2861, *pte=00000000, *ppte=00000000 [ 18.586241] Internal error: Oops: 37 [#2] ARM [ 18.590788] Modules linked in: enc28j60 [ 18.594806] CPU: 0 PID: 80 Comm: kworker/0:2 Tainted: G D 4.7.1-myeden-griffin-amun-bbg-dirty #17 [ 18.605246] Hardware name: Generic AM33XX (Flattened Device Tree) [ 18.611616] task: ddc352c0 ti: ddc36000 task.ti: ddc36000 [ 18.617267] PC is at kthread_data+0x4/0xc [ 18.621452] LR is at wq_worker_sleeping+0x8/0xb4 [ 18.626270] pc : [<c014930c>] lr : [<c0144258>] psr: 200f0093 [ 18.626270] sp : ddc37950 ip : ddc35500 fp : ddc379a4 [ 18.638252] r10: ddc3562c r9 : 00000000 r8 : ddc35588 [ 18.643703] r7 : 00000000 r6 : c0d106d8 r5 : 00000000 r4 : ddc352c0 [ 18.650515] r3 : 00000000 r2 : 00000000 r1 : ffffffff r0 : ddc352c0 [ 18.657329] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 18.664867] Control: 10c5387d Table: 9da5c019 DAC: 00000051 [ 18.670862] Process kworker/0:2 (pid: 80, stack limit = 0xddc36210) [ 18.677403] Stack: (0xddc37950 to 0xddc38000) [ 18.681951] 7940: ddc352c0 c08103f0 00000001 00000080 [ 18.690491] 7960: 600f0093 c037f448 ddaf9554 600f0013 c037f448 c08106bc ddaf9554 dd819500 [ 18.699031] 7980: ddaf9548 ddc36000 ddc376d4 dd84acc0 ddc379b8 ddc35588 00000000 c0117b84 [ 18.707571] 79a0: ddc379b4 c08106bc ddc352c0 ddc376d4 c0117b82 c012dcdc ddc379b8 ddc379b8 [ 18.716111] 79c0: 00000001 60070113 c0117b82 c010c658 ddc36210 0000000b 00000008 ddc37b38 [ 18.724651] 79e0: ddc36000 00000000 65000000 30306331 20333030 37306531 65336630 31316520 [ 18.733191] 7a00: 30303031 31652033 30313163 28203330 37306531 65336631 c0002029 ddc37a3c [ 18.741731] 7a20: dd8f0c48 40000140 ddc37b38 00000805 00000000 00000000 0000017b c0114304 [ 18.750271] 7a40: dd8f0c48 c01199cc 40000140 c0815c3c c0d4e3c1 c0d00000 ffffffff 00000000 [ 18.758811] 7a60: c0d4e3c1 c0d252b4 ddc37afc c0149f30 00000000 c0d07d5c 00000805 c0815db0 [ 18.767351] 7a80: 40000140 ddc37b38 0000017b c0114304 dd8f0c48 c0101304 ddc352c0 c0d252b4 [ 18.775891] 7aa0: c14fd17c c015d2fc ddc35798 ddc35790 9054e339 12e1990a c0d106d8 c0d106d8 [ 18.784432] 7ac0: c0d053c8 c0814b08 dddc8240 c014d114 00000001 00000000 c014d0d4 ddc36000 [ 18.792971] 7ae0: ddc36000 ddbc6848 ddbc6844 ddc36000 00000002 00000000 ddc37b0c 00000000 [ 18.801511] 7b00: 60070093 00000001 00000001 00000002 00000000 00000000 dd8f0c48 ddc357f8 [ 18.810051] 7b20: c0117b80 20070013 ffffffff ddc37b6c 00000fff c081512c 40000000 40000140 [ 18.818591] 7b40: 00000040 0000003f dd16d000 0000017b 00000000 00000002 00000fff 0000017b [ 18.827131] 7b60: c0114304 dd8f0c48 de36d000 ddc37b88 c011331c c0117b80 20070013 ffffffff [ 18.835671] 7b80: 00000051 c011331c c0117c14 ddc37df4 ddbc1000 ddc37df4 dd8f0c48 00000000 [ 18.844211] 7ba0: 00000000 c04c254c 00000000 00000000 ddc35798 ddc35790 9054e2a6 dd8f0c48 [ 18.852751] 7bc0: dd8f0800 ddbc1220 00000000 ddbc8d00 00000001 ddce9688 00000008 ddbc6810 [ 18.861291] 7be0: 00000000 0000017a 201113fc 0000017b c85480e1 00000002 00000000 0000017a [ 18.869831] 7c00: 00000000 00000000 481a013c 481a0138 00000001 00000001 00000001 00000001 [ 18.878370] 7c20: 00000000 00000000 00000001 00000080 00000000 c04bc7c0 ddbc1258 ddc357f8 [ 18.886910] 7c40: 00000003 00000004 00000006 00000000 481a013c 481a0138 00000001 00000001 [ 18.895449] 7c60: 00000001 00000001 00000000 00000000 dd8f0b90 ddc37df4 ddc37d80 dd8f0800 [ 18.903990] 7c80: ddbc1258 dd8f0b90 00000000 dd8f0b30 c0d251b8 c04becf4 ddbc1000 00000000 [ 18.912529] 7ca0: 00000001 00000000 dd8f0800 ddc37d80 00000000 00000000 00000000 ddbc1258 [ 18.921069] 7cc0: dd8f0b90 c04bf328 00000001 ddc37d80 dd8f0800 ddc37d00 00000000 ddbc1000 [ 18.929609] 7ce0: ddc37d80 dd8f0800 00000000 ddbc1258 dd8f0b90 c04bf6b8 60070013 dd8f0a3c [ 18.938150] 7d00: 00000000 00000001 dead4ead ffffffff ffffffff c152d520 00000000 00000000 [ 18.946689] 7d20: c0a98274 ddc37d24 ddc37d24 00000000 00000001 dead4ead ffffffff ffffffff [ 18.955230] 7d40: c152d520 00000000 00000000 c0a98274 ddc37d24 ddc37d24 c0eb7748 ddce95a0 [ 18.963769] 7d60: ddce9688 0000017b dc8ce5c2 00000466 000005ee ddce9000 ddce95a0 bf0006a4 [ 18.972309] 7d80: ddc37dec ddc37e28 ddbc1000 00000000 c04bd9a4 ddc37d00 0000017c 00000001 [ 18.980849] 7da0: ffffff8d ddc37da4 ddc37da4 00000000 ddc37db0 ddc37db0 ddce9684 00000000 [ 18.989389] 7dc0: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 18.997928] 7de0: 00000000 00000802 000f4240 ddc37e28 ddc37d80 00000000 ddce9688 0000017b [ 19.006468] 7e00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 19.015008] 7e20: 00000810 000f4240 ddc37d80 ddc37dec ddc37dc4 ddce95a0 ddce95a8 0000017b [ 19.023548] 7e40: dc8ce5c2 bf00070c 0000017b 000005e2 dde1b000 000019ff 00000001 bf000fa4 [ 19.032088] 7e60: 60070013 00000001 00000001 00000000 00000466 ddce95a0 00000001 ddce9610 [ 19.040628] 7e80: 7b05e201 0001c001 00000000 ddce9610 ddc14f80 c0d0fa2c de344400 ddc37ec8 [ 19.049168] 7ea0: 00000000 00000000 00000001 c01430bc 00000001 00000000 c014304c c0143490 [ 19.057708] 7ec0: 00000000 00000000 bf00265c c0ec08d8 00000000 bf002308 c0d0fa60 c0d0fa2c [ 19.066247] 7ee0: ddc14f98 00000008 c0d0fa60 c0d146c0 ddc36000 c0d0fa2c ddc14f80 c014341c [ 19.074787] 7f00: ddc36000 ddc11040 ddc14f80 00000000 ddc11040 ddc14f80 c01433e4 00000000 [ 19.083327] 7f20: 00000000 00000000 00000000 c0148d48 60000093 00000000 c014d114 ddc14f80 [ 19.091867] 7f40: 00000000 00000001 dead4ead ffffffff ffffffff c0d62280 00000000 00000000 [ 19.100407] 7f60: c0a98274 ddc37f64 ddc37f64 00000001 00000001 dead4ead ffffffff ffffffff [ 19.108947] 7f80: c0d62280 00000000 00000000 c0a98274 ddc37f90 ddc37f90 ddc37fac ddc11040 [ 19.117486] 7fa0: c0148c7c 00000000 00000000 c0108370 00000000 00000000 00000000 00000000 [ 19.126026] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 19.134565] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffff [ 19.143117] [<c014930c>] (kthread_data) from [<c0144258>] (wq_worker_sleeping+0x8/0xb4) [ 19.151489] [<c0144258>] (wq_worker_sleeping) from [<c08103f0>] (__schedule+0x58c/0x814) [ 19.159942] [<c08103f0>] (__schedule) from [<c08106bc>] (schedule+0x44/0x9c) [ 19.167312] [<c08106bc>] (schedule) from [<c012dcdc>] (do_exit+0x644/0x9e0) [ 19.174594] [<c012dcdc>] (do_exit) from [<c010c658>] (die+0x3a0/0x414) [ 19.181421] [<c010c658>] (die) from [<c01199cc>] (__do_kernel_fault.part.0+0x54/0x1e4) [ 19.189697] [<c01199cc>] (__do_kernel_fault.part.0) from [<c0815c3c>] (do_page_fault+0x220/0x394) [ 19.198964] [<c0815c3c>] (do_page_fault) from [<c0101304>] (do_DataAbort+0x34/0xb4) [ 19.206961] [<c0101304>] (do_DataAbort) from [<c081512c>] (__dabt_svc+0x4c/0x80) [ 19.214680] Exception stack(0xddc37b38 to 0xddc37b80) [ 19.219952] 7b20: 40000000 40000140 [ 19.228492] 7b40: 00000040 0000003f dd16d000 0000017b 00000000 00000002 00000fff 0000017b [ 19.237033] 7b60: c0114304 dd8f0c48 de36d000 ddc37b88 c011331c c0117b80 20070013 ffffffff [ 19.245575] [<c081512c>] (__dabt_svc) from [<c0117b80>] (v7_dma_inv_range+0x2c/0x48) [ 19.253671] [<c0117b80>] (v7_dma_inv_range) from [<c011331c>] (__dma_page_dev_to_cpu+0x90/0x154) [ 19.262850] [<c011331c>] (__dma_page_dev_to_cpu) from [<c04c254c>] (omap2_mcspi_transfer_one+0xbd4/0x1340) [ 19.272947] [<c04c254c>] (omap2_mcspi_transfer_one) from [<c04becf4>] (spi_transfer_one_message+0xb0/0x350) [ 19.283122] [<c04becf4>] (spi_transfer_one_message) from [<c04bf328>] (__spi_pump_messages+0x394/0x520) [ 19.292933] [<c04bf328>] (__spi_pump_messages) from [<c04bf6b8>] (__spi_sync+0x1f0/0x204) [ 19.301492] [<c04bf6b8>] (__spi_sync) from [<bf0006a4>] (spi_read_buf+0xa0/0xc4 [enc28j60]) [ 19.310225] [<bf0006a4>] (spi_read_buf [enc28j60]) from [<bf00070c>] (enc28j60_mem_read+0x44/0x50 [enc28j60]) [ 19.320587] [<bf00070c>] (enc28j60_mem_read [enc28j60]) from [<bf000fa4>] (enc28j60_irq_work_handler+0x234/0x788 [enc28j60]) [ 19.332306] [<bf000fa4>] (enc28j60_irq_work_handler [enc28j60]) from [<c01430bc>] (process_one_work+0x18c/0x4b4) [ 19.342932] [<c01430bc>] (process_one_work) from [<c014341c>] (worker_thread+0x38/0x550) [ 19.351382] [<c014341c>] (worker_thread) from [<c0148d48>] (kthread+0xcc/0xe8) [ 19.358925] [<c0148d48>] (kthread) from [<c0108370>] (ret_from_fork+0x14/0x24) [ 19.366469] Code: c0148994 c0d62280 c0a98274 e5903320 (e5130030) [ 19.372835] ---[ end trace 8e96c54388e95e94 ]— … and it continues. I’ll be glad to supply you with any further required information. Regards, Jonatan Magnusson -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html