From: Roland Dreier <rdreier@cisco.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Ramkrishna Vepa <Ramkrishna.Vepa@neterion.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Jeff Garzik <jgarzik@pobox.com>,
Linus Torvalds <torvalds@osdl.org>,
netdev@vger.kernel.org, rolandd@cisco.com
Subject: Re: [PATCH] s2io ppc64 fix for readq/writeq
Date: Mon, 06 Nov 2006 12:54:55 -0800 [thread overview]
Message-ID: <adawt68jnxc.fsf@cisco.com> (raw)
In-Reply-To: <20061106204643.GA11788@infradead.org> (Christoph Hellwig's message of "Mon, 6 Nov 2006 20:46:43 +0000")
> For consistencies sake we really want to have readq() and writeq() available
> on all platforms. I remember that some IB cards require it to actually
> be a 64bit transactions, otherwise they have to do funny workarounds.
> I think the best solution is to define ARCH_HAS_ATOMIC_READQ_WRITEQ
> and let drivers do their workarounds based on that.
>
> I've Cc'ed Roland because he should be able to explain the IB issue in
> details.
The issue I know about is drivers/infiniband/hw/mthca. The card has
64-bit "doorbell registers", and the restriction is that if you write
the doorbell write two 32-bit writes, you can't write anything else on
the same register page in between writing the two halves. Since
different CPUs might be doing stuff on the same doorbell page at the
same time, there are two things we can do:
- If writeq() exists then use that and assume it will generate only a
single bus transaction that can't let anything sneak in the
middle. (That's a fairly safe assumption because the devices being
driven are either 64-bit PCI-X or PCIe only)
- If writeq() doesn't exist, use a spinlock to protect access to each
doorbell page.
ARCH_HAS_ATOMIC_READQ_WRITEQ would be fine for that, but of course the
tricky thing is writing down the exact semantics that "HAS_ATOMIC" is
actually promising.
- R.
next prev parent reply other threads:[~2006-11-06 20:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-06 20:33 [PATCH] s2io ppc64 fix for readq/writeq Ramkrishna Vepa
2006-11-06 20:46 ` Christoph Hellwig
2006-11-06 20:54 ` Roland Dreier [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-11-07 2:57 Ramkrishna Vepa
2006-11-06 2:28 Benjamin Herrenschmidt
2006-11-06 7:50 ` Jeff Garzik
2006-11-06 8:04 ` Benjamin Herrenschmidt
2006-11-06 8:21 ` Jeff Garzik
2006-11-06 8:52 ` Benjamin Herrenschmidt
2006-11-06 9:34 ` Jeff Garzik
2006-11-07 0:17 ` Benjamin Herrenschmidt
2006-11-06 9:37 ` Linus Torvalds
2006-11-06 9:42 ` Benjamin Herrenschmidt
2006-11-06 9:50 ` Linus Torvalds
2006-11-06 9:51 ` Benjamin Herrenschmidt
2006-11-06 9:55 ` Jeff Garzik
2006-11-06 9:57 ` Benjamin Herrenschmidt
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=adawt68jnxc.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=Ramkrishna.Vepa@neterion.com \
--cc=benh@kernel.crashing.org \
--cc=hch@infradead.org \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
--cc=rolandd@cisco.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;
as well as URLs for NNTP newsgroup(s).