lkml.org 
[lkml]   [2018]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] Bugfix for handling of shadow doorbell buffer.
From
Date

> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 17a0190bd88f..4452f8553301 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -306,6 +306,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 EventIdx from memory. NVMe controller should have
> + * similar ordering guarantees - update EventIdx before
> + * reading doorbell.
> + */
> + mb();
> +
> if (!nvme_dbbuf_need_event(*dbbuf_ei, value, old_value))
> return false;
> }

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

\
 
 \ /
  Last update: 2018-08-16 23:21    [W:0.196 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site