diff options
| author | Jens Axboe <axboe@kernel.dk> | 2018-08-29 13:05:20 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2018-08-29 13:05:20 -0400 |
| commit | 52bd456a66c1abb7dd43628080025703248b1ea2 (patch) | |
| tree | ca01f0e9340a4aa0ecb52d41849a45a41d7ff346 | |
| parent | 8f3fafc9c2f0ece10832c25f7ffcb07c97a32ad4 (diff) | |
| parent | 04db0e5ec58167364a80fd33ddb4f3b67434eb85 (diff) | |
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
| -rw-r--r-- | drivers/nvme/host/pci.c | 8 | ||||
| -rw-r--r-- | drivers/nvme/target/core.c | 4 | ||||
| -rw-r--r-- | drivers/nvme/target/fcloop.c | 3 |
3 files changed, 13 insertions, 2 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 1b9951d2067e..d668682f91df 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
| @@ -316,6 +316,14 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db, | |||
| 316 | old_value = *dbbuf_db; | 316 | old_value = *dbbuf_db; |
| 317 | *dbbuf_db = value; | 317 | *dbbuf_db = value; |
| 318 | 318 | ||
| 319 | /* | ||
| 320 | * Ensure that the doorbell is updated before reading the event | ||
| 321 | * index from memory. The controller needs to provide similar | ||
| 322 | * ordering to ensure the envent index is updated before reading | ||
| 323 | * the doorbell. | ||
| 324 | */ | ||
| 325 | mb(); | ||
| 326 | |||
| 319 | if (!nvme_dbbuf_need_event(*dbbuf_ei, value, old_value)) | 327 | if (!nvme_dbbuf_need_event(*dbbuf_ei, value, old_value)) |
| 320 | return false; | 328 | return false; |
| 321 | } | 329 | } |
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index ebf3e7a6c49e..b5ec96abd048 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c | |||
| @@ -1210,7 +1210,7 @@ static int __init nvmet_init(void) | |||
| 1210 | 1210 | ||
| 1211 | error = nvmet_init_discovery(); | 1211 | error = nvmet_init_discovery(); |
| 1212 | if (error) | 1212 | if (error) |
| 1213 | goto out; | 1213 | goto out_free_work_queue; |
| 1214 | 1214 | ||
| 1215 | error = nvmet_init_configfs(); | 1215 | error = nvmet_init_configfs(); |
| 1216 | if (error) | 1216 | if (error) |
| @@ -1219,6 +1219,8 @@ static int __init nvmet_init(void) | |||
| 1219 | 1219 | ||
| 1220 | out_exit_discovery: | 1220 | out_exit_discovery: |
| 1221 | nvmet_exit_discovery(); | 1221 | nvmet_exit_discovery(); |
| 1222 | out_free_work_queue: | ||
| 1223 | destroy_workqueue(buffered_io_wq); | ||
| 1222 | out: | 1224 | out: |
| 1223 | return error; | 1225 | return error; |
| 1224 | } | 1226 | } |
diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index 34712def81b1..5251689a1d9a 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c | |||
| @@ -311,7 +311,7 @@ fcloop_tgt_lsrqst_done_work(struct work_struct *work) | |||
| 311 | struct fcloop_tport *tport = tls_req->tport; | 311 | struct fcloop_tport *tport = tls_req->tport; |
| 312 | struct nvmefc_ls_req *lsreq = tls_req->lsreq; | 312 | struct nvmefc_ls_req *lsreq = tls_req->lsreq; |
| 313 | 313 | ||
| 314 | if (tport->remoteport) | 314 | if (!tport || tport->remoteport) |
| 315 | lsreq->done(lsreq, tls_req->status); | 315 | lsreq->done(lsreq, tls_req->status); |
| 316 | } | 316 | } |
| 317 | 317 | ||
| @@ -329,6 +329,7 @@ fcloop_ls_req(struct nvme_fc_local_port *localport, | |||
| 329 | 329 | ||
| 330 | if (!rport->targetport) { | 330 | if (!rport->targetport) { |
| 331 | tls_req->status = -ECONNREFUSED; | 331 | tls_req->status = -ECONNREFUSED; |
| 332 | tls_req->tport = NULL; | ||
| 332 | schedule_work(&tls_req->work); | 333 | schedule_work(&tls_req->work); |
| 333 | return ret; | 334 | return ret; |
| 334 | } | 335 | } |
