linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IDE janitoring comments
@ 2002-08-24 15:15 Benjamin Herrenschmidt
  2002-08-24 20:14 ` Alan Cox
  0 siblings, 1 reply; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2002-08-24 15:15 UTC (permalink / raw)
  To: Andre Hedrick, Alan Cox; +Cc: linux-kernel

A few notes taken while adapting the ide-pmac (MMIO) code
to the new layer in -ac:

 - Do we really want to keep all those _P versions around ?
A quick grep showed _only_ by the non-portable x86 specific
recovery timer stuff that taps ISA timers (well, I think ports
0x40 and 0x43 and an ISA timer). I would strongly suggest to
get rid of those functions from the hwif, and use directly
the appropriate PIO functon i that timer routine. Also make
sure that timer stuff don't get compiled on anything but
legacy harware where we know those ports mean something.

 - In ide-iops, the insw, insl, outsw, outsl functions are
broken for big endian. They should not do byteswap on these,
however, implemeting them with a loop of IN/OUT_BYTE/WORD
will cause byteswapped access on archs like PPC.
The problem is that the macros IN/OUT_BYTE/WORD don't define
non-swapping equivalents that would allow us to correctly
implement the "s" versions.

After much thinking about the above, I came to the conslusion
we probably want to just kill all the IN_BYTE, OUT_BYTE, etc...
macros and use directly inb/outb/etc... in the default PIO
ops defined in ide-iops.c. We would then use the normal arch
provided insw/insl/outsw/outsl functions here as well.

I already added a set of ops for MMIO in there using the normal
readb/writeb/... and for the "multiple" versions, I did loops
using the __raw versions (no byteswap) and a manual io_barrier().

I grep'ed in 2.4, the only archs that use custom IN/OUT_BYTE
macros for IDE are m68k and cris. I'm pretty sure m68k is wrong
and should do like PPC :) In anyway, both should be fixed the
new 'clean' way which is to define a set of access functions
to be stuffed in the HWIF structure. The goal of ide-iops is
to provide defaults for PIO (and MMIO soon as those can be made
fairly generic too).

Also, getting rid of the _P version would make things a lot
easier as well here too.

Any comments ?

Ben.



^ permalink raw reply	[flat|nested] 13+ messages in thread
* IDE janitoring comments
@ 2002-08-24 15:09 Benjamin Herrenschmidt
  2002-09-23 22:01 ` Richard Zidlicky
  0 siblings, 1 reply; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2002-08-24 15:09 UTC (permalink / raw)
  To: Andre Hedrick, Alan Cox; +Cc: linux-kernel

A few notes taken while adapting the ide-pmac (MMIO) code
to the new layer in -ac:

 - Do we really want to keep all those _P versions around ?
A quick grep showed _only_ by the non-portable x86 specific
recovery timer stuff that taps ISA timers (well, I think ports
0x40 and 0x43 and an ISA timer). I would strongly suggest to
get rid of those functions from the hwif, and use directly
the appropriate PIO functon i that timer routine. Also make
sure that timer stuff don't get compiled on anything but
legacy harware where we know those ports mean something.

 - In ide-iops, the insw, insl, outsw, outsl functions are
broken for big endian. They should not do byteswap on these,
however, implemeting them with a loop of IN/OUT_BYTE/WORD
will cause byteswapped access on archs like PPC.
The problem is that the macros IN/OUT_BYTE/WORD don't define
non-swapping equivalents that would allow us to correctly
implement the "s" versions.

After much thinking about the above, I came to the conslusion
we probably want to just kill all the IN_BYTE, OUT_BYTE, etc...
macros and use directly inb/outb/etc... in the default PIO
ops defined in ide-iops.c. We would then use the normal arch
provided insw/insl/outsw/outsl functions here as well.

I already added a set of ops for MMIO in there using the normal
readb/writeb/... and for the "multiple" versions, I did loops
using the __raw versions (no byteswap) and a manual io_barrier().

I grep'ed in 2.4, the only archs that use custom IN/OUT_BYTE
macros for IDE are m68k and cris. I'm pretty sure m68k is wrong
and should do like PPC :) In anyway, both should be fixed the
new 'clean' way which is to define a set of access functions
to be stuffed in the HWIF structure. The goal of ide-iops is
to provide defaults for PIO (and MMIO soon as those can be made
fairly generic too).

Also, getting rid of the _P version would make things a lot
easier as well here too.

Any comments ?

Ben.



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-09-25  3:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-24 15:15 IDE janitoring comments Benjamin Herrenschmidt
2002-08-24 20:14 ` Alan Cox
2002-08-24 21:01   ` Andre Hedrick
2002-08-24 22:28   ` Benjamin Herrenschmidt
2002-08-24 20:56     ` Andre Hedrick
  -- strict thread matches above, loose matches on Subject: below --
2002-08-24 15:09 Benjamin Herrenschmidt
2002-09-23 22:01 ` Richard Zidlicky
2002-09-23  7:29   ` Benjamin Herrenschmidt
2002-09-24  0:28   ` Andre Hedrick
2002-09-24  9:27     ` Richard Zidlicky
2002-09-24 11:35       ` Benjamin Herrenschmidt
2002-09-24 12:41         ` Benjamin Herrenschmidt
2002-09-25  3:57       ` Andre Hedrick

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).