public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Yasushi SHOJI <yashi@atmark-techno.com>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: readl/writel: swap or not to swap
Date: Thu, 18 Nov 2004 23:09:19 -0500	[thread overview]
Message-ID: <419D71EF.9030508@pobox.com> (raw)
In-Reply-To: <20041119014829.DEE333E6F5@dns1.atmark-techno.com>

Yasushi SHOJI wrote:
> At Sat, 13 Nov 2004 21:20:03 +0900,
> yashi wrote:
> [...]
> 
>>>Why not just use __raw_readl/__raw_writel?
>>>
>>>That's what they exist for, and they still do any IO accesses correctly, 
>>>which a direct store does not do (it would seriously break on older 
>>>alphas, for example).
>>
>>sorry for a dumb question but should readl/writel on big endian system
>>swap like ppc does?
> 
> 
> I guess everyone is busy hacking.  but can at least someone give me a
> hit?
> 
> I'm worring about this issue because I'm about to use two deferent
> linux arch on same board.  it's based on reconfigurable device so I
> can configure to have deferent cpu on it.
> 
> if you are using two deferent arch of linux, it's natual to think you
> want to share all device drivers.  but if one arch swap with readl and
> the other doesn't, I have to abstruct these low level access
> methods. (given that those to arch are same endian and connected with
> same bus and to the same devices)
> 
> is there any rule we should follow?  Is the ppc way the right
> direction to follow? I can ifdef anytime for my own use but I just
> want to know what _should_ be done.


readl()/writel() are defined as being for the PCI bus (little endian). 
As such, they should swap on big endian platforms.

	Jeff



  reply	other threads:[~2004-11-19  4:09 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200411080521.iA85LbG6025914@hera.kernel.org>
2004-11-08  5:57 ` [PATCH] fbdev: Fix IO access in rivafb Benjamin Herrenschmidt
2004-11-08  8:33   ` [Linux-fbdev-devel] " Antonino A. Daplas
2004-11-08 21:50     ` Benjamin Herrenschmidt
2004-11-08 22:18       ` Antonino A. Daplas
2004-11-08  9:06   ` Antonino A. Daplas
2004-11-08  9:55     ` Geert Uytterhoeven
2004-11-08 15:21     ` Linus Torvalds
2004-11-08 20:02       ` Antonino A. Daplas
2004-11-08 20:13         ` Linus Torvalds
2004-11-08 22:08           ` Antonino A. Daplas
2004-11-08 22:25             ` Linus Torvalds
2004-11-12 12:51               ` Guido Guenther
2004-11-12 16:01                 ` Linus Torvalds
2004-11-12 19:18                   ` Guido Guenther
2004-11-12 19:32                     ` Linus Torvalds
2004-11-13 12:57                       ` Guido Guenther
2004-11-13  1:39                     ` Benjamin Herrenschmidt
2004-11-13 11:22                       ` Guido Guenther
2004-11-13 12:00                         ` Antonino A. Daplas
2004-11-13 13:02                           ` Guido Guenther
2004-11-13 18:00                           ` Linus Torvalds
2004-11-13 21:29                             ` Antonino A. Daplas
2004-11-13 22:54                               ` Guido Guenther
2004-11-13 23:52                               ` Benjamin Herrenschmidt
2004-11-13 23:49                         ` Benjamin Herrenschmidt
2004-11-13 12:20       ` Yasushi SHOJI
2004-11-19  1:48         ` readl/writel: swap or not to swap (was: [PATCH] fbdev: Fix IO access in rivafb) Yasushi SHOJI
2004-11-19  4:09           ` Jeff Garzik [this message]
2004-11-19  7:24             ` readl/writel: swap or not to swap Yasushi SHOJI
2004-11-08 21:52     ` [Linux-fbdev-devel] Re: [PATCH] fbdev: Fix IO access in rivafb Benjamin Herrenschmidt
2004-11-08 23:07       ` Giuseppe Bilotta
2004-11-13 23:22         ` Guido Guenther

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=419D71EF.9030508@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yashi@atmark-techno.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