mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Jeff Garzik <jgarzik@pobox.com>, Andrew Morton <akpm@osdl.org>,
	"David S. Miller" <davem@davemloft.net>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: lib/iomap.c mmio_{in,out}s* vs. __raw_* accessors
Date: Sat, 4 Nov 2006 19:34:19 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0611041918560.25218@g5.osdl.org> (raw)
In-Reply-To: <1162689005.28571.118.camel@localhost.localdomain>



On Sun, 5 Nov 2006, Benjamin Herrenschmidt wrote:
> 
> The -only- problem I'm talking about is that in order to implement the
> above, this IOCOND does something around the line of:
> 
> 	if (pio)
> 		use_pio_accessor()
> 	else
> 		use_mmio_accessor()
> 
> It does that, by using the existing, arch provided, accessors for PIO
> and MMIO (inX, outX, readX, writeX), which are doing the right thing vs.
> barriers etc, so again, all is good and well.... until you hit cases
> where such accessors don't exist !

Right. Your first email seemed to make sense. However, you then said (in 
the second email, the one I responded to), and THAT didn't make any sense 
at all:

   Versions that would transparently use MMIO or PIO would make sense. A
   pure MMIO implementation doesn't, that has to be arch specific. It makes
   the generic iomap suddently non-portable in some ways.

This is the part I claim says that you don't seem to make any sense. You 
seemed to be missing the point about the whole "repeat" instructions, 
since the WHOLE POINT there was that it would _not_ transparently use MMIO 
or PIO, it would very much _nontransparently_ use one or the other, 
exactly because the choice has already very much been made.

> 	- "be" versions of MMIO accesses. Example:

Now, this one we should probably just drop, because nobody uses it. 
Big-endian IO devices basically don't exist any more, and if they do, they 
wouldn't use any generic structures.

> 	- repeat versions of MMIO accessors. Example:

So this one is the only one that makes sense. But it DOES NOT MAKE SENSE 
in light of your second email that talked about "transparently use MMIO or 
PIO". That's what made me think that you were just blathering.

But I also don't want to add _yet_another_ bogus IO accessor function to 
all architectures that nobody actually uses except for this one little 
thing. Quite frankly, I'd rather just add something like

	#ifndef iobarrier_w
	# define iobarrier_w() do { } while (0)
	#endif

and then use iobarrier_w()" in the "mmio" version of the __raw_writel loop 
(and same for iobarrier_r() for the __raw_readl).

			Linus

  parent reply	other threads:[~2006-11-05  3:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-04  7:52 Benjamin Herrenschmidt
2006-11-04 14:06 ` Russell King
2006-11-04 22:17   ` Benjamin Herrenschmidt
2006-11-04 23:52     ` Linus Torvalds
2006-11-05  1:10       ` Benjamin Herrenschmidt
2006-11-05  3:32         ` Benjamin Herrenschmidt
2006-11-05  3:46           ` Linus Torvalds
2006-11-05  3:55             ` Benjamin Herrenschmidt
2006-11-05  4:00             ` Benjamin Herrenschmidt
2006-11-05  4:16               ` Linus Torvalds
2006-11-05  4:38                 ` Benjamin Herrenschmidt
2006-11-05  5:00                   ` Linus Torvalds
2006-11-05  5:08                     ` Benjamin Herrenschmidt
2006-11-05  5:28                       ` Benjamin Herrenschmidt
2006-11-06  2:56                         ` Benjamin Herrenschmidt
2006-11-06  3:13                           ` Linus Torvalds
2006-11-06  4:50                             ` Benjamin Herrenschmidt
2006-11-05  3:34         ` Linus Torvalds [this message]
2006-11-05  3:49           ` Benjamin Herrenschmidt

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=Pine.LNX.4.64.0611041918560.25218@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    /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®