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

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


Hi Uwe,

Thanks, I applied & pushed your patches.

They seem to change Linux SCSI boot messages from:
------------------------------------------
DEBUG: raw_scsi_put_data got message c0 (1/1)
DEBUG: raw_scsi_put_data got message c0 (1 bytes)
DEBUG: raw_scsi: got command byte 1a (1/6)
DEBUG: raw_scsi: got command byte 00 (2/6)
DEBUG: raw_scsi: got command byte 3f (3/6)
DEBUG: raw_scsi: got command byte 00 (4/6)
DEBUG: raw_scsi: got command byte 04 (5/6)
DEBUG: raw_scsi: got command byte 00 (6/6)
TODO : HDC: Unsupported MODE SENSE command
DEBUG: raw_scsi: no data, status = 2
DEBUG: raw_scsi: status byte read 02. Next=1
DEBUG: raw_scsi: message byte read 00. Next=1
DEBUG: raw_scsi: arbitration initiator id 7 (80)
------------------------------------------

To:
------------------------------------------
DEBUG: raw_scsi_put_data got message c0 (1/1)
DEBUG: raw_scsi_put_data got message c0 (1 bytes)
DEBUG: raw_scsi: got command byte 1a (1/6)
DEBUG: raw_scsi: got command byte 00 (2/6)
DEBUG: raw_scsi: got command byte 3f (3/6)
DEBUG: raw_scsi: got command byte 00 (4/6)
DEBUG: raw_scsi: got command byte 04 (5/6)
DEBUG: raw_scsi: got command byte 00 (6/6)
DEBUG: raw_scsi: data in 44 bytes waiting
DEBUG: raw_scsi: data in finished, 44 bytes: status phase
DEBUG: raw_scsi: status byte read 00. Next=1
DEBUG: raw_scsi: message byte read 00. Next=1
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 2b 00 00 00
DEBUG: raw_scsi: arbitration initiator id 7 (80)
------------------------------------------


But it just means there's then next unrecognized one:
------------------------------------------
DEBUG: raw_scsi_put_data got message c0 (1/1)
DEBUG: raw_scsi_put_data got message c0 (1 bytes)
DEBUG: raw_scsi: got command byte 1a (1/6)
DEBUG: raw_scsi: got command byte 00 (2/6)
DEBUG: raw_scsi: got command byte 08 (3/6)
DEBUG: raw_scsi: got command byte 00 (4/6)
DEBUG: raw_scsi: got command byte 04 (5/6)
DEBUG: raw_scsi: got command byte 00 (6/6)
TODO : HDC: Unsupported MODE SENSE mode page
------------------------------------------

And it still fails to same one:
------------------------------------------
DEBUG: raw_scsi_put_data got message 80 (1/1)
DEBUG: raw_scsi_put_data got message 80 (1 bytes)
DEBUG: raw_scsi: got command byte 03 (1/6)
DEBUG: raw_scsi: got command byte 00 (2/6)
DEBUG: raw_scsi: got command byte 00 (3/6)
DEBUG: raw_scsi: got command byte 00 (4/6)
DEBUG: raw_scsi: got command byte 60 (5/6)
DEBUG: raw_scsi: got command byte 00 (6/6)
WARN : HDC: *** Strange REQUEST SENSE ***!
DEBUG: raw_scsi: data in 22 bytes waiting
DEBUG: raw_scsi: data in finished, 22 bytes: status phase
DEBUG: DMA initiator recv PC=001c40ee
DEBUG: SCSI BUS reset
sd 0:0:0:0: Device offlined - not ready after error recovery
------------------------------------------


Are above anything that shows in the SCSI test suite?


	- Eero

PS. Please provide patches in "git format-patch origin/master" format.
I had to copy paste your name and comments from mails to the commits.


On 25.10.2024 22.37, Uwe Seimet wrote:
Hello,

I noticed that the mode data length field when all pages are returned (page
code 0x3f) is wrong. Instead of 44 it has to be 43. The SPC-5 specification
says: "The mode data length field indicates the number of bytes that follow
in the mode parameter list". "Follow" is the important word here, because
usually fields that contain a byte count do not count themselves.
You also see that something is wrong with the current length field when
running the SCSI Driver test suite. Without the attached patch it says:

        Page 0 (current, not savable)

     Reading all mode pages with MODE SENSE (10)
       MODE SENSE (10) is not supported by device

The empty line indicates that something is wrong. With the attached patch it
says:

         Page 0 (current, not savable)
           0e:00:08:00:00:00:08:00:00:02:00:00:00:00:00
     Reading all mode pages with MODE SENSE (10)
       MODE SENSE (10) is not supported by device

0e:00:08:00:00:00:08:00:00:02:00:00:00:00:00 matches the page 0 data
returned by Hatari.
These data are not really correct, by the way, because they return a
hard-coded sector size of 512 bytes even when a different physical sector
size is configured. But as long as this page is only there to please HDX it
does not matter.

Best regards

Uwe



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