Re: [RFC] SPI core -- revisited

From: Vitaly Wool
Date: Mon Jun 27 2005 - 04:14:21 EST


Arjan van de Ven wrote:

Nothing's gonna work in DMA case if he kills the wrappers.



how is that??


These functions are not exactly *wrappers*, there's some little additional logic inside.
spi-pnx0105_atmel.c uses spi_pnx_msg_buff_t structure to embed physical and virtual address and length of the memory area allocated by consistent_alloc, so if we just get rid of the alloc/free functions, we'll copy wrong data from the userspace and nothing'll work.

Let's look at it from another point. When a read request comes from the userspace to spi-dev, spi-dev should allocate memory and copy the user data in there. The problem is it is not (and shouldn't be) aware whether the transfer is gonna be DMA or not so spi-dev can't choose theappropriate method of memory allocation. Therefore it's reasonable to let algorithm provide routines to do that.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/