Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1323884 > unrolled thread
| Started by | Wenbo Wang <mail_weber_wang@163.com> |
|---|---|
| First post | 2016-02-02 09:40 +0100 |
| Last post | 2016-02-02 09:40 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v2] NVMe: do not touch sq door bell if nvmeq has been suspended Wenbo Wang <mail_weber_wang@163.com> - 2016-02-02 09:40 +0100
| From | Wenbo Wang <mail_weber_wang@163.com> |
|---|---|
| Date | 2016-02-02 09:40 +0100 |
| Subject | [PATCH v2] NVMe: do not touch sq door bell if nvmeq has been suspended |
| Message-ID | <qXEFc-8ft-7@gated-at.bofh.it> |
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 <mail_weber_wang@163.com>
---
drivers/nvme/host/pci.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 8b1a725..30795f6 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -678,6 +678,11 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
blk_mq_start_request(req);
spin_lock_irq(&nvmeq->q_lock);
+ if (unlikely(nvmeq->cq_vector == -1)) {
+ ret = BLK_MQ_RQ_QUEUE_BUSY;
+ spin_unlock_irq(&nvmeq->q_lock);
+ goto out;
+ }
__nvme_submit_cmd(nvmeq, &cmnd);
nvme_process_cq(nvmeq);
spin_unlock_irq(&nvmeq->q_lock);
--
1.8.3.1
Back to top | Article view | linux.kernel
csiph-web