[hatari-devel] Fix for NF SCSI Driver |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] Fix for NF SCSI Driver
- From: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Sat, 31 Aug 2024 12:13:16 +0200
- Arc-authentication-results: i=1; strato.com; arc=none; dkim=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1725099202; s=strato-dkim-0002; d=strato.com; h=Message-ID:Subject:To:From:Date:Cc:Date:From:Subject:Sender; bh=zXchSBqkFroAzfZN3EnHXrEIppeI//m07pnwPiHUJEQ=; b=HAJdoGAzqC/XPPcxFkyomhymfw8KZnrBCfRV0Sxk1Zfozv7XUgNl+ck3YIXSuHW9jM leiIBIR2XkcgUPU+nuize6h3P9bWLE/1GPqap0qiBdpvE5oc6KpQO50fEdo+Gtd70846 Yw+kX0mA5Wr35ca7WYHb9I61C+H3nTyJ5KIxiD3p/wIStEGV9+nbPGjgy/+I+WBddhRS RWSLY38MZ9BxqwqlzR2DMbsfFtUGtZARYcwW+YawzQ8X7l3oY2rf6cx0xJEG4hSR48v/ s3uLPgg2RecMTJJ4bEK6OhTxRv9ViBz46bC9EcukO2EP3qzsfHBgi5Xfq4Zn4MBczfaR wmaw==
- Arc-seal: i=1; a=rsa-sha256; t=1725099202; cv=none; d=strato.com; s=strato-dkim-0002; b=dyewJdll6CdYYh8aILVO3qnqhoF80tkW6JBLRYzPCOVY0g5vJfRxVdLchHUEgYZAqM X8RyuHouDKQpBpRAaiHQ7TjtO/VH9SFzj+kR833dYkk9iMBlEZE92/Mtfli6MNx0ha83 L9NdFqpx/3lrUN1exU5cqJledYUTyOMI/KE4F7GrxpPmWkApK8Qf5H4LGZ8mJoWtiP0W uSYJD4UgeOyyjNoL1tPUQDPXD/SkOo+g1bvVwdeNRi8STbP2wY1Pe2RtTj5d1Q50i5eA bbsYnZW9kq1pKaLw1l1nhO2WHuRRY9rl6BLNehIKXp9hBIT0+Z5Ah+ALwjFXVMewfKmr ZpeQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1725099202; s=strato-dkim-0002; d=seimet.de; h=Message-ID:Subject:To:From:Date:Cc:Date:From:Subject:Sender; bh=zXchSBqkFroAzfZN3EnHXrEIppeI//m07pnwPiHUJEQ=; b=MJ/F2yXpOFAPkkw6miSHRtmgQ8nb4lMrVa3TPFEgshKVvUbqSlVHgRGpqZXBoh1gJ6 NToyOF+1+wrMmWoORx1ruzGeXAAF7iGDd4RVJafAK3KGYslFn122dgMZ8nQNZjmRKkIR CAYZSYnaEObWLQP3qD/sjjJl1ZPwAnyc4Y06hlw8kSwqCfknekzWlQBwWxBR80u2MU25 YCbQ34NRqhZx/cpavIpKFF0HvlrBeaRIE4I3j7YkHbC10u0/8XmJL+KMIcNlKYu5i8P8 FoB0g/94DChIMpI/mue0fVD1ZwpU95JBVt5ic5Y5u3flKYj72cmTiWK/QMRqenRG8St9 WfiQ==
- Dkim-signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1725099202; s=strato-dkim-0003; d=seimet.de; h=Message-ID:Subject:To:From:Date:Cc:Date:From:Subject:Sender; bh=zXchSBqkFroAzfZN3EnHXrEIppeI//m07pnwPiHUJEQ=; b=FwgLkwchM4SVfdff7+VILp4rYoQGh+ExoK2boRR+tLnIp49Nn8inUAPBBTPc1jAtQu jTP6YyZc0rBGHF0qW8Dw==
Hello,
The attached patch fixes a SCSI Driver issue with recent Linux SG driver
implementations. The SG driver's error handling has changed, and it is
required to (also) check the sense data when ioctl reports no issue.
I stumbled upon this when I noticed that for my USB floppy the SCSI Driver
did not report errors anymore.
@Thomas Can you please also add this small change to Aranym? Thank you!
Best regards
Uwe
diff --git a/src/nf_scsidrv.c b/src/nf_scsidrv.c
index 110264a7..f4be29bf 100644
--- a/src/nf_scsidrv.c
+++ b/src/nf_scsidrv.c
@@ -407,6 +407,10 @@ static int scsidrv_inout(uint32_t stack)
status = ioctl(handle_meta_data[handle].fd,
SG_IO, &io_hdr) < 0 ? -1 : io_hdr.status;
+ if (!status && sense_buffer && sense_buffer[2] & 0x0f)
+ {
+ status = sense_buffer[2] & 0x0f;
+ }
}
if (status > 0 && sense_buffer)