linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH v2] Bugfix for handling of shadow doorbell buffer.
Date: Thu, 16 Aug 2018 08:15:59 -0600	[thread overview]
Message-ID: <20180816141558.GB5438@localhost.localdomain> (raw)
In-Reply-To: <20180815225157.89523-1-wnukowski@google.com>

On Wed, Aug 15, 2018@03:51:57PM -0700, Michal Wnukowski wrote:
> 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;
>  	}

Looks good to me. This should also be a stable candidate.

Reviewed-by: Keith Busch <keith.busch at intel.com>

  reply	other threads:[~2018-08-16 14:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 22:17 [PATCH] Bugfix for handling of shadow doorbell buffer Michal Wnukowski
2018-08-14 22:57 ` Keith Busch
2018-08-14 23:16   ` Linus Torvalds
2018-08-14 23:49     ` Keith Busch
2018-08-15  1:35     ` Michal Wnukowski
2018-08-15  2:02       ` Linus Torvalds
2018-08-15 22:51         ` [PATCH v2] " Michal Wnukowski
2018-08-16 14:15           ` Keith Busch [this message]
2018-08-16 21:20           ` Sagi Grimberg
2018-08-17  7:07           ` Christoph Hellwig
2018-08-20 20:09             ` Michal Wnukowski
2018-08-17  7:10       ` [PATCH] " Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180816141558.GB5438@localhost.localdomain \
    --to=keith.busch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).