linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: linas@austin.ibm.com (Linas Vepstas)
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>, paulus@samba.org
Subject: Re: [POWERPC] merge iSeries i/o operations with the rest
Date: Tue, 5 Sep 2006 11:41:46 -0500	[thread overview]
Message-ID: <20060905164146.GA7139@austin.ibm.com> (raw)
In-Reply-To: <20060905120817.e52857ee.sfr@canb.auug.org.au>

On Tue, Sep 05, 2006 at 12:08:17PM +1000, Stephen Rothwell wrote:
> @@ -273,25 +234,30 @@ #define iobarrier_w()  eieio()
>   * These routines do not perform EEH-related I/O address translation,
>   * and should not be used directly by device drivers.  Use inb/readb
>   * instead.
> + *
> + * For some of these, we force the target/source register to be
> + * r0 to ease decoding on iSeries.

???
Why?

>  static inline int in_8(const volatile unsigned char __iomem *addr)
>  {
> -	int ret;
> +	register unsigned int ret __asm__("r0");

Such as here .. why is this being forced ??

> -	__asm__ __volatile__("lbz%U1%X1 %0,%1; twi 0,%0,0; isync"
> -			     : "=r" (ret) : "m" (*addr));
> +	__asm__ __volatile__("lbzx %0,0,%1; twi 0,%0,0; isync"
> +			     : "=r" (ret) : "r" (addr));

Why make this change? The old code allows the compiler to optimize
better than the new code.  One might argue that, in the grand scheme of
things, i/o is very slow, so a few cycles here doesn't matter much.
But still, I don't understand why this change is needed.

> +static inline void memset_io(volatile void __iomem *addr, int c,
> +                                 unsigned long n)
> +{
> +	if (firmware_has_feature(FW_FEATURE_ISERIES))
> +		iSeries_memset_io(addr, c, n);
> +	else
> +		eeh_memset_io(addr, c, n);
> +}

!! I think it would be much better to have this be a compile-time
check rather than a run-time check. No only does it save cycles, 
but it makes the iSeries kernel smaller (by not needing eeh code 
in it) and the p-series code smaller (by not compiling iseries
code into it. 


--linas

  parent reply	other threads:[~2006-09-05 16:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-05  2:08 [POWERPC] merge iSeries i/o operations with the rest Stephen Rothwell
2006-09-05  5:07 ` David Woodhouse
2006-09-05  5:39   ` Stephen Rothwell
2006-09-05 16:41 ` Linas Vepstas [this message]
2006-09-05 23:19   ` Stephen Rothwell
2006-09-06  8:24 ` Stephen Rothwell
2006-09-18  5:38 ` Stephen Rothwell
2006-09-20 12:15   ` Stephen Rothwell
2006-09-20 16:01     ` Hollis Blanchard
2006-09-21  0:03       ` Stephen Rothwell
2006-09-21  0:20         ` Michael Ellerman
2006-09-21  4:55           ` [POWERPC] mark BUG() as noreturn Stephen Rothwell
2006-09-21 12:18             ` Jimi Xenidis
2006-09-22  0:54               ` Michael Ellerman
2006-09-22  1:34                 ` Amos Waterland
2006-09-22 10:58                 ` Jimi Xenidis
2006-09-21 13:23             ` David Howells
2006-09-21 15:15               ` Segher Boessenkool
2006-09-21  8:00         ` [POWERPC] merge iSeries i/o operations with the rest Stephen Rothwell

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=20060905164146.GA7139@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=sfr@canb.auug.org.au \
    /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).