public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Porter <porter@cox.net>
To: linux-kernel@vger.kernel.org, Dave Miller <davem@redhat.com>
Subject: Re: *dma_sync_single API change to support non-coherent cpus
Date: Mon, 3 Mar 2003 14:34:40 -0700	[thread overview]
Message-ID: <20030303143440.B31278@home.com> (raw)
In-Reply-To: <20030303195825.C17997@flint.arm.linux.org.uk>; from rmk@arm.linux.org.uk on Mon, Mar 03, 2003 at 07:58:25PM +0000

On Mon, Mar 03, 2003 at 07:58:25PM +0000, Russell King wrote:
> On Mon, Mar 03, 2003 at 11:18:48AM -0700, Matt Porter wrote:
> > On non cache coherent processors, it is necessary to perform
> > cache operations on the virtual address associated with the
> > buffer to ensure consistency.  There is one problem, however,
> > the current API does not provide the virtual address for the
> > buffer.  It only provides the bus address in the dma_addr_t.
> > On arm and mips, this is dealt with by simply doing bus_to_virt().
> > However, bus_to_virt() isn't valid for all addresses that could
> > have been passed into *map_single().
> 
> I find myself thinking, in passing, why we don't have these
> architectures define something like the following in architecture
> specific code:
> 
> 	struct dma_addr {
> 		unsigned long cpu;
> 		unsigned long bus;
> 		unsigned long size;
> 	};

<snip>

> Architectures which only need the CPU address can place only that in
> their structure definition, and make dma_map_single and friends no-ops.
> I feel that this would get rid of all the shouting DMA_* macros found
> in various pci.h header files.
> 
> This may be something considering for 2.7 though.

I like this abstraction of dma_addr. As you suggest, it's probably
significant enough to be only considered for 2.7.  I was shooting
for the minimal API change for 2.5/2.6 to make non-coherent 
processors functional.  I seriously don't want to submit a
documentation patch clarifying that this API is only valid for
certain addresses. :)

Regards,
-- 
Matt Porter
porter@cox.net
This is Linux Country. On a quiet night, you can hear Windows reboot.

      parent reply	other threads:[~2003-03-03 21:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-03 18:18 *dma_sync_single API change to support non-coherent cpus Matt Porter
2003-03-03 19:58 ` Russell King
2003-03-03 19:47   ` David S. Miller
2003-03-03 21:40     ` Matt Porter
2003-03-03 21:34   ` Matt Porter [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=20030303143440.B31278@home.com \
    --to=porter@cox.net \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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