Commit 067c2273 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 690685ff fce54ed0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;
@@ -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;
}