Re: [PATCH] atmel_spi: Pass correct DMA address to controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think I'll sign off on this as-is.


On Wednesday 16 May 2007, Håvard Skinnemoen wrote:
> On 5/16/07, David Brownell <[email protected]> wrote:

> > It's legit to set up cpu-virtual (for PIO) and dma addresses
> > for each buffer, since the upper layer driver has no way to
> > know if the underlying controller driver is DMA-capable, or
> > for that matter PIO-capable.
> 
> Yes, but are there any drivers that will provide a valid dma address
> and a NULL cpu-virtual pointer?

Potentially.  One scenario would be a block driver, which needs to
work with scatterlists.  dma_map_sg() is allowed to coalesce the
scatterlist entries, as with an IOMMU.  If it does that, there can
no longer be a one-to-one linkage between addreses provided to that
driver, and the dma addresess.  (Likewise, addresses in HIGHMEM are
not normally going to have kernel virtual addresses.)  So providing
both types of address is no longer practical with scatterlists.


> 		That would indeed break my 
> assumptions, but it would also break any PIO-only drivers, wouldn't
> it?

Which is exactly why the current "mmc_spi" code doesn't use the
dma_map_sg() interface.  Instead, it goes in more byte-size chunks,
taking care to provide both dma and pio addresses.  It's a PITA,
but at least it's coded now.

- Dave



> Haavard
> 


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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux