linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Tom Rini <trini@kernel.crashing.org>
To: Armin Kuster <akuster@mvista.com>,
	linuxppc-embedded@lists.linuxppc.org,
	David Gibson <david@gibson.dropbear.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Subject: Re: Another OCP enet patch
Date: Tue, 28 May 2002 08:08:42 -0700	[thread overview]
Message-ID: <20020528150842.GF1295@opus.bloom.county> (raw)
In-Reply-To: <20020528063638.GS16537@zax>


On Tue, May 28, 2002 at 04:36:38PM +1000, David Gibson wrote:
> On Mon, May 27, 2002 at 06:25:16PM -0700, Tom Rini wrote:
> > On Tue, May 28, 2002 at 10:57:28AM +1000, David Gibson wrote:
> > > On Mon, May 27, 2002 at 09:23:23AM -0700, Tom Rini wrote:
> > > > On Mon, May 27, 2002 at 02:03:30PM +1000, David Gibson wrote:
> > > >
> > > > > I realise that logically the OCP enet driver, and the
> > > > > consistent_sync() has nothing to do with PCI.  However using the pci.h
> > > > > constants seems a better approach than defining new constants with the
> > > > > same values, when the switch in consistent_sync() explicitly checks
> > > > > against the PCI constants.
> > > > >
> > > > > In the longer term consistent_sync() itself should be changed not to
> > > > > reference the PCI constants - in fact the PCI constants should
> > > > > probably be moved and renamed since they have no inherent connection
> > > > > with PCI at all.
> > > >
> > > > At this point I think I should give my 2 cents, so...
> > > >
> > > > I think we should keep ocp-dma.h around for now (2.4.x timeframe) and
> > > > change consistent_sync() to not check for the PCI versions (which I
> > > > believe happened just because it's a cut&paste&fix of the ARM code) and
> > > > for 2.5 hope that a more general fix comes out..
> > >
> > > I disagree.  Using the constants from pci.h is the least-wrong simple
> > > fix for now - yes it's conceptually wrong, but they're just arbitrary
> > > constants, it doesn't do any real damage.
> >
> > Well, for the moment I think they're less-arbitrary constants than they
> > should be, but yes..
>
> Um, I don't see what you mean by "less arbitrary than they should be".

Well, you *could* pick any number you like for the DMA_* ones, but it'd
be much nicer (and in a sense safer) to pick the same constants
PCI_DMA_* uses.

> > > Changing consistent_sync() to use its own constants isn't completely
> > > trivial, because asm/pci.h calls consistent_sync() with the constants
> > > passed as arguments to pci_map_single() et al, assuming they have the
> > > correct values.  So, to decouple the consistent_sync() constants from
> > > the PCI direction constants we would have to put a switch in every
> > > time consistent_sync() is used in asm/pci.h.  The PCI constants could
> > > be defined in terms of the non-PCI constants, but that means changing
> > > generic code (linux/pci.h).
> >
> > Well, if DMA_* == PCI_DMA_*, we don't have to do anything.  We put a
> > comment saying something like:
> > /* The PCI_DMA_* constants have nothing to do with PCI.  Someone should
> >  * rename this in 2.5... */
> > And while someone could re-number the arbitrary constants, I'd think
> > something like that would be questioned before being accepted.
>
> Well, yes, but calling the function with once constant then testing
> against another within the function gives me the willies.  If the
> constants are changed it will break horribly, and it will give
> misleading results if people try to grep for one constant or the
> other.

Which is why you put up a comment, which people grep'ing for will see.
And again, while someone *could* go and change all of the constants for
fun, it's unlikley in 2.4.

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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

  reply	other threads:[~2002-05-28 15:08 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 [this message]
2002-05-28  7:02       ` Armin
2002-05-28  6:50         ` David Gibson
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=20020528150842.GF1295@opus.bloom.county \
    --to=trini@kernel.crashing.org \
    --cc=akuster@mvista.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=paulus@samba.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).