Hi,<br><br>I am trying to read some data via SPI on an a modified (custom SPI device attached) AT91SAM9G20-EK board. If I pass a local array buffer, declared as "char buffer[100];" as the rx_buf pointer for the spi transfer, the code works fine. But if I just change the declaration to "static char buffer[100]" instead, I get the following crash:<br>
<br>kernel BUG at arch/arm/mm/dma-mapping.c:425!<br>Unable to handle kernel NULL pointer dereference at virtual address 00000000<br>pgd = c0004000<br>[00000000] *pgd=00000000<br>Internal error: Oops: 817 [#1]<br>last sysfs file:<br>
Modules linked in: testmod [last unloaded: testmod]<br>CPU: 0 Not tainted (2.6.37.2 #8)<br>PC is at __bug+0x1c/0x28<br>LR is at __bug+0x18/0x28<br>pc : [<c0031d88>] lr : [<c0031d84>] psr: 20000093<br>
sp : c3a6fea8 ip : 00001e7b fp : 00000000<br>r10: ffffffff r9 : 00000000 r8 : c38ca6a0<br>r7 : c395e4e8 r6 : c3a6ff28 r5 : 00000032 r4 : c3a6ff54<br>r3 : 00000000 r2 : 00000001 r1 : 60000093 r0 : 00000033<br>Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel<br>
Control: 0005317f Table: 23a3c000 DAC: 00000017<br>Process tx_thread (pid: 460, stack limit = 0xc3a6e270)<br>Stack: (0xc3a6fea8 to 0xc3a70000)<br>fea0: c3a6ff24 c0034344 c0274848 c3a6ff54 bf00c7f8 c0189dd4<br>
fec0: c395e4e8 60000013 c3a6ff28 c395e400 c395e400 00000000 00000000 c0188bf0<br>fee0: c3a6ff2c 60000013 c3a6ff28 c395e400 c38ca6a0 c0188c54 c3a6ff04 c0188e38<br>ff00: 00000000 00000000 c3a6ff08 c3a6ff08 c3a6ff94 c3a6ff70 c3a6ff28 bf00c7f8<br>
ff20: 00000032 bf00a0d4 c3a6ff94 c3a6ff70 c38ca6a0 00000000 c0188fdc c3a6ff04<br>ff40: 00000000 ffffff8d 00000000 00000000 00000000 00000000 bf00c7f8 00000032<br>ff60: ffffffff ffffffff 00000000 00000000 c3a6ff28 c3a6ff94 c3a6ff9f c3a6ff9f<br>
ff80: 00000001 23a6ff9f 23a6ff9f 00000000 00000000 c3a6ff70 c3a6ff28 20a6ff50<br>ffa0: c3a6ffd4 c39bfdc4 c38ca6a0 bf00a0e0 00000000 bf00a168 720a0000 01a6cafe<br>ffc0: c3a6ffd4 c00556e0 c002f884 00000000 c38ca6a0 00000000 c3a6ffd8 c3a6ffd8<br>
ffe0: 00000000 c39bfdc4 c0055660 c002f884 00000013 c002f884 0001151c 000000d0<br>[<c0031d88>] (__bug+0x1c/0x28) from [<c0034344>] (___dma_single_cpu_to_dev+0x3c/0x68)<br>[<c0034344>] (___dma_single_cpu_to_dev+0x3c/0x68) from [<c0189dd4>] (atmel_spi_transfer+0xf8/0x1cc)<br>
[<c0189dd4>] (atmel_spi_transfer+0xf8/0x1cc) from [<c0188bf0>] (__spi_async+0xa0/0xb0)<br>[<c0188bf0>] (__spi_async+0xa0/0xb0) from [<c0188c54>] (spi_async_locked+0x14/0x2c)<br>[<c0188c54>] (spi_async_locked+0x14/0x2c) from [<c0188e38>] (__spi_sync+0x60/0xa0)<br>
[<c0188e38>] (__spi_sync+0x60/0xa0) from [<bf00a0d4>] (read_bytes+0xac/0xb8 [testmod])<br>[<bf00a0d4>] (read_bytes+0xac/0xb8 [testmod]) from [<bf00a168>] (tx_thread+0x88/0x110 [testmod])<br>[<bf00a168>] (tx_thread+0x88/0x110 [testmod]) from [<c00556e0>] (kthread+0x80/0x88)<br>
[<c00556e0>] (kthread+0x80/0x88) from [<c002f884>] (kernel_thread_exit+0x0/0x8)<br>Code: e1a01000 e59f000c eb090854 e3a03000 (e5833000)<br>---[ end trace 0dac538caa941b38 ]---<br><br>Does this behaviour make sense to anyone? Is this a bug or is it just me doing the wrong thing?<br>
<br>Regards,<br>Felix.<br>