Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2019-09-06 08:39:12 -0700
committerLee Duncan <lduncan@suse.com>2019-09-06 08:39:23 -0700
commit959bb0a40b2ebad57da3387b49b4da81580456f0 (patch)
tree3703bd9bb5c5805ca1347c701068b579dccc2b4c
parentec1d8c0a3c98a002ca4bc3bcfdf0c94c8cf66649 (diff)
scsi: use dma_get_cache_alignment() as minimum DMA alignment
(git-fixes). suse-commit: 6c6b23418f8920d05388906fca591e6c6a571850
-rw-r--r--drivers/scsi/scsi_lib.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 74a382ec987b..1b6b4728694b 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2119,11 +2119,13 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
q->limits.cluster = 0;
/*
- * set a reasonable default alignment on word boundaries: the
- * host and device may alter it using
- * blk_queue_update_dma_alignment() later.
+ * Set a reasonable default alignment: The larger of 32-byte (dword),
+ * which is a common minimum for HBAs, and the minimum DMA alignment,
+ * which is set by the platform.
+ *
+ * Devices that require a bigger alignment can increase it later.
*/
- blk_queue_dma_alignment(q, 0x03);
+ blk_queue_dma_alignment(q, max(4, dma_get_cache_alignment()) - 1);
}
EXPORT_SYMBOL_GPL(__scsi_init_queue);