From: Paul Mackerras <paulus@samba.org>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@osdl.org, akpm@osdl.org, mingo@redhat.com,
alan@redhat.com, linux-arch@vger.kernel.org,
linuxppc64-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Document Linux's memory barriers [try #4]
Date: Sat, 11 Mar 2006 11:01:53 +1100 [thread overview]
Message-ID: <17426.4977.893926.803202@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <26486.1142003950@warthog.cambridge.redhat.com>
David Howells writes:
> Paul Mackerras <paulus@samba.org> wrote:
> > There shouldn't be any problem here, because readw/writew _must_
> > ensure that the device accesses are serialized.
>
> No. That depends on the properties of the memory window readw/writew write
> through, the properties of the CPU wrt memory accesses, and what explicit
> barriers at interpolated inside readw/writew themselves.
The properties of the memory window are certainly relevant. For a
non-prefetchable PCI MMIO region, the readw/writew must ensure that
the accesses are serialized w.r.t. each other, although not
necessarily serialized with accesses to normal memory. That is a
requirement that the driver writer can rely on, and the implementor of
readw/writew must ensure is met, taking into account the properties of
the CPU (presumably by putting explicit barriers inside readw/write).
For prefetchable regions, or if the cookie used with readw/writew has
been obtained by something other than the normal ioremap{,_nocache},
then it's more of an open question.
> > Of course, on an SMP system it would be quite possible for the
> > interrupt to be taken on another CPU, and in that case disabling
> > interrupts (I assume that by "DISABLE IRQ" you mean
> > local_irq_disable() or some such)
>
> Yes. There are quite a few different ways to disable interrupts.
I think it wasn't clear to me which of the following you meant:
(a) Telling this CPU not to take any interrupts (e.g. local_irq_disable())
(b) Telling the interrupt controller not to allow interrupts from that
device (e.g. disable_irq(irq_num))
(c) Telling the device not to generate interrupts in some
device-specific fashion
They all have different characteristics w.r.t. timing and
synchronization, so I think it's important to be clear which one you
mean. For example, if it's (c), then after doing a writel (or
whatever) to the device, you then need at least to do a readl to make
sure the write has got to the device, and even then there might be an
interrupt signal still wending its way through the interrupt
controller etc., which might arrive after the readl has finished.
I think you meant (a), but DISABLE_IRQ actually sounds more like (b).
Paul.
next prev parent reply other threads:[~2006-03-11 0:02 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060315200956.4a9e2cb3.akpm@osdl.org>
2006-03-09 20:29 ` David Howells
2006-03-09 23:34 ` Paul Mackerras
2006-03-09 23:45 ` Michael Buesch
2006-03-09 23:56 ` Linus Torvalds
2006-03-10 0:07 ` Michael Buesch
2006-03-10 0:48 ` Alan Cox
2006-03-10 0:54 ` Paul Mackerras
2006-03-10 5:28 ` Nick Piggin
2006-03-10 15:19 ` David Howells
2006-03-11 0:01 ` Paul Mackerras [this message]
2006-03-12 17:15 ` Eric W. Biederman
2006-03-13 12:32 ` Sergei Organov
2006-03-14 20:31 ` David Howells
2006-03-14 21:11 ` linux-os (Dick Johnson)
2006-03-15 9:09 ` Sergei Organov
2006-03-15 9:04 ` Sergei Organov
2006-03-14 20:35 ` David Howells
2006-03-15 9:11 ` Sergei Organov
2006-03-14 21:26 ` David Howells
2006-03-14 21:48 ` Paul Mackerras
2006-03-14 23:59 ` David Howells
2006-03-15 0:20 ` Linus Torvalds
2006-03-15 1:25 ` Nick Piggin
2006-03-15 0:54 ` Paul Mackerras
2006-03-15 1:19 ` David Howells
2006-03-15 1:47 ` Linus Torvalds
2006-03-15 11:10 ` David Howells
2006-03-15 11:51 ` Nick Piggin
2006-03-15 13:47 ` David Howells
2006-03-15 23:21 ` Nick Piggin
2006-03-15 14:23 ` [PATCH] Document Linux's memory barriers [try #5] David Howells
2006-03-16 11:50 ` David Howells
2006-03-16 17:18 ` Linus Torvalds
2006-03-17 1:20 ` Nick Piggin
2006-03-16 23:17 ` Paul E. McKenney
2006-03-16 23:55 ` Linus Torvalds
2006-03-17 1:29 ` Paul E. McKenney
2006-03-17 5:32 ` Linus Torvalds
2006-03-17 6:23 ` Paul E. McKenney
2006-03-23 18:34 ` David Howells
2006-03-23 19:28 ` Linus Torvalds
2006-03-23 22:26 ` Paul E. McKenney
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=17426.4977.893926.803202@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=akpm@osdl.org \
--cc=alan@redhat.com \
--cc=dhowells@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=mingo@redhat.com \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®