All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe: do not touch sq door bell if nvmeq has been suspended
@ 2016-02-01 15:42 ` Wenbo Wang
  0 siblings, 0 replies; 36+ messages in thread
From: Wenbo Wang @ 2016-02-01 15:42 UTC (permalink / raw)
  To: axboe, keith.busch; +Cc: linux-kernel, Wenbo Wang, Wenbo Wang, linux-nvme

If __nvme_submit_cmd races with nvme_dev_disable, nvmeq
could have been suspended and dev->bar could have been
unmapped. Do not touch sq door bell in this case.

Signed-off-by: Wenbo Wang <wenbo.wang@memblaze.com>
Reviewed-by: Wenwei Tao <wenwei.tao@memblaze.com>
CC: linux-nvme@lists.infradead.org
---
 drivers/nvme/host/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 8b1a725..2288712 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -325,7 +325,8 @@ static void __nvme_submit_cmd(struct nvme_queue *nvmeq,
 
 	if (++tail == nvmeq->q_depth)
 		tail = 0;
-	writel(tail, nvmeq->q_db);
+	if (likely(nvmeq->cq_vector >= 0))
+		writel(tail, nvmeq->q_db);
 	nvmeq->sq_tail = tail;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2016-02-09 22:55 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 15:42 [PATCH] NVMe: do not touch sq door bell if nvmeq has been suspended Wenbo Wang
2016-02-01 15:42 ` Wenbo Wang
2016-02-01 15:59 ` Busch, Keith
2016-02-01 15:59   ` Busch, Keith
2016-02-01 16:17   ` Wenbo Wang
2016-02-01 16:17     ` Wenbo Wang
2016-02-01 16:54 ` Jens Axboe
2016-02-01 16:54   ` Jens Axboe
2016-02-02  7:15   ` Wenbo Wang
2016-02-02 12:41     ` Sagi Grimberg
2016-02-02 12:41       ` Sagi Grimberg
2016-02-02 14:27       ` Keith Busch
2016-02-02 14:27         ` Keith Busch
2016-02-02 14:33         ` Sagi Grimberg
2016-02-02 14:33           ` Sagi Grimberg
2016-02-02 14:46           ` Keith Busch
2016-02-02 14:46             ` Keith Busch
2016-02-02 17:20             ` Sagi Grimberg
2016-02-02 17:20               ` Sagi Grimberg
2016-02-03  0:49               ` Wenbo Wang
2016-02-02 17:25     ` Keith Busch
2016-02-02 17:25       ` Keith Busch
2016-02-03  0:19       ` Wenbo Wang
2016-02-03 14:41     ` Keith Busch
2016-02-03 14:41       ` Keith Busch
2016-02-03 16:35       ` Wenbo Wang
2016-02-03 16:38         ` Keith Busch
2016-02-03 16:38           ` Keith Busch
2016-02-06 14:32           ` Wenbo Wang
2016-02-07 13:41             ` Sagi Grimberg
2016-02-07 13:41               ` Sagi Grimberg
2016-02-08 15:01             ` Keith Busch
2016-02-08 15:01               ` Keith Busch
2016-02-09 11:22               ` Wenbo Wang
2016-02-09 22:55                 ` Keith Busch
2016-02-09 22:55                   ` Keith Busch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.