mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: root@chaos.analogic.com, Jeff Garzik <jgarzik@pobox.com>
Cc: Ross Biro <rossb@google.com>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Alan Cox <alan@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.4.21-pre3-ac4
Date: 13 Jan 2003 23:02:17 +0100	[thread overview]
Message-ID: <1042495337.587.27.camel@zion.wanadoo.fr> (raw)
In-Reply-To: <Pine.LNX.3.95.1030113162939.30920A-100000@chaos.analogic.com>

Jeff Garzik wrote:

> ...but, at the same time, who knows how long the write posting may
take,
> so one doesn't know how long the delay really needs to be.
> 
> It would be nice if there was an arch-specific flush-posted-writes
hook
> [wmb_mmio() ?], if that was possible on write-posting CPUs.  Currently
> right now the canonical solution ("MMIO read") doesn't work in some
> situations, and I do think we have a solution at all for those "some
> situations."

What situations a read from the same bus path won't work ? wmb_mmio
can't work, it's really a matter of bus path, you have to read from the
same bus segment your device is on, preferably the same device.

On Mon, 2003-01-13 at 22:40, Richard B. Johnson wrote:

> There is a well-defined procedure for this. Any "read" anywhere
> in the PCI address space, will force all posted writes to complete.
> However, the "read" will not be the data one would obtain after
> the write completes. Therefore, to guarantee that all posted
> writes complete before you read, for instance, status that could
> be affected by that write, you execute a dummy read anywhere in
> PCI address space, somewhere that will not screw up your
> status. In other words, you don't read your device status twice,
> once to post the writes and once to get the status because some
> hardware will detect the read and fail to give you the correct
> status on the second read. Instead, you read some 'harmless' register
> that your hardware will decode, but not muck up the status. You
> don't want to read a nonexistant register because this will cause
> a lonnnnnnng bus-timeout. It will work to flush pending writes, but
> it's slow.

Hrm, in fact that's definitely not generic ;) A nonexistant register
on some archs will send you right to Machine Check -> Ooops ;)

Also, you a read from "anywhere on PCI" won't do the trick, you have to
read from the exact same bus path, crossing the same host & P2P bridges.

The problem is more generic than just MMIO on PCI, for example, even
with IO, I don't think we can guarantee anything, IO is basically MMIO
(we have some error recovery stuff in ppc32 that might make it +/- sync,
but that's not something that I would count on). Also, the CPU itself
may well have a store queue acting as a "all busses" write posting. On
PPC (again ;) we guarantee ordering, so if you do a read next, you'll
flush previous writes to the bus, but without that read, the write might
well stay a few cycles in your CPU store queue.

Ben.
 


  reply	other threads:[~2003-01-13 21:53 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-12 18:07 Alan Cox
2003-01-12 19:29 ` Benjamin Herrenschmidt
     [not found]   ` <1042403235.16288.14.camel@irongate.swansea.linux.org.uk>
2003-01-12 19:51     ` Benjamin Herrenschmidt
2003-01-12 19:57       ` Benjamin Herrenschmidt
2003-01-12 20:51         ` Alan Cox
2003-01-13 16:56           ` Benjamin Herrenschmidt
2003-01-12 20:40       ` Alan Cox
2003-01-12 20:02         ` Benjamin Herrenschmidt
2003-01-13 18:49       ` Ross Biro
2003-01-13 19:03         ` Benjamin Herrenschmidt
2003-01-13 19:19           ` Ross Biro
2003-01-13 19:32             ` Ross Biro
2003-01-13 21:05               ` Alan Cox
2003-01-13 20:36                 ` Ross Biro
2003-01-13 19:46             ` Alan Cox
2003-01-14 17:38               ` Benjamin Herrenschmidt
2003-01-14 17:49                 ` Ross Biro
2003-01-14 17:52                   ` Benjamin Herrenschmidt
2003-01-14 21:17                     ` Andre Hedrick
2003-01-15  0:23                       ` Benjamin Herrenschmidt
2003-01-15  5:07                         ` Andre Hedrick
     [not found]                 ` <1043105473.12609.5.camel@dhcp22.swansea.linux.org.uk>
2003-01-21 17:07                   ` Benjamin Herrenschmidt
2003-01-13 20:56             ` Benjamin Herrenschmidt
2003-01-13 21:36               ` Ross Biro
2003-01-14  1:35                 ` Ross Biro
2003-01-14  1:44                   ` Andre Hedrick
2003-01-14  9:18                   ` Benjamin Herrenschmidt
2003-01-20  6:13                   ` Alan Cox
2003-01-13 19:34           ` John Alvord
2003-01-13 19:48             ` Ross Biro
2003-01-13 21:24           ` Jeff Garzik
2003-01-13 21:40             ` Richard B. Johnson
2003-01-13 22:02               ` Benjamin Herrenschmidt [this message]
2003-01-13 22:07               ` Benjamin Herrenschmidt
2003-01-14  1:20                 ` Richard B. Johnson
2003-01-14  9:06                   ` Benjamin Herrenschmidt
2003-01-14 14:04                     ` Richard B. Johnson
2003-01-14 14:35                       ` Benjamin Herrenschmidt
2003-01-21 11:15 ` Linux 2.4.21-pre3-ac4 [PATCH] Paul Gortmaker
2003-01-21 13:21   ` Hugh Dickins
2003-01-21 11:46 ` small patch for Via Pro 266T agp-support Jurriaan

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=1042495337.587.27.camel@zion.wanadoo.fr \
    --to=benh@kernel.crashing.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alan@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    --cc=rossb@google.com \
    /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®