David, I am really surprised the kmalloc memory can keep DMA-safe. Check the code, no matter spi_write_then_read and spi_init, they only get memory by a simple kmalloc(SPI_BUFSIZ, GFP_KERNEL); I can't find map_single or dma coherent operations at all. So did I lose something? Thanks Barry On 9/2/09, David Brownell <david-b@xxxxxxxxxxx> wrote: > On Tuesday 01 September 2009, Song, Barry wrote: >> >> + spi_message_add_tail(&t, &m); >> >> + ret = spi_sync(spi, &m); >> > >> >cant you use spi_write_then_read() ? dont let the u8* prototype scare >> >you, it should work with writing 16bits and then reading 16bits. >> >> I have never been scared by any u8* or something else. I only prefer >> to use raw spi API, which can show the bottom level timing and SPI >> bus feature better. > > In this case spi_write_then_read() is required, since > your tx and rx buffers are on the stack and hence not > DMA-safe. > -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html