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

Michael Schmitz
2023-08-14T21:23:17Z

Hi Richard,

thanks for chiming in!

On 15/08/23 08:19, Richard Z wrote:
>
>>>> Now the question is how data on legacy Q40 IDE disks have been stored. If
>>>> it's byte-swapped, we'd better keep that byte order in the current driver
>>>> (meaning your changes to pata_falcon_data_xfer() won't be needed, but you
>>>> would have to swap back data on your disk). If it's always been in PC
>>>> compatible byte order, all data (not just the identify data) must be swapped.
>>>>
>>>> I'd like to have Richard's opinion on this (or hear from any other former Q40
>>>> user).
>>> I have learned that the "standard" firmware for the Q40, SMSQ/E, does not
>>> byte-swap data (it also uses an obscure partition scheme and filesystem).
> It doesn't use any obscure partition scheme, just the Atari partition table. It used to require some special magic word but the kernel code and all Linux tools would work just like if it was a normal Atari partition table. I have only modified atari-fdisik to add that magic number if it wasn't there yet to make original firmware happy.
Ah, thanks for pointing that out. Should have remembered it used Atari
format partitioning.
>>> Personally, I am strongly in favour of Linux on the Q40 using standard
>>> byte-order disks that are compatible with other machines. This feels like the
>>> right thing to do and it is what I think most users would expect.
>>>
>>> Users (if there are any!) with legacy byte-swapped disks can always use the
>>> standard tools to byte swap them into the correct, compatible format.
> Most users that I know have a dual boot system so this won't work until the other available OSes are modified to support byte swapping. This would be doable but the problem is for quite some time the kernel would have to understand both variants. Think of it, if you want to boot an older kernel you don't want to byteswap your whole hard disk back and forth every time when testing an older or newer kernel. Also, I would like to see data on the speed impact of the byte swapping, making the old hardware even 5% slower isn't something I would be enthusiastic about and my guess is it would more than that.
Well, the inner loop of raw_insw() uses one movew whereas
raw_insw_swapw() uses two movew and one rolw instruction. Reading or
writing huge files that are contiguous on disk will show an impact.
Random access of small files does have higher overhead both in waiting
for disk latency and buffer cache/filesystem overhead. I'm sure it can
be measured at least for the first case.
> Other than that it would be nice to use the "normal" byte order because exchangeable devices became much more common, I do even have an SD card reader on the IDE port.

I need to get one of those for tests - I have a CF adapter (which is
basically IDE passed through to the card) but those cards are harder to
get.

I'll think about your suggestion to make the byteswap option a
per-device choice. It does make perfect sense for data exchange but this
could be handled at block device level, not driver level and I fear Jens
or whoever has to sign off on this patch will see it that way.

Cheers,

Michael

>
> Richard