aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorJulia Cartwright <julia@ni.com>2018-01-15 13:09:37 -0600
committerJulia Cartwright <julia@ni.com>2018-01-15 13:09:37 -0600
commit223a1a424ccc1a22fa77500bb1bced246d5dd855 (patch)
tree35a62e7275ac840c7b20faa8cc40fe9798bcc950 /drivers/scsi/scsi_lib.c
parent0c37397b6b8708f3cae24a8faeed2d1c84760892 (diff)
parent7bbc6ca4887794cc44b41412a35bdfbe0cbd1c50 (diff)
Merge tag 'v4.9.76' into v4.9-rt
This is the 4.9.76 stable release
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-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 d8099c7cab00..c7b770075caa 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2041,11 +2041,13 @@ static 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);
}
struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,