Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
@ 2026-10-13  9:42 Imre Kaloz
  2026-10-29  1:12 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Imre Kaloz @ 2026-10-13  9:42 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: James E.J. Bottomley, Hannes Reinecke, linux-scsi, linux-kernel

The REQUEST SENSE length was taken from sg->len after the
AHC_DMA_LAST_SEG flag was or-ed in and the value converted to
little-endian, so the 8-bit field is 0x80 on big-endian hosts and the
target is asked for 128 bytes into a 32-byte buffer. Use the buffer
size, as aic79xx does. On an SGI O2 with a Fujitsu MAX3147NC, the sense
data of its CHECK CONDITIONs during probe was lost.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index b9761f9f0bbc..db330ca92767 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -1097,7 +1097,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
 				sc->byte2 = SCB_GET_LUN(scb) << 5;
 			sc->unused[0] = 0;
 			sc->unused[1] = 0;
-			sc->length = sg->len;
+			sc->length = ahc_get_sense_bufsize(ahc, scb);
 			sc->control = 0;
 
 			/*

base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
  2026-10-13  9:42 [PATCH] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Imre Kaloz
@ 2026-10-29  1:12 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2026-10-29  1:12 UTC (permalink / raw)
  To: Imre Kaloz
  Cc: Martin K. Petersen, James E.J. Bottomley, Hannes Reinecke,
	linux-scsi, linux-kernel


Imre,

> The REQUEST SENSE length was taken from sg->len after the
> AHC_DMA_LAST_SEG flag was or-ed in and the value converted to
> little-endian, so the 8-bit field is 0x80 on big-endian hosts and the
> target is asked for 128 bytes into a 32-byte buffer. Use the buffer
> size, as aic79xx does. On an SGI O2 with a Fujitsu MAX3147NC, the
> sense data of its CHECK CONDITIONs during probe was lost.

Applied to 7.4/scsi-staging, thanks!

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-29  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13  9:42 [PATCH] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Imre Kaloz
2026-10-29  1:12 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox