Commit 52bd456a authored by Jens Axboe's avatar Jens Axboe

Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus

Pull NVMe fixes from Christoph.

* 'nvme-4.19' of git://git.infradead.org/nvme:
  nvmet: free workqueue object if module init fails
  nvme-fcloop: Fix dropped LS's to removed target port
  nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event
parents 8f3fafc9 04db0e5e
...@@ -316,6 +316,14 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db, ...@@ -316,6 +316,14 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db,
old_value = *dbbuf_db; old_value = *dbbuf_db;
*dbbuf_db = value; *dbbuf_db = value;
/*
* Ensure that the doorbell is updated before reading the event
* index from memory. The controller needs to provide similar
* ordering to ensure the envent index is updated before reading
* the doorbell.
*/
mb();
if (!nvme_dbbuf_need_event(*dbbuf_ei, value, old_value)) if (!nvme_dbbuf_need_event(*dbbuf_ei, value, old_value))
return false; return false;
} }
......
...@@ -1210,7 +1210,7 @@ static int __init nvmet_init(void) ...@@ -1210,7 +1210,7 @@ static int __init nvmet_init(void)
error = nvmet_init_discovery(); error = nvmet_init_discovery();
if (error) if (error)
goto out; goto out_free_work_queue;
error = nvmet_init_configfs(); error = nvmet_init_configfs();
if (error) if (error)
...@@ -1219,6 +1219,8 @@ static int __init nvmet_init(void) ...@@ -1219,6 +1219,8 @@ static int __init nvmet_init(void)
out_exit_discovery: out_exit_discovery:
nvmet_exit_discovery(); nvmet_exit_discovery();
out_free_work_queue:
destroy_workqueue(buffered_io_wq);
out: out:
return error; return error;
} }
......
...@@ -311,7 +311,7 @@ fcloop_tgt_lsrqst_done_work(struct work_struct *work) ...@@ -311,7 +311,7 @@ fcloop_tgt_lsrqst_done_work(struct work_struct *work)
struct fcloop_tport *tport = tls_req->tport; struct fcloop_tport *tport = tls_req->tport;
struct nvmefc_ls_req *lsreq = tls_req->lsreq; struct nvmefc_ls_req *lsreq = tls_req->lsreq;
if (tport->remoteport) if (!tport || tport->remoteport)
lsreq->done(lsreq, tls_req->status); lsreq->done(lsreq, tls_req->status);
} }
...@@ -329,6 +329,7 @@ fcloop_ls_req(struct nvme_fc_local_port *localport, ...@@ -329,6 +329,7 @@ fcloop_ls_req(struct nvme_fc_local_port *localport,
if (!rport->targetport) { if (!rport->targetport) {
tls_req->status = -ECONNREFUSED; tls_req->status = -ECONNREFUSED;
tls_req->tport = NULL;
schedule_work(&tls_req->work); schedule_work(&tls_req->work);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment