mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: "Håvard Skinnemoen" <hskinnemoen@gmail.com>
Cc: "Haavard Skinnemoen" <hskinnemoen@atmel.com>,
	wux@landicorp.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atmel_spi: Pass correct DMA address to controller
Date: Wed, 30 May 2007 10:27:17 -0700	[thread overview]
Message-ID: <200705301027.17678.david-b@pacbell.net> (raw)
In-Reply-To: <1defaf580705161414i67e753d7x883a78da347f7d55@mail.gmail.com>

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@pacbell.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
> 



      reply	other threads:[~2007-05-30 17:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16 10:19 Haavard Skinnemoen
2007-05-16 19:54 ` David Brownell
2007-05-16 21:14   ` Håvard Skinnemoen
2007-05-30 17:27     ` David Brownell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200705301027.17678.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=hskinnemoen@atmel.com \
    --cc=hskinnemoen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wux@landicorp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®