From: Jeff Garzik <jeff@garzik.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: ggrundstrom@neteffect.com, rdreier@cisco.com,
ewg@lists.openfabrics.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/14] nes: device structures and defines
Date: Wed, 08 Aug 2007 12:19:09 -0400 [thread overview]
Message-ID: <46B9ECFD.1070700@garzik.org> (raw)
In-Reply-To: <p73hcnarykt.fsf@bingen.suse.de>
Andi Kleen wrote:
> Jeff Garzik <jeff@garzik.org> writes:
>>> + val, reg_index, addr, addr+4); */
>>> + writel(cpu_to_le32(reg_index), addr);
>>> + writel(cpu_to_le32(val),(u8 *)addr + 4);
>> wrong -- endian conversion macros not needed with writel()
>
> Are you sure?
Yes.
read[bwl] and write[bwl] are always defined in terms of the
little-endian PCI bus. This has been true since my first days in the
kernel ages (decade+) ago, when we had a long discussion about it with
regards to framebuffer drivers.
If you want to skip barriers and endian conversions, __raw_write[bwl]()
exists.
The rare exceptions are a few embedded arches that implemented writel()
for a non-PCI bus. Those cases need to be renamed to mybus_writel(),
but at least they do not interfere with mainstream drivers and APIs.
> I don't think that's true. e.g. powerpc writel
> doesn't convert endian
Incorrect -- read the code. PPC most certainly does convert endian.
Ten years ago Linus said something along the lines of "writel() means
PCI means little endian. period." ;-)
Jeff
next prev parent reply other threads:[~2007-08-08 16:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 0:45 [PATCH 2/14] nes: device structures and defines ggrundstrom
2007-08-08 1:13 ` Jeff Garzik
2007-08-08 12:38 ` Andi Kleen
2007-08-08 11:50 ` Michael Buesch
2007-08-08 12:55 ` Andi Kleen
2007-08-08 13:02 ` Michael Buesch
2007-08-08 13:08 ` Andi Kleen
2007-08-08 13:28 ` Michael Buesch
2007-08-08 13:38 ` Andi Kleen
2007-08-08 13:48 ` Michael Buesch
2007-08-08 13:55 ` Michael Buesch
2007-08-08 16:18 ` Roland Dreier
2007-08-08 16:25 ` Jeff Garzik
2007-08-08 16:30 ` Michael Buesch
2007-08-08 16:33 ` Jeff Garzik
2007-08-08 16:43 ` Michael Buesch
2007-08-08 16:46 ` Roland Dreier
2007-08-08 16:57 ` akepner
2007-08-08 16:59 ` Jeff Garzik
2007-08-08 17:34 ` Michael Buesch
2007-08-08 19:40 ` Jeff Garzik
2007-08-08 16:39 ` Roland Dreier
2007-08-08 16:19 ` Jeff Garzik [this message]
2007-08-08 22:04 ` David Miller
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=46B9ECFD.1070700@garzik.org \
--to=jeff@garzik.org \
--cc=andi@firstfloor.org \
--cc=ewg@lists.openfabrics.org \
--cc=ggrundstrom@neteffect.com \
--cc=netdev@vger.kernel.org \
--cc=rdreier@cisco.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;
as well as URLs for NNTP newsgroup(s).