Skip to content

Commit 56f3961

Browse files
Matt Wangmartinkpetersen
authored andcommitted
scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic
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]>
1 parent c625b80 commit 56f3961

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
@@ -2926,11 +2926,11 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command,
29262926
ccb->opcode = BLOGIC_INITIATOR_CCB_SG;
29272927
ccb->datalen = count * sizeof(struct blogic_sg_seg);
29282928
if (blogic_multimaster_type(adapter))
2929-
ccb->data = (void *)((unsigned int) ccb->dma_handle +
2929+
ccb->data = (unsigned int) ccb->dma_handle +
29302930
((unsigned long) &ccb->sglist -
2931-
(unsigned long) ccb));
2931+
(unsigned long) ccb);
29322932
else
2933-
ccb->data = ccb->sglist;
2933+
ccb->data = virt_to_32bit_virt(ccb->sglist);
29342934

29352935
scsi_for_each_sg(command, sg, count, i) {
29362936
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
@@ -806,7 +806,7 @@ struct blogic_ccb {
806806
unsigned char cdblen; /* Byte 2 */
807807
unsigned char sense_datalen; /* Byte 3 */
808808
u32 datalen; /* Bytes 4-7 */
809-
void *data; /* Bytes 8-11 */
809+
u32 data; /* Bytes 8-11 */
810810
unsigned char:8; /* Byte 12 */
811811
unsigned char:8; /* Byte 13 */
812812
enum blogic_adapter_status adapter_status; /* Byte 14 */

0 commit comments

Comments
 (0)