Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946687AbdDYVpy (ORCPT ); Tue, 25 Apr 2017 17:45:54 -0400 Received: from mga14.intel.com ([192.55.52.115]:14060 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946456AbdDYVpo (ORCPT ); Tue, 25 Apr 2017 17:45:44 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,251,1488873600"; d="scan'208";a="80810658" Date: Tue, 25 Apr 2017 15:44:22 -0600 From: Vishal Verma To: Toshi Kani Cc: dan.j.williams@intel.com, dave.jiang@intel.com, linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Message-ID: <20170425214422.GB15722@omniknight.lm.intel.com> References: <20170425211651.7640-1-toshi.kani@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170425211651.7640-1-toshi.kani@hpe.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 33 On 04/25, Toshi Kani wrote: > nvdimm_clear_poison() expects a physical address, not an offset. > Fix nsio_rw_bytes() to call nvdimm_clear_poison() with a physical > address. Good catch! > > Signed-off-by: Toshi Kani > Cc: Dan Williams > Cc: Dave Jiang > Cc: Vishal Verma > --- > drivers/nvdimm/claim.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c > index ca6d572..0b31073 100644 > --- a/drivers/nvdimm/claim.c > +++ b/drivers/nvdimm/claim.c > @@ -254,7 +254,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, > && (!ndns->claim || !is_nd_btt(ndns->claim))) { > long cleared; > > - cleared = nvdimm_clear_poison(&ndns->dev, offset, size); > + cleared = nvdimm_clear_poison(&ndns->dev, > + nsio->res.start + offset, size); Should we be using nsio->res.start here or nsio->addr ? > if (cleared < size) > rc = -EIO; > if (cleared > 0 && cleared / 512) {