public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
	"David S. Miller" <davem@davemloft.net>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: iomapping a big endian area
Date: Mon, 04 Apr 2005 17:49:12 +1000	[thread overview]
Message-ID: <1112600953.19004.46.camel@gaston> (raw)
In-Reply-To: <1112499639.5786.34.camel@mulgrave>

On Sat, 2005-04-02 at 21:40 -0600, James Bottomley wrote:

> Actually, ioread8be is unnecessary, but I was planning to add
> ioread16/ioread32 and iowritexx be on be variants (equivalent to
> _raw_readw et al.)
> 
> After all, the driver must know the card is BE, so the routines that
> make use of the feature are easily coded into the card, so there's no
> real need to add it to the iomem cookie.
> 
> Did anyone have a preference for the API?  I was thinking
> ioread32_native, but ioread32be is fine too.

I think we want "be" since obviously, the "ioread32" one is "le", that
makes sense to provide both and let the implementation bother with what
has to swap or not. With "native", x86 would do what ? swap or not
swap ? unclear ... with "be", at least it's clear.

The problem ? Hehe, well ... there is at least one little problem: The
way iomap "fixes" the issue of mem vs. io space in a driver could have
been used to also fix le vs. be issues. For example, an USB OHCI
controller is normally little endian. But some too-stupid-for-words HW
folks tried to be too smart on a number of embedded chips, and put a big
endian version of it. Thus the driver ends up having to support both.
Most embedded vendors just butcher the driver with #ifdef's which is
fine by me ... until you end up having _also_ a PCI bus with an
EHCI/OHCI pair on it on the same board... then you are toast.

But, I wouldn't bother too much about this case. The driver has other
issues than just IO to deal with (the DMA data structures in memory are
also endian- swapped) so I suppose the entire driver need to be somewhat
#included from a wrapper an compiled twice for different endians to get
that right...

Ben.



  parent reply	other threads:[~2005-04-04  7:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-02 20:52 [PATCH] finally fix 53c700 to use the generic iomem infrastructure James Bottomley
2005-04-03  1:37 ` iomapping a big endian area Matthew Wilcox
2005-04-03  2:38   ` David S. Miller
2005-04-03  3:10     ` Matthew Wilcox
2005-04-03  3:40       ` James Bottomley
2005-04-03  4:08         ` David S. Miller
2005-04-03  4:27           ` James Bottomley
2005-04-04  7:50             ` Benjamin Herrenschmidt
2005-04-04 13:59               ` James Bottomley
2005-04-04 14:16                 ` Christoph Hellwig
2005-04-04 14:25                   ` James Bottomley
2005-04-07 23:57                     ` Jesse Barnes
2005-04-04 14:22                 ` Randy.Dunlap
2005-04-04 23:41                   ` Benjamin Herrenschmidt
2005-04-04 23:43                 ` Benjamin Herrenschmidt
2005-04-04  7:49         ` Benjamin Herrenschmidt [this message]
2005-04-05  7:42         ` Russell King
2005-04-05 14:05           ` James Bottomley
2005-04-05 18:55             ` Russell King
2005-04-05 20:02               ` Maciej W. Rozycki
2005-04-04 21:17   ` James Bottomley
2005-04-05  7:21     ` Christoph Hellwig
2005-04-05 14:05       ` James Bottomley

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=1112600953.19004.46.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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