From 50dcf6eab7ce62c2800d62285d367925096168ef Mon Sep 17 00:00:00 2001 From: Mauricio Faria de Oliveira Date: Fri, 8 Jul 2016 09:27:07 -0300 Subject: [PATCH 3/3] nvme: use the DMA_ATTR_NO_WARN attribute Use the DMA_ATTR_NO_WARN attribute for the dma_map_sg() call of the nvme driver that returns BLK_MQ_RQ_QUEUE_BUSY (not for BLK_MQ_RQ_QUEUE_ERROR). Signed-off-by: Mauricio Faria de Oliveira Reviewed-by: Gabriel Krisman Bertazi --- drivers/nvme/host/pci.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 6ea7430b8e25..5aa25a3f1be3 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,8 @@ MODULE_PARM_DESC(use_cmb_sqes, "use controller's memory buffer for I/O SQes"); static struct workqueue_struct *nvme_workq; +static DEFINE_DMA_ATTRS(nvme_dma_attrs); + struct nvme_dev; struct nvme_queue; @@ -630,7 +633,8 @@ static int nvme_map_data(struct nvme_dev *dev, struct request *req, goto out; ret = BLK_MQ_RQ_QUEUE_BUSY; - if (!dma_map_sg(dev->dev, iod->sg, iod->nents, dma_dir)) + if (!dma_map_sg_attrs(dev->dev, iod->sg, iod->nents, dma_dir, + &nvme_dma_attrs)) goto out; if (!nvme_setup_prps(dev, req, blk_rq_bytes(req))) @@ -2395,6 +2399,9 @@ static int __init nvme_init(void) result = pci_register_driver(&nvme_driver); if (result) goto core_exit; + + dma_set_attr(DMA_ATTR_NO_WARN, &nvme_dma_attrs); + return 0; core_exit: -- 1.8.3.1