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

William R Sowerbutts
2023-08-15T09:50:25Z

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

I'm not clear if pata_falcon on Atari records data on disk in normal or
swapped byte order. Can I take a drive from my Atari Falcon Linux machine
and connect it to a PC without needing to byte swap it?

I want to float some potential solutions for discussion;

* Add a kernel configuration option to choose between legacy and compatible
byte ordering on Q40 at compile time (affecting all disks)

* Add a pata_falcon driver option to choose which of the connected disks
should use legacy or compatible byte ordering at run time

* Extend pata_falcon to examine the connected disk's contents, looking for
some marker that reliably indicates a legacy byte order disk is connected.
Default to compatible byte ordering if this mark is not found. Maybe it
would be cleaner for some optional module atop the driver to do this.

* Assuming pata_legacy can be made to work well: Have pata_falcon retain
legacy byte ordering, while pata_legacy drives the same hardware in
compatible byte ordering mode. User chooses the driver to choose byte
ordering.

* Switch pata_falcon to compatible byte order, document for any legacy disk
users how they can either do a one-time migration of their data to
compatible format, or setup the block layer to do byte swapping
on-the-fly.

Thanks

Will

_________________________________________________________________________
William R Sowerbutts will@sowerbutts.com
"Carpe post meridiem" http://sowerbutts.com
main(){char*s=">#=0> ^#X@#@^7=",c=0,m;for(;c<15;c++)for
(m=-1;m<7;putchar(m++/6&c%3/2?10:s[c]-31&1<<m?42:32));}