summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-08-29 11:05:20 -0600
committerJens Axboe <axboe@kernel.dk>2018-08-29 11:05:20 -0600
commit52bd456a66c1abb7dd43628080025703248b1ea2 (patch)
treeca01f0e9340a4aa0ecb52d41849a45a41d7ff346 /drivers/nvme/host/pci.c
parent8f3fafc9c2f0ece10832c25f7ffcb07c97a32ad4 (diff)
parent04db0e5ec58167364a80fd33ddb4f3b67434eb85 (diff)
Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linusfor-linus-20180830
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
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r--drivers/nvme/host/pci.c8
1 files changed, 8 insertions, 0 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,
old_value = *dbbuf_db;
*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))
return false;
}