nvme-core: Use nvme_wq to queue async events and fw activation
authorSagi Grimberg <sagi@grimberg.me>
Thu, 21 Sep 2017 14:01:36 +0000 (17:01 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Sep 2017 18:42:11 +0000 (12:42 -0600)
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

index 5589f67d2cd8ee91466ae309e97f468174fd702f..bb2aad07863736c44adbcad9f43f0efb14d17bb7 100644 (file)
@@ -2676,7 +2676,7 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
        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;
@@ -2691,7 +2691,7 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
                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);