Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
nvme: set dma alignment to dword
Browse files Browse the repository at this point in the history
The nvme specification only requires qword alignment for segment
descriptors, and the driver already guarantees that. The spec has always
allowed user data to be dword aligned, which is what the queue's
attribute is for, so relax the alignment requirement to that value.

While we could allow byte alignment for some controllers when using
SGLs, we still need to support PRP, and that only allows dword.

Fixes: 3b2a1eb ("nvme: set dma alignment to qword")
Signed-off-by: Keith Busch <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
keithbusch authored and Christoph Hellwig committed May 16, 2022
1 parent 1a86924 commit 52fde2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX));
}
blk_queue_virt_boundary(q, NVME_CTRL_PAGE_SIZE - 1);
blk_queue_dma_alignment(q, 7);
blk_queue_dma_alignment(q, 3);
blk_queue_write_cache(q, vwc, vwc);
}

Expand Down

0 comments on commit 52fde2c

Please sign in to comment.