From: Benjamin Herrenschmidt <bh40@calva.net>
To: khendricks@ivey.uwo.ca, linuxppc-dev@lists.linuxppc.org
Subject: Re: Fwd: Re: still no accelerated X ($#!$*)
Date: Fri, 21 Jan 2000 12:54:42 +0100 [thread overview]
Message-ID: <20000121125442.015889@mailhost.mipsys.com> (raw)
In-Reply-To: <00012019473900.07177@localhost.localdomain>
On Thu, Jan 20, 2000, Kevin Hendricks <khendricks@ivey.uwo.ca> wrote:
>From the various posts (given the operand ordering done in the original
post),
>here is what I have tried to piece together.
>
>asm volatile ("stwbrx %1,%2,%3; eieio" : "=m" (*(volatile unsigned
>*)(base_addr+regindex)) : "r" (regdata), "b" (regindex), "r"
>(base_addr));
>
>asm volatile ("lwbrx %0,%1,%2; eieio" : "=r"(val) : "b"(regindex),
>"r"(base_addr), "m" (*(volatile unsigned *)(base_addr+regindex)));
Hi Kevin !
A good rule is to use eieio() when accessing a register (that means doing
an access that actually performs an action and whose ordering is
important relative to other accesses of the same type) and not use it
when filling the framebuffer. There are usually few enough register
accesses for this to work. it may be optimal to skip eieio's when writing
to a bunch "parameters" registers where ordering is not important, in
this case you just need to put an eieio() between those, and the register
write that triggers the engine operation that will use those parameters.
However, when doing that, the PCI bridge is allowed to combine your
register writes in a burst, and I know some cards who don't handle burst
access to MMIO registers very well.
Basically, eieio() will make sure that all previous memory accesses will
have been finished before memory accesses after the eieio are done.
It may be important to make sure that the last bit of framebuffer has
been written before "starting" an engine operation. So one eieio between
frame buffer filling and engine register access may be useful in the case
where you use eieio after the write in the asm.
I personally tend to prefer doing the eieio _before_ the read/write in
the asm code, but there are some rare cases where you mix eieio and
non-eieio accesses (like with your framebuffer) where special care must
be taken and may require both eieio before and after the register access.
Another thing to take care of is PCI write posting: Basically, when you
write, let's say, a MMIO register, you are not guaranteed that this write
have actually been done unless you do a read from the same io space. For
example: If you write an interrupt mask register to disable an interrupt
followed by critical code in which this interrupt _must not_ happen, you
need absolutely to do a read (typically to re-read the mask you just
wrote to) after the write, and before the critical code.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-01-21 11:54 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Message from Kevin Hendricks <khendricks@ivey.uwo.ca>
2000-01-20 18:12 ` Fwd: Re: still no accelerated X ($#!$*) Kevin Hendricks
2000-01-20 18:26 ` David Edelsohn
2000-01-20 18:45 ` Benjamin Herrenschmidt
2000-01-20 18:51 ` David Edelsohn
2000-01-20 18:52 ` Franz Sirl
2000-01-20 19:31 ` Gabriel Paubert
2000-01-20 19:36 ` Kevin Hendricks
2000-01-20 19:51 ` Geert Uytterhoeven
2000-01-20 19:59 ` Gabriel Paubert
2000-01-20 20:08 ` David Edelsohn
2000-01-20 22:34 ` Franz Sirl
2000-01-21 0:05 ` Gabriel Paubert
2000-01-21 0:35 ` Kevin Hendricks
2000-01-21 1:53 ` Gabriel Paubert
2000-01-21 2:19 ` Kevin Hendricks
2000-01-21 7:58 ` Geert Uytterhoeven
2000-01-21 14:15 ` Benjamin Herrenschmidt
2000-01-22 20:54 ` [linux-fbdev] " anthony tong
2000-01-23 2:44 ` Kevin Hendricks
2000-01-21 11:54 ` Benjamin Herrenschmidt [this message]
2000-01-21 13:34 ` Gabriel Paubert
2000-01-21 14:06 ` Benjamin Herrenschmidt
2000-01-21 15:47 ` Franz Sirl
2000-01-21 19:08 ` Gabriel Paubert
2000-01-20 18:46 ` Franz Sirl
2000-01-21 13:53 Kevin_Hendricks
[not found] <200001211355.NAA05477@granada.iram.es>
2000-01-21 15:13 ` Gabriel Paubert
2000-01-21 15:29 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2000-01-21 17:32 David Edelsohn
2000-01-21 20:25 jlquinn
2000-01-23 13:06 ` Gabriel Paubert
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=20000121125442.015889@mailhost.mipsys.com \
--to=bh40@calva.net \
--cc=khendricks@ivey.uwo.ca \
--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).