From: James Bottomley <James.Bottomley@steeleye.com>
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: James.Bottomley@SteelEye.com, davem@redhat.com,
jgarzik@pobox.com, linux-kernel@vger.kernel.org, miles@gnu.org
Subject: Re: [RFC] generic device DMA implementation
Date: Wed, 04 Dec 2002 20:02:30 -0600 [thread overview]
Message-ID: <200212050202.gB522U505445@localhost.localdomain> (raw)
In-Reply-To: Message from "Adam J. Richter" <adam@yggdrasil.com> of "Wed, 04 Dec 2002 16:43:11 PST." <200212050043.QAA03207@adam.yggdrasil.com>
adam@yggdrasil.com said:
> As you know, I posted a similar patch that created a new field in
> struct bus_type, as Miles Bader suggested just now, although only for
> {alloc,free}_consistent. if the bus-specific variation can be
> confined to some smaller part of these routines or eliminated, then
> I'm all in favor of skipping the extra indirection and going with your
> approach. It will be interesting to see if your model allows most of
> the sbus_ and pci_ DMA mapping routines in sparc to be merged. I
> suspect that you will have to adopt some kind of convention, such as
> that device->parent->driver_private will have a common meaning for pci
> and sbus device on that platform.
I did prototype something like this, using a field called dma_accessors that
was basically a platform opaque set of function pointers.
I ultimately came to the conclusion that these functions couldn't be per
bus_type, they had to be per bus instance. Finally, it just seemed easier to
load this information into the platform_data field of the generic device and
let the implementation handle it instead of exposing it explicitly in the
model.
> Can you please define the "consistency" argument to these two
> routines as a bit mask? There are probably other kinds of memory
> inconsistency a driver might be able to accomodate in the future (CPU
> read caching, CPU writeback, incosistency across mulitple CPU's if the
> driver knows that it is only going to run on one CPU). I think 0
> should be the "most consistent" kind of memory. That way, DMA memory
> allocators could ignore bits that they don't know about, as those bits
> would only advertise extra capabilities of a driver. I think this
> extensibility is more useful than the debugging value of
> DMA_CONFORMANCE_NONE.
I'd rather hide the range of possible memory types from the drivers. I think
all a driver needs to know is that the memory is fully consistent, or it isn't
(and if it isn't, the driver has to put the full syncs in, the implementation
decides if they really correspond to anything).
By and large, most drivers just want to specify CONFORMANCE_CONSISTENT, so
that they don't have to bother with the sync points.
> Also something that could be added later is a bus_type.mem_mapped
> flag so that these DMA routines could do:
> BUG_ON(!dev->bus.mem_mapped);
> ...to catch attempts to allocate memory for devices that are not
> mapped. Alternatively, we could have a struct mem_device that embeds
> a struct device and represents only those types of devices that can be
> mapped into memory.
I'm dubious about efforts to unify io space and memory space. I think the
semantics are just too different. However, if someone else wants to lead the
charge...
> P.S., Did you miss a patch for include/linux/device.h adding
> device.dma_mask, or is that change already queued for 2.5.51?
I think that's queued somewhere in Patrick Mochel's pile for inclusion.
James
next prev parent reply other threads:[~2002-12-05 1:55 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-05 0:43 Adam J. Richter
2002-12-05 0:55 ` Jeff Garzik
2002-12-05 2:02 ` James Bottomley [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-12-07 14:37 Adam J. Richter
2002-12-07 4:12 Adam J. Richter
2002-12-06 22:52 Adam J. Richter
2002-12-06 22:17 Adam J. Richter
2002-12-06 22:26 ` James Bottomley
2002-12-06 22:29 ` David S. Miller
2002-12-06 22:48 ` James Bottomley
2002-12-06 22:49 ` David S. Miller
2002-12-06 22:32 ` Arjan van de Ven
2002-12-06 17:39 Adam J. Richter
2002-12-06 18:07 ` Matthew Wilcox
2002-12-06 17:07 Adam J. Richter
2002-12-06 16:48 James Bottomley
2002-12-06 16:19 Adam J. Richter
2002-12-06 16:40 ` Matthew Wilcox
2002-12-06 18:17 ` David S. Miller
2002-12-06 18:29 ` James Bottomley
2002-12-06 18:31 ` David S. Miller
2002-12-06 18:40 ` James Bottomley
2002-12-06 18:42 ` David S. Miller
2002-12-06 21:04 ` Oliver Xymoron
2002-12-07 10:19 ` David Gibson
2002-12-06 18:36 ` Matthew Wilcox
2002-12-06 18:38 ` David S. Miller
2002-12-06 7:41 Adam J. Richter
2002-12-06 15:50 ` David S. Miller
2002-12-06 7:14 Adam J. Richter
2002-12-06 16:26 ` James Bottomley
2002-12-06 17:48 ` Miles Bader
2002-12-07 9:56 ` David Gibson
2002-12-07 9:45 ` David Gibson
2002-12-07 11:26 ` Russell King
2002-12-08 5:28 ` David Gibson
2002-12-06 6:15 David Brownell
2002-12-06 2:08 Adam J. Richter
2002-12-06 2:53 ` David Gibson
2002-12-06 4:03 ` David S. Miller
2002-12-05 20:27 Adam J. Richter
2002-12-05 17:49 Manfred Spraul
2002-12-06 0:08 ` David Gibson
2002-12-05 12:21 Adam J. Richter
2002-12-05 12:44 ` Russell King
2002-12-05 12:13 Adam J. Richter
2002-12-05 11:57 Adam J. Richter
2002-12-06 0:06 ` David Gibson
2002-12-05 5:20 Adam J. Richter
2002-12-05 3:02 Adam J. Richter
2002-12-05 6:15 ` David Gibson
2002-12-05 1:21 Adam J. Richter
2002-12-05 2:40 ` David Gibson
2002-12-05 2:49 ` Miles Bader
2002-12-05 6:12 ` David Gibson
2002-12-04 17:47 James Bottomley
2002-12-04 18:27 ` Jeff Garzik
2002-12-04 19:36 ` James Bottomley
2002-12-04 21:19 ` Miles Bader
2002-12-04 21:21 ` Miles Bader
2002-12-04 21:42 ` James Bottomley
2002-12-05 5:44 ` Miles Bader
2002-12-04 21:46 ` James Bottomley
2002-12-05 2:31 ` Miles Bader
2002-12-05 3:06 ` James Bottomley
2002-12-05 5:02 ` David Gibson
2002-12-05 11:15 ` Benjamin Herrenschmidt
2002-12-05 11:16 ` William Lee Irwin III
2002-12-05 15:12 ` James Bottomley
2002-12-05 0:47 ` David Gibson
2002-12-05 0:54 ` Jeff Garzik
2002-12-05 1:44 ` James Bottomley
2002-12-05 2:38 ` David Gibson
2002-12-05 3:13 ` James Bottomley
2002-12-05 5:05 ` David Gibson
2002-12-05 15:03 ` James Bottomley
2002-12-05 23:54 ` David Gibson
2002-12-05 3:17 ` Miles Bader
2002-12-05 6:06 ` David Gibson
2002-12-05 6:43 ` Miles Bader
2002-12-05 23:44 ` David Gibson
2002-12-06 2:23 ` Miles Bader
2002-12-05 3:41 ` Jeff Garzik
2002-12-05 6:04 ` David Gibson
2002-12-05 16:29 ` Jeff Garzik
2002-12-05 23:59 ` David Gibson
2002-12-05 11:08 ` Benjamin Herrenschmidt
2002-12-05 11:35 ` Russell King
2002-12-05 15:24 ` James Bottomley
2002-12-06 0:01 ` David Gibson
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=200212050202.gB522U505445@localhost.localdomain \
--to=james.bottomley@steeleye.com \
--cc=adam@yggdrasil.com \
--cc=davem@redhat.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miles@gnu.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
Powered by JetHome