From: Sagi Grimberg <sagi@grimberg.me>
Date: Thu, 21 Sep 2017 17:01:36 +0300
Subject: nvme-core: Use nvme_wq to queue async events and fw activation
Patch-mainline: v4.14-rc3
Git-commit: 1a40d97288c6ffea9b355139e88fa62f0e5439f7
References: FATE#323952, FATE#322506
async_event_work might race as it is executed from two different
workqueues at the moment.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
drivers/nvme/host/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2684,7 +2684,7 @@ void nvme_complete_async_event(struct nv
case NVME_SC_ABORT_REQ:
++ctrl->event_limit;
if (ctrl->state == NVME_CTRL_LIVE)
- schedule_work(&ctrl->async_event_work);
+ queue_work(nvme_wq, &ctrl->async_event_work);
break;
default:
break;
@@ -2699,7 +2699,7 @@ void nvme_complete_async_event(struct nv
nvme_queue_scan(ctrl);
break;
case NVME_AER_NOTICE_FW_ACT_STARTING:
- schedule_work(&ctrl->fw_act_work);
+ queue_work(nvme_wq, &ctrl->fw_act_work);
break;
default:
dev_warn(ctrl->device, "async event result %08x\n", result);