Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2565005imm; Thu, 16 Aug 2018 11:34:28 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx1qj4KAcMh4C1Mf4VIceuwsBCcop+nX66i4V9oIwhXeqPvuc34T7UCuLPR80TwaJsKA/w9 X-Received: by 2002:a63:ea0c:: with SMTP id c12-v6mr30235514pgi.158.1534444468160; Thu, 16 Aug 2018 11:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534444468; cv=none; d=google.com; s=arc-20160816; b=CApEKtxXwy6xUQsl1VCcgaSBrWGeHL8ngHPtV7fJqXAushx4adv5/v8YJflAPBPXi+ /vibGCs/wj8igbGgItPil7k/L8dvVsxdNXrNmktxX16H2zyzqij3G6Fh2YCD5162FMFB DrH4PQordDLQ/AwwbJaOyIJRbIAyweijCLbZP8c2hgCPBKDbgqw5H/jzwKw+Ezy1SsUu C+L0+0DFjbHpSCr7IAlNddl8FzPvOE+LNcD08/lL2LpxxWY/c+bx+/Zi+hGE+Qa1/QNd giiCLQVZ1Z+Bmjs6Li3Tf3SNoYbqL67k2an0XO0Io6AsAtwHC9ct0QwxJ+1AklSp06Yz Iq9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=FF5QeTNdSp86prd0aTs8487BcJ97ENAquI7i/3DKI9k=; b=TfRfvS+rDgMUqhstupUm2cbA2hN4PoYjvbuS77t+FWe70IFbQEJGaW+gT2TzsF79wE 6V8OUv/Wkf5kECp3LKjFMWvK3WkfI2DHeU8nQoq2y1JVmCv/k64vJe2L+o3cLPQzPZDB +I+iyGx/t+dJg2Dnav6yLc+hhUYzOOJZAxcNHD50aROuJiC/lLNuGPQdEXUZtfahLIL/ RTt3ams7i2rUwrxUhTiX1fT6OPLm+5BZEd8tUMlABeK+oMbmyNFuSQ7u477GJYrNlvcp XdzkrMCvsK31TLsmDntnFZtv4kXWcgUS77iRmgYU5De9gEWoRZihxJ1tlb9QPTeoIrSm 3uTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11-v6si23168plc.154.2018.08.16.11.34.13; Thu, 16 Aug 2018 11:34:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391635AbeHPROF (ORCPT + 99 others); Thu, 16 Aug 2018 13:14:05 -0400 Received: from mga04.intel.com ([192.55.52.120]:28055 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbeHPROF (ORCPT ); Thu, 16 Aug 2018 13:14:05 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Aug 2018 07:15:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,247,1531810800"; d="scan'208";a="83855657" Received: from unknown (HELO localhost.localdomain) ([10.232.112.44]) by orsmga002.jf.intel.com with ESMTP; 16 Aug 2018 07:15:11 -0700 Date: Thu, 16 Aug 2018 08:15:59 -0600 From: Keith Busch To: Michal Wnukowski Cc: "torvalds@linux-foundation.org" , "axboe@fb.com" , "hch@lst.de" , "keith.busch@linux.intel.com" , "linux-kernel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "sagi@grimberg.me" , "yigitfiliz@google.com" Subject: Re: [PATCH v2] Bugfix for handling of shadow doorbell buffer. Message-ID: <20180816141558.GB5438@localhost.localdomain> References: <20180815225157.89523-1-wnukowski@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180815225157.89523-1-wnukowski@google.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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