Skip to content

Commit 2acb022

Browse files
Matt Wanglag-google
authored andcommitted
scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic
[ Upstream commit 56f3961 ] Commit 391e2f2 ("[SCSI] BusLogic: Port driver to 64-bit") introduced a serious issue for 64-bit systems. With this commit, 64-bit kernel will enumerate 8*15 non-existing disks. This is caused by the broken CCB structure. The change from u32 data to void *data increased CCB length on 64-bit system, which introduced an extra 4 byte offset of the CDB. This leads to incorrect response to INQUIRY commands during enumeration. Fix disk enumeration failure by reverting the portion of the commit above which switched the data pointer from u32 to void. Link: https://lore.kernel.org/r/[email protected] Acked-by: Khalid Aziz <[email protected]> Signed-off-by: Matt Wang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Lee Jones <[email protected]> Change-Id: I0951615721afe96d4f1edd38d42c5e361175b961
1 parent 4d2d8da commit 2acb022

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/scsi/BusLogic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,11 +3081,11 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command,
30813081
ccb->opcode = BLOGIC_INITIATOR_CCB_SG;
30823082
ccb->datalen = count * sizeof(struct blogic_sg_seg);
30833083
if (blogic_multimaster_type(adapter))
3084-
ccb->data = (void *)((unsigned int) ccb->dma_handle +
3084+
ccb->data = (unsigned int) ccb->dma_handle +
30853085
((unsigned long) &ccb->sglist -
3086-
(unsigned long) ccb));
3086+
(unsigned long) ccb);
30873087
else
3088-
ccb->data = ccb->sglist;
3088+
ccb->data = virt_to_32bit_virt(ccb->sglist);
30893089

30903090
scsi_for_each_sg(command, sg, count, i) {
30913091
ccb->sglist[i].segbytes = sg_dma_len(sg);

drivers/scsi/BusLogic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ struct blogic_ccb {
821821
unsigned char cdblen; /* Byte 2 */
822822
unsigned char sense_datalen; /* Byte 3 */
823823
u32 datalen; /* Bytes 4-7 */
824-
void *data; /* Bytes 8-11 */
824+
u32 data; /* Bytes 8-11 */
825825
unsigned char:8; /* Byte 12 */
826826
unsigned char:8; /* Byte 13 */
827827
enum blogic_adapter_status adapter_status; /* Byte 14 */

0 commit comments

Comments
 (0)