From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linas Vepstas <linas@austin.ibm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
paulus@samba.org, ppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: [POWERPC] convert string i/o operations to C
Date: Wed, 20 Sep 2006 09:12:12 +1000 [thread overview]
Message-ID: <1158707532.6002.171.camel@localhost.localdomain> (raw)
In-Reply-To: <20060919182953.GK29167@austin.ibm.com>
On Tue, 2006-09-19 at 13:29 -0500, Linas Vepstas wrote:
> On Tue, Sep 19, 2006 at 10:23:51PM +1000, Stephen Rothwell wrote:
>
> Perhaps this:
>
> > +void _insb(volatile u8 __iomem *port, void *buf, int ns)
> > +{
> > + asm volatile("sync");
> > + if (ns <= 0)
> > + return;
> > + asm volatile(
>
> should be this:
>
> > +void _insb(volatile u8 __iomem *port, void *buf, int ns)
> > +{
> > + if (ns <= 0)
> > + return;
> > + asm volatile("sync");
> > + asm volatile(
No. The barrier should be there even if somebody is lame enough to give
a count of 0.
> to assuage David Howell's concern. Not that ns should be negative
> in the first place ... but what the hey.
>
> Re Davids other comment: "ns" stands for "no byte-swap", and
> "s" stands for "string" so "insl_ns" is input string of longs,
> no byte swap.
David's comment was about the "ns" argument which is the count (dunno
why "ns").
> Here's a question:
>
> > + asm volatile(
> > + "mtctr %2\n"
> > + "subi %1,%1,1\n"
> > + "0: lbz %2,0(%0)\n"
> > + "eieio\n"
> > + "stbu %2,1(%1)\n"
> > + "bdnz 0b\n"
> > + "twi 0,%2,0\n"
>
> What does this twi do? According to my powerpc docs, this would be a
> no-op. Does this have some magic synchronizing powers on certain
> implementations? If so, there should be at least a comment card added
> about why the twi is there. (This special ability of twi might be
> well-known to some, but still, this is not immediately obvious,
> and not immedately documented in e.g. the PEM.)
>
> --linas
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
next prev parent reply other threads:[~2006-09-19 23:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-19 12:23 [POWERPC] convert string i/o operations to C Stephen Rothwell
2006-09-19 12:42 ` David Howells
2006-09-19 23:07 ` Stephen Rothwell
2006-09-19 18:29 ` Linas Vepstas
2006-09-19 18:52 ` Kim Phillips
2006-09-19 18:58 ` Matt Sealey
2006-09-19 19:10 ` Segher Boessenkool
2006-09-19 19:20 ` Matt Sealey
2006-09-19 19:47 ` Segher Boessenkool
2006-09-19 23:17 ` Benjamin Herrenschmidt
2006-09-19 23:14 ` Benjamin Herrenschmidt
2006-09-19 19:04 ` Linas Vepstas
2006-09-19 19:06 ` Segher Boessenkool
2006-09-19 23:12 ` Benjamin Herrenschmidt [this message]
2006-09-20 0:03 ` Segher Boessenkool
2006-09-20 0:08 ` Benjamin Herrenschmidt
2006-09-20 0:29 ` Segher Boessenkool
2006-09-20 3:35 ` Stephen Rothwell
2006-09-20 4:38 ` Michael Ellerman
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=1158707532.6002.171.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=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).