lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 30 May 2007 10:27:17 -0700
From:	David Brownell <david-b@...bell.net>
To:	"Håvard Skinnemoen" <hskinnemoen@...il.com>
Cc:	"Haavard Skinnemoen" <hskinnemoen@...el.com>, wux@...dicorp.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] atmel_spi: Pass correct DMA address to controller

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 <david-b@...bell.net> 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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ