Re: Linux 6.4.4 on m68k - Q40 - pata_falcon causes oops at boot time

Geert Uytterhoeven
2023-08-15T10:43:04Z

Hi William,

On Tue, Aug 15, 2023 at 11:49 AM William R Sowerbutts
<will@sowerbutts.com> wrote:
> >We need to fix pata_falcon for Q40, and with data on William's disk in
> >little endian order, but data on other users' disks in big endian order, we
> >need to come up with a way to support both for now.
>
> I don't mind if you break my disk -- I can always byte-swap it if required,
> or patch my kernel to use my preferred byte ordering.
>
> Valid points have been made about needing to keep existing disks working.
>
> For the kernel driver to switch byte order after some specific version seems
> unexpected.
>
> On the other hand, having disks compatible with other systems is important,
> and as a naive new user the byte-swapped disk format was quite unexpected to
> me.
>
> It seems there are reasonable arguments for both sides.
>
> I had a cursory look through other drivers and could not find any that make
> byte ordering a user-selectable option. Is there any precedent for this? It
> would be interesting to learn how they exposed the option to the user.

IIRC, the consensus was to not add any more byteswapping _options_
to IDE drivers. Just make sure the driver returns all data in host order.
The IDE core will take care of converting the drive identification from
little to native endian when needed (see swap_buf_le16()).

Note that "data" means both the drive identification block (as read
from the drive's firmware), as user data (as stored on the platters).
Hence if the interface is byte-swapped, the driver must swap all data
read, to make sure the drive identification block is correct.

Now, if your native (non-Linux) OS byte-swapped only the drive
identification block, but not the user data, you have an incompatibility.
Solving that is meant to be handled through a byte-swapping md layer
(although I can't seem to find that anymore?).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds