On Tuesday 02 March 2010, Feng Tang wrote: > On Wed, 3 Mar 2010 12:51:58 +0800 > David Brownell <david-b@xxxxxxxxxxx> wrote: > > > On Tuesday 02 March 2010, Feng Tang wrote: > > > + * 3. This driver doesn't support work with a spi cotnroller in > > > DMA mode, > > > > As Grant said: That's a bug ... one that will randomly > > kick in based on whether the underlying SPI controller driver > > happens to use DMA for a given transaction. > > > > > From this perspective, yes, it's a bug that this driver use non DMA-safe > IO buffer, which prevents it to be portable for all kinds of controllers, Yes, that's a bug ... you're using a programming interface which has portability as a core goal. In an operating system kernel which also has such a goal. > and I can make it DMA safe. That's the right solution. > Here comes another idea, can we add a capability flag in struct spi_master > indicating the master supporting poll or dma or both. Also we add similar > bits in struct spi_transfer indicating the this transfer wants to be handled > in poll or dma mode. Let's not do either of those. There's no need to introduce such complexity, or to enable the associated new failure modes and bugs. Much simpler to just use DMA-safe I/O buffers in the first place ... which is what pretty much every driver stack in Linux already expects or requires. - Dave -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html