linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>
To: "Linus Torvalds" <torvalds@transmeta.com>
Cc: "Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	"Andre Hedrick" <andre@linux-ide.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Jens Axboe" <axboe@suse.de>
Subject: Re: [PATCH] fix ide-iops for big endian archs
Date: Thu, 26 Sep 2002 00:44:28 +0200	[thread overview]
Message-ID: <20020925224428.5676@192.168.4.1> (raw)
In-Reply-To: <Pine.LNX.4.33.0209251120590.1817-100000@penguin.transmeta.com>

>
>On Wed, 25 Sep 2002, Benjamin Herrenschmidt wrote:
>> --- 1.1/drivers/ide/ide-iops.c	Wed Sep 11 08:54:11 2002
>> +++ edited/drivers/ide/ide-iops.c	Wed Sep 25 14:19:58 2002
>> @@ -54,12 +54,20 @@
>>  
>>  static inline void ide_insw (u32 port, void *addr, u32 count)
>>  {
>> +#ifdef __BIG_ENDIAN
>> +	insw(port, addr, count);
>> +#else	
>>  	while (count--) { *(u16 *)addr = IN_WORD(port); addr += 2; }
>> +#endif	
>
>If insw is correct on big-endian, then it sure as hell should be correct 
>on little-endian. I don't understand why we wouldn't use insw on PC's, 
>since it's smaller and much more traditional.

Well, i'm pretty sure it is, though I didn't want to post a patch
affecting what currently work, I prefer letting you or other
x86 addicts figure that out :)

In the case of ide_inswp though, there is a real problem as there
is no equivalent of the "p" functions on non-x86 anyway, and you
can't easily reproduce the "insw" semantics with {in,out}{w,l}
without adding useless double-byteswap on BE. But on the other
hand, the IDE layer doesn't use ide_inswp() callback, and the
case where "p" functions are used is currently broken on BE
as well (see ide_{input,output}_data when drive->slow is true).

I suggest that you get this patch in asap (eventually swithing
to insw unconditionally in ide_insw) so at least 2.5 works again
properly on BE, further cleanup of the iops is pending, I'm waiting
for Alan own experiments before I push again my own that remove
all "p" iops and all of the {IN,OUT}{BYTE,WORD,LONG} macros.

Ben.
 


  reply	other threads:[~2002-09-26  9:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-25 12:32 [PATCH] fix ide-iops for big endian archs Benjamin Herrenschmidt
2002-09-25 18:22 ` Linus Torvalds
2002-09-25 22:44   ` Benjamin Herrenschmidt [this message]
2002-09-26 15:11     ` Alan Cox
2002-09-26 15:16       ` Benjamin Herrenschmidt
2002-09-26 16:04       ` Benjamin Herrenschmidt
2002-09-26 15:09 ` Alan Cox
2002-09-26 15:14   ` Benjamin Herrenschmidt
2002-09-26 20:58     ` Richard Zidlicky
2002-09-26 21:03       ` Benjamin Herrenschmidt
     [not found] <mailman.1032957359.10217.linux-kernel2news@redhat.com>
2002-09-25 18:19 ` Pete Zaitcev
2002-09-25 19:57   ` David S. Miller
2002-09-25 22:49     ` Benjamin Herrenschmidt
2002-09-25 22:48   ` 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=20020925224428.5676@192.168.4.1 \
    --to=benh@kernel.crashing.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andre@linux-ide.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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).