Some controllers advertise DWORD alignment for SGLs, so configure the virtual boundary correctly for those devices. Signed-off-by: Max Gurtovoy --- drivers/nvme/host/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index e5ca8301bb8b..eacc89cd25eb 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3326,7 +3326,9 @@ static unsigned long nvme_pci_get_virt_boundary(struct nvme_ctrl *ctrl, { if (!nvme_ctrl_sgl_supported(ctrl) || is_admin) return NVME_CTRL_PAGE_SIZE - 1; - return 0; + else if (ctrl->sgls & NVME_CTRL_SGLS_BYTE_ALIGNED) + return 0; + return 3; } static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = { -- 2.43.5