From: felixv1986@gmail.com (Felix Varghese)
To: kernelnewbies@lists.kernelnewbies.org
Subject: kernel BUG while reading from SPI into static buffer
Date: Fri, 13 May 2011 12:33:15 +0530 [thread overview]
Message-ID: <BANLkTin25_+YjJLbFWHeDhjG48gKwR65dg@mail.gmail.com> (raw)
Hi,
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:
kernel BUG at arch/arm/mm/dma-mapping.c:425!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 817 [#1]
last sysfs file:
Modules linked in: testmod [last unloaded: testmod]
CPU: 0 Not tainted (2.6.37.2 #8)
PC is at __bug+0x1c/0x28
LR is at __bug+0x18/0x28
pc : [<c0031d88>] lr : [<c0031d84>] psr: 20000093
sp : c3a6fea8 ip : 00001e7b fp : 00000000
r10: ffffffff r9 : 00000000 r8 : c38ca6a0
r7 : c395e4e8 r6 : c3a6ff28 r5 : 00000032 r4 : c3a6ff54
r3 : 00000000 r2 : 00000001 r1 : 60000093 r0 : 00000033
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 0005317f Table: 23a3c000 DAC: 00000017
Process tx_thread (pid: 460, stack limit = 0xc3a6e270)
Stack: (0xc3a6fea8 to 0xc3a70000)
fea0: c3a6ff24 c0034344 c0274848 c3a6ff54 bf00c7f8
c0189dd4
fec0: c395e4e8 60000013 c3a6ff28 c395e400 c395e400 00000000 00000000
c0188bf0
fee0: c3a6ff2c 60000013 c3a6ff28 c395e400 c38ca6a0 c0188c54 c3a6ff04
c0188e38
ff00: 00000000 00000000 c3a6ff08 c3a6ff08 c3a6ff94 c3a6ff70 c3a6ff28
bf00c7f8
ff20: 00000032 bf00a0d4 c3a6ff94 c3a6ff70 c38ca6a0 00000000 c0188fdc
c3a6ff04
ff40: 00000000 ffffff8d 00000000 00000000 00000000 00000000 bf00c7f8
00000032
ff60: ffffffff ffffffff 00000000 00000000 c3a6ff28 c3a6ff94 c3a6ff9f
c3a6ff9f
ff80: 00000001 23a6ff9f 23a6ff9f 00000000 00000000 c3a6ff70 c3a6ff28
20a6ff50
ffa0: c3a6ffd4 c39bfdc4 c38ca6a0 bf00a0e0 00000000 bf00a168 720a0000
01a6cafe
ffc0: c3a6ffd4 c00556e0 c002f884 00000000 c38ca6a0 00000000 c3a6ffd8
c3a6ffd8
ffe0: 00000000 c39bfdc4 c0055660 c002f884 00000013 c002f884 0001151c
000000d0
[<c0031d88>] (__bug+0x1c/0x28) from [<c0034344>]
(___dma_single_cpu_to_dev+0x3c/0x68)
[<c0034344>] (___dma_single_cpu_to_dev+0x3c/0x68) from [<c0189dd4>]
(atmel_spi_transfer+0xf8/0x1cc)
[<c0189dd4>] (atmel_spi_transfer+0xf8/0x1cc) from [<c0188bf0>]
(__spi_async+0xa0/0xb0)
[<c0188bf0>] (__spi_async+0xa0/0xb0) from [<c0188c54>]
(spi_async_locked+0x14/0x2c)
[<c0188c54>] (spi_async_locked+0x14/0x2c) from [<c0188e38>]
(__spi_sync+0x60/0xa0)
[<c0188e38>] (__spi_sync+0x60/0xa0) from [<bf00a0d4>] (read_bytes+0xac/0xb8
[testmod])
[<bf00a0d4>] (read_bytes+0xac/0xb8 [testmod]) from [<bf00a168>]
(tx_thread+0x88/0x110 [testmod])
[<bf00a168>] (tx_thread+0x88/0x110 [testmod]) from [<c00556e0>]
(kthread+0x80/0x88)
[<c00556e0>] (kthread+0x80/0x88) from [<c002f884>]
(kernel_thread_exit+0x0/0x8)
Code: e1a01000 e59f000c eb090854 e3a03000 (e5833000)
---[ end trace 0dac538caa941b38 ]---
Does this behaviour make sense to anyone? Is this a bug or is it just me
doing the wrong thing?
Regards,
Felix.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110513/7015febe/attachment.html
next reply other threads:[~2011-05-13 7:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-13 7:03 Felix Varghese [this message]
2011-05-13 14:32 ` kernel BUG while reading from SPI into static buffer Mulyadi Santosa
2011-05-13 14:33 ` Mulyadi Santosa
2011-05-13 15:08 ` Greg KH
2011-05-16 5:55 ` Felix Varghese
2011-05-16 14:17 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTin25_+YjJLbFWHeDhjG48gKwR65dg@mail.gmail.com \
--to=felixv1986@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).