Skip to content

Commit

Permalink
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/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
  • Loading branch information
Linus Torvalds committed Jul 1, 2022
2 parents 690685f + fce54ed commit 067c227
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2782,6 +2782,7 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
struct hisi_hba *hisi_hba = shost_priv(shost);
struct device *dev = hisi_hba->dev;
int ret = sas_slave_configure(sdev);
unsigned int max_sectors;

if (ret)
return ret;
Expand All @@ -2799,6 +2800,12 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
}
}

/* Set according to IOMMU IOVA caching limit */
max_sectors = min_t(size_t, queue_max_hw_sectors(sdev->request_queue),
(PAGE_SIZE * 32) >> SECTOR_SHIFT);

blk_queue_max_hw_sectors(sdev->request_queue, max_sectors);

return 0;
}

Expand Down

0 comments on commit 067c227

Please sign in to comment.