aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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,
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 }