Skip to content

Commit 067c227

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fix from James Bottomley: "One simple driver fix for a dma overrun" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: hisi_sas: Limit max hw sectors for v3 HW
2 parents 690685f + fce54ed commit 067c227

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,6 +2782,7 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
27822782
struct hisi_hba *hisi_hba = shost_priv(shost);
27832783
struct device *dev = hisi_hba->dev;
27842784
int ret = sas_slave_configure(sdev);
2785+
unsigned int max_sectors;
27852786

27862787
if (ret)
27872788
return ret;
@@ -2799,6 +2800,12 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
27992800
}
28002801
}
28012802

2803+
/* Set according to IOMMU IOVA caching limit */
2804+
max_sectors = min_t(size_t, queue_max_hw_sectors(sdev->request_queue),
2805+
(PAGE_SIZE * 32) >> SECTOR_SHIFT);
2806+
2807+
blk_queue_max_hw_sectors(sdev->request_queue, max_sectors);
2808+
28022809
return 0;
28032810
}
28042811

0 commit comments

Comments
 (0)