From: Paul Mackerras <paulus@cs.anu.edu.au>
To: Geert.Uytterhoeven@cs.kuleuven.ac.be
Cc: linuxppc-dev@lists.linuxppc.org, linux-fbdev@vuser.vu.union.edu
Subject: Re: readl() and friends and eieio on PPC
Date: Tue, 10 Aug 1999 11:00:29 +1000 [thread overview]
Message-ID: <199908100100.LAA28784@tango.anu.edu.au> (raw)
In-Reply-To: <Pine.LNX.4.10.9908091008460.25523-100000@mercator.cs.kuleuven.ac.be> (message from Geert Uytterhoeven on Mon, 9 Aug 1999 10:17:17 +0200 (CEST))
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2470 bytes --]
Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be> wrote:
> Jes Sørensen pointed out to me that readl() and friends should not use eieio on
> PPC. On other architectures (e.g. AXP) this isn't done neither.
Readl/writel etc. are intended for "memory" space, but this could be
either memory-mapped device registers or plain ordinary memory. The
intel folks don't make the distinction because ia32 doesn't allow
reordering of memory accesses AFAIK.
> Hence both inl() and readl() protect against reordering. This is not necessary
> for readl(). Drivers that need to protect against reordering should use
> wmb()/rmb()/mb() theirselves.
Linus made the point in a recent post to linux-kernel that people
shouldn't necessarily expect inb/outb/readb/writeb etc. to be usable
on every kind of bus - it's quite reasonable to define other access
methods on other cpus or buses.
> If readl() and friends don't do eieio, the fbcon-* routines won't be slowed
> down by using readl() and friends (but we're still having the byte swapping
> then).
Do you have any numbers to show how much the eieios slow you down?
If you take out the eieios, you will break other drivers, starting
with the OHCI USB host driver. Can we think of another way around the
problem? You could use le32_to_cpup for loading from the frame
buffer, but there isn't currently an equivalent for stores,
unfortunately (one could be invented, though).
> And atyfb should use readl()/writel() instead of aty_{ld,st}_le32(), so we can
> get rid of the inline assembler. Note that this will probably break on Atari,
I thought the point of the aty_ld/st* routines was to avoid one add
instruction each time by using the PPC indexed addressing mode.
Anyway, IMO the aty_ld/st* routines *should* include the eieio. That
would mean you wouldn't need the explicit eieio() calls scattered
through the rest of the driver. I guess it's just luck that it works
where you do a sequence of aty_st_le32's to set up some drawing
command and then call wait_for_fifo (or wait_for_idle) which does an
aty_ld_le32. Or doesn't it matter if the load gets done before all of
the stores have completed?
Paul.
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
next prev parent reply other threads:[~1999-08-10 1:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-08-09 8:17 readl() and friends and eieio on PPC Geert Uytterhoeven
1999-08-09 17:19 ` David A. Gatwood
1999-08-10 1:00 ` Paul Mackerras [this message]
1999-08-10 7:18 ` [linux-fbdev] " Jes Sorensen
1999-08-11 0:23 ` Paul Mackerras
1999-08-11 7:23 ` Jes Sorensen
1999-08-11 7:38 ` Richard Henderson
1999-08-12 0:13 ` Paul Mackerras
1999-08-12 1:39 ` Peter Chang
1999-08-12 4:52 ` Paul Mackerras
1999-08-12 6:17 ` Peter Chang
1999-08-12 0:17 ` Paul Mackerras
1999-08-12 4:40 ` Richard Henderson
1999-08-12 5:00 ` Paul Mackerras
1999-08-12 5:43 ` Richard Henderson
1999-08-12 7:07 ` Paul Mackerras
1999-08-12 7:33 ` Richard Henderson
1999-08-12 9:58 ` Paul Mackerras
1999-08-12 12:31 ` Geert Uytterhoeven
1999-08-13 12:18 ` Paul Mackerras
1999-08-18 11:02 ` Gabriel Paubert
1999-08-13 18:33 ` Richard Henderson
1999-08-12 5:16 ` David Edelsohn
1999-08-12 5:27 ` Paul Mackerras
1999-08-12 5:52 ` Richard Henderson
1999-08-12 7:11 ` Paul Mackerras
1999-08-12 7:32 ` Jes Sorensen
1999-08-11 23:52 ` Paul Mackerras
1999-08-12 7:38 ` Jes Sorensen
1999-08-12 19:00 ` David A. Gatwood
1999-08-13 1:51 ` Paul Mackerras
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=199908100100.LAA28784@tango.anu.edu.au \
--to=paulus@cs.anu.edu.au \
--cc=Geert.Uytterhoeven@cs.kuleuven.ac.be \
--cc=Paul.Mackerras@cs.anu.edu.au \
--cc=linux-fbdev@vuser.vu.union.edu \
--cc=linuxppc-dev@lists.linuxppc.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).