Re: [hatari-devel] Wrong MODE SENSE data length for page code 0x3f

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]



Am 26.10.2024 um 00:04 schrieb Uwe Seimet <Uwe.Seimet@xxxxxxxxx>:

Hi,

I would like to get back to the Linux log and hdc.c. Code like

/* Limit to sane length */
if (nRetLen <= 0)
{
nRetLen = 4;
}

or

if (nRetLen <= 4)
{

will definitely cause issues with an OS that expects SCSI, especially
SCSI-2, drives. Sending a different number of bytes than the initiator
requested can easily cause issues. If 0 bytes are requested, for instance,
this means 0 bytes have to be transferred, not 4 bytes.
It looks to me as if this code tries to simulate the behavior of old drives
like SH/Megafile or SASI drives, but for Linux this will probably not work.
The bus reset you can see in the log is very likely caused by a mismatch of
the number of bytes expected/requested and the number actually returned by
Hatari.
I guess that (at least for a test) removing this code and returning the
proper number of bytes will resolve some of the Linux issues with SCSI
drives.

Best regards

Uwe


The code is correct. SCSI specification says:

„If the value specified by the Allocation Length field equals zero, the number of bytes to be transferred shall be four bytes.“

PNG image



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/