All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: Michal Wnukowski <wnukowski@google.com>
Cc: "torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"axboe@fb.com" <axboe@fb.com>, "hch@lst.de" <hch@lst.de>,
	"keith.busch@linux.intel.com" <keith.busch@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	"yigitfiliz@google.com" <yigitfiliz@google.com>
Subject: Re: [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 at 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@intel.com>

WARNING: multiple messages have this Message-ID (diff)
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: 24+ 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:17 ` Michal Wnukowski
2018-08-14 22:57 ` Keith Busch
2018-08-14 22:57   ` Keith Busch
2018-08-14 23:16   ` Linus Torvalds
2018-08-14 23:16     ` Linus Torvalds
2018-08-14 23:49     ` Keith Busch
2018-08-14 23:49       ` Keith Busch
2018-08-15  1:35     ` Michal Wnukowski
2018-08-15  1:35       ` Michal Wnukowski
2018-08-15  2:02       ` Linus Torvalds
2018-08-15  2:02         ` Linus Torvalds
2018-08-15 22:51         ` [PATCH v2] " Michal Wnukowski
2018-08-15 22:51           ` Michal Wnukowski
2018-08-16 14:15           ` Keith Busch [this message]
2018-08-16 14:15             ` Keith Busch
2018-08-16 21:20           ` Sagi Grimberg
2018-08-16 21:20             ` Sagi Grimberg
2018-08-17  7:07           ` Christoph Hellwig
2018-08-17  7:07             ` Christoph Hellwig
2018-08-20 20:09             ` Michal Wnukowski
2018-08-20 20:09               ` Michal Wnukowski
2018-08-17  7:10       ` [PATCH] " Christoph Hellwig
2018-08-17  7:10         ` 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 \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=keith.busch@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=torvalds@linux-foundation.org \
    --cc=wnukowski@google.com \
    --cc=yigitfiliz@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.