linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Armin <akuster@pacbell.net>
Cc: Tom Rini <trini@kernel.crashing.org>,
	Armin Kuster <akuster@mvista.com>,
	linuxppc-embedded@lists.linuxppc.org,
	Paul Mackerras <paulus@samba.org>
Subject: Re: Another OCP enet patch
Date: Tue, 28 May 2002 16:50:27 +1000	[thread overview]
Message-ID: <20020528065027.GT16537@zax> (raw)
In-Reply-To: <3CF32B87.4010908@pacbell.net>


On Tue, May 28, 2002 at 12:02:31AM -0700, Armin wrote:
> >I agree with them not really belonging in ocp-dma.h either, but it's
> >either a PCI device or an 'Oh Chip Peripheral' of some sort.
> >
> >
> >>For 2.5, I think the proper fix is to remove the PCI_DMA_* constants
> >>entirely and replace them with some arbitrary constants to define DMA
> >>direction.  They can then be used for both PCI and OCP (and sbus,
> >>which also uses the PCI constants despite not being PCI).  But that
> >>means convincing Linus, of course.
> >>
> >
> >2.5 still seems to be in break everything mode, so why not send Linus a
> >patch which creates <linux/dma.h>, for example, and then do a quick
> >search/replace of PCI_DMA_* -> DMA_* and keep the numbers the same even.
>
> Well what I did for the USB ocp drive was to call dma_pool_*,
> dma_*_consistent etc... It would be fairly easy to leave the pci_* in
> place , remove as much common code and place them in to generic dma
> fuctions.  I would leave the need or use of the struct pci_dev in the
> pci_* fuctions to do their business and buffer the new dma API's.  This
> will keep us from changing _all_ pci drivers, give a central location
> for common code and give those arch/drivers who want to use dma
> functions and a way to break away from either having to enable "pci" or
> include pci headers to make things work. the ocp drivers could use these
> generic dma api directly or all use some sort of wrapper.

Um, I think you're overestimating how generic this dma_pool API is or
can be.  In general a peripheral might be hanging of one or several
buses from the CPU with IOMMU(s) or TCE(s) or equivalent between it
and main memory.  That's why pci_alloc_consistent() and friends
require the pci_dev structure and why they don't have an interface as
simple as consistent_*().  This is exactly why dma_cache_wback_inv()
and so on are kinda deprecated - they're not well defined on a machine
whose buses have different address spaces.

The direction constants can be made generic trivially.  Generalising
more of the DMA infrastructure is much harder.

In any case we're talking about consistent_sync() here, not
consistent_alloc() which specifically *isn't* called on specially
allocated blocks of memory - the OCP enet driver calls it on random
SKBs.  In some ways, since we're PPC specific anyway, I think it would
make as much sense as anything just to directly call
dcache_flush_range() and so forth, rather than consistent_sync() or
dma_cache_*().

--
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.  -- H.L. Mencken
http://www.ozlabs.org/people/dgibson

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-05-28  6:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-27  4:03 Another OCP enet patch David Gibson
2002-05-27  6:14 ` Armin Kuster
2002-05-27 16:23 ` Tom Rini
2002-05-28  0:57   ` David Gibson
2002-05-28  1:25     ` Tom Rini
2002-05-28  6:36       ` David Gibson
2002-05-28 15:08         ` Tom Rini
2002-05-28  7:02       ` Armin
2002-05-28  6:50         ` David Gibson [this message]
2002-05-28 10:51           ` Dan Malek
2002-05-29  3:48             ` David Gibson
2002-05-29 14:51               ` Dan Malek
2002-05-28 10:39     ` Dan Malek
2002-05-29  4:16       ` David Gibson
2002-05-29 15:02         ` Dan Malek
2002-05-29 16:01           ` Armin Kuster
2002-05-30  3:10             ` David Gibson
2002-05-30  3:09           ` David Gibson
2002-05-30  4:16             ` Dan Malek
2002-05-30  4:30               ` 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=20020528065027.GT16537@zax \
    --to=david@gibson.dropbear.id.au \
    --cc=akuster@mvista.com \
    --cc=akuster@pacbell.net \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=paulus@samba.org \
    --cc=trini@kernel.crashing.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;
as well as URLs for NNTP newsgroup(s).