scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
Subsystems (2)
PATCH 1/1 scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
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.
--- drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aic7xxx/aic7xxx_core.c +1 -1
@@ -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
Signature · 1 line
2.47.3
Imre,
Quoted 6 lines
The REQUEST SENSE length was taken from
sg->lenafter theAHC_DMA_LAST_SEGflag was or-ed in and the value converted to little-endian, so the 8-bit field is0x80on 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!
Signature · 1 line
Martin K. Petersen
Quoted 8 lines · Imre Kaloz
The REQUEST SENSE length was taken from
sg->lenafter theAHC_DMA_LAST_SEGflag was or-ed in and the value converted to little-endian, so the 8-bit field is0x80on 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-queue, thanks!
[1/1] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
https://git.kernel.org/mkp/scsi/c/9a2690eb4bbe
Signature · 1 line
Martin K. Petersen