Re: [hatari-devel] Wrong MODE SENSE data length for page code 0x3f |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Wrong MODE SENSE data length for page code 0x3f
- From: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Fri, 25 Oct 2024 23:13:07 +0200
- Arc-authentication-results: i=1; strato.com; arc=none; dkim=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1729890800; s=strato-dkim-0002; d=strato.com; h=In-Reply-To:References:Message-ID:Subject:To:From:Date:Cc:Date:From: Subject:Sender; bh=DsFWa1MDeN+Tb5Pme55t0S4i3/qmlqlREF+68HvvsRY=; b=XUOsAP0CGLlH+muMvweQGGKmgRhHJs0ATSOti9BNT61xlbFmJPGl53dqqgEmzCBgAO 3jwYc9G/wKdOF5+z21s2vMGyzIgXvKiFY8gjjmM9v37Bhcx7uvfuJjpgRsVXS927p+nh 1w4mc1XXx+PF+YXg0UJKesZ0ycUI6Kh7nQ6o93gr5muJsqvm9DzH3v88QQc0RHTIMckO 2KcpVyGaued1hn7dIfT8V6XdfotOcPm3oN7Z13ylzjxyavM1qi13KDyLy3MqqyyRQKs9 XDjvYeA1wqXPXq+YiaAr0RfsVrhSCWr2lKt+65xUUGnTPUOGqsAoSP6ewpYs960ZaVGA uSHw==
- Arc-seal: i=1; a=rsa-sha256; t=1729890800; cv=none; d=strato.com; s=strato-dkim-0002; b=hFS5EXn6ACi6vFqsHP+UrQS1d4ltUeewkocff3LnVtomEVZXJUeUh3IA1k6yGCtqjC ablikUN1pwUyw77dRw1RaxgzZsh7+0CO7bLSjOznPsaBI4L7+yCUeuWEHxy8G0Sty197 UzpPKvd1BlrzTh+nqIgy5QLQhaOlPRCMSbWuCwgqg7ZiLAYsutUOoe0B8h8heGUKbjdU dFKBKlpmowQKLd3R63wsl+kDbPfO83g052W82wLqbivRkG0dN/Q2EAYPAEF+07el52GP m3G2GPXFuLgR24C/l1xl0EP2fr+aQj2qhm7dSzPf/bq2DNtB022pt99vP9yYFV7DhEQ3 965g==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1729890800; s=strato-dkim-0002; d=seimet.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date:Cc:Date:From: Subject:Sender; bh=DsFWa1MDeN+Tb5Pme55t0S4i3/qmlqlREF+68HvvsRY=; b=ZP8ox5Ae7qGSOgXT+VplImgFQ9BZQcH8PQGLb100yM3LJdOgbkKsmHF6nZPkDwmoxR XDGsEt7ZH93iP8k0fv5u7ckQMCTFPwUgiFelX4Lt9K4VJ4b6awfsClAkTmkamrrqpI/w dIftE7XwG3znPaawFAJQmcWgAdRIvn+xWiccILXeJKEY+G5lVOef/yPlkr24sqc1ydLc 3OMQmeeuFE/UJ29/3HSKCFiE3iLVflGBH9KaykgowR35MWsCB6E9hrhgk69PBPEThya7 GHNAa0w5mhIBSV3oCNT2KAaybJabECgq6rnsE6W+7PIPfOPur7btebN9WXTlAIAWfUB4 uuog==
- Dkim-signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1729890800; s=strato-dkim-0003; d=seimet.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date:Cc:Date:From: Subject:Sender; bh=DsFWa1MDeN+Tb5Pme55t0S4i3/qmlqlREF+68HvvsRY=; b=YERlIt+Tcq/NQQdhYYTjIDYzp3YMb+OG2K7LvjdMifPNSOVdEMd8foqP0+6dGEtMV3 amafdlp1u0xUCKJ7cGAQ==
Hi Eero,
> Thanks, I applied & pushed your patches.
Thank you.
> 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)
> ------------------------------------------
That's strange, isn't it? The command sent has not changed, and
ctrl->command[3] is always 0, i.e. the subpage change does not make a
difference. Only the number of bytes returned has changed. Why is
"Unsupported MODE SENSE command" before my changes and not anymore after my
changes? Nothing has changed with the actual pages supported by Hatari.
> 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
> ------------------------------------------
Well, Hatari does not support page 8, does it? It only supports pages 0 and
4. Adding more should not be a big issue, though. On the other hand,
unsupported mode pages are not necessarily a problem. Not all devices have
to support all mode pages. The SCSI specifications list the meaning of the
mode pages and their fields in detail.
> 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?
No, the test suite does not report any issues. You can run it yourself.
Like a lot of my software it is open source, and the binaries can be
downloaded on https://www.hddriver.net/en/scsidriver.html.
As far as I can see Hatari complains because more than 22 bytes were
requested by Linux. But there is no reason to complain. The initiator can
request any number of bytes, 96 (0x60) in this case. This number is just the
maximum number of bytes the target may return, and usually is related to the
size of the buffer the initiator has reserved for the result data. If there
are less bytes available the target just returns less, that's it. This is no
error condition.
Therefore I don't think that Hatari should log anything like this. Hatari
should also not log something when the length is < 4. The initiator can
request any length, even 0. Hatari just has to ensure that not more bytes
are returned than the initiator is expecting.
I recommend changing the code accordingly. Currently it looks to me as if
Hatari is logging errors/warnings where nothing is wrong.
>
> 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.
I see, I will try to remember this.
Best regards
Uwe