All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: netdev@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] s2io ppc64 fix for readq/writeq
Date: Mon, 06 Nov 2006 03:21:15 -0500	[thread overview]
Message-ID: <454EF07B.4010503@pobox.com> (raw)
In-Reply-To: <1162800248.28571.296.camel@localhost.localdomain>

Benjamin Herrenschmidt wrote:
>> This seems a bit ugly.  Could you add
>>
>> 	#define readq readq
>>
>> to your platform instead?
> 
> That's ugly too imho but I suppose I can do it :-)
> 
>> I generally think it's a bug in the kernel-wide API, if use of said API 
>> requires arch-specific ifdefs.
> 
> Yes. I agree. In that specific case, I suppose what you propose is the
> least ugly of the solutions. HAVE_ARCH_* is pretty much out of fascion
> (and I tend to agree with Linus that it's not pretty anyway).
> 
> Actually, I tend to think in that specific case that the driver defining
> something called readq and writeq based on a pair of readl's and
> writel's is fairly bogus though.
> 
>> Or maybe the problem could be solved another way, by guaranteeing that a 
>> "good enough for drivers" readq() and writeq() exist on all platforms, 
>> even 32-bit platforms where the operation isn't inherently atomic.
> 
> I'd rather not provide readq/writeq if they aren't atomic.

This is why I said "good enough for drivers".  This is _key_.

I have run into several [PCI] devices with 64-bit registers, and 
__none__ of them had requirements such that the Linux platform code 
-must- provide an atomic readq/writeq.  Probably because everybody wants 
to support 32-bit platforms with their devices.

What you call "fairly bogus" is precisely what drivers need.  These 
devices with 64-bit registers just don't need the atomicity that arch 
developers harp about :)

	Jeff



  reply	other threads:[~2006-11-06  8:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06  2:28 [PATCH] s2io ppc64 fix for readq/writeq Benjamin Herrenschmidt
2006-11-06  7:50 ` Jeff Garzik
2006-11-06  8:04   ` Benjamin Herrenschmidt
2006-11-06  8:21     ` Jeff Garzik [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2006-11-06 20:33 Ramkrishna Vepa
2006-11-06 20:46 ` Christoph Hellwig
2006-11-06 20:54   ` Roland Dreier
2006-11-07  2:57 Ramkrishna Vepa

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=454EF07B.4010503@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=benh@kernel.crashing.org \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.