kernel BUG while reading from SPI into static buffer

Greg KH greg at kroah.com
Mon May 16 10:17:20 EDT 2011


On Mon, May 16, 2011 at 11:25:32AM +0530, Felix Varghese wrote:
> On 13 May 2011 20:38, Greg KH <greg at kroah.com> wrote:
> > Don't statically allocate memory for spi, you need to dynamically
> > allocate it with 'kmalloc'.
> >
> > The fact that the first time didn't crash for you was just lucky.
> 
> I'm guessing you say this because static variables are not in DMA
> capable memory. But how exactly do we figure out which part of memory
> is DMA-capable and which isn't?

If you create the memory with a call to kmalloc() it is dma-capable.  So
always do that.

> Also, is this a restriction imposed by the kernel or by the hardware?

The hardware.

USB also has this rule.

thanks,

greg k-h



More information about the Kernelnewbies mailing list