Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1954927AbdDYVvU (ORCPT ); Tue, 25 Apr 2017 17:51:20 -0400 Received: from g2t2353.austin.hpe.com ([15.233.44.26]:30197 "EHLO g2t2353.austin.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1952322AbdDYVvN (ORCPT ); Tue, 25 Apr 2017 17:51:13 -0400 From: "Kani, Toshimitsu" To: "vishal.l.verma@intel.com" CC: "dan.j.williams@intel.com" , "linux-kernel@vger.kernel.org" , "dave.jiang@intel.com" , "linux-nvdimm@lists.01.org" Subject: Re: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Thread-Topic: [PATCH] libnvdimm: fix phys_addr for nvdimm_clear_poison Thread-Index: AQHSvgllyy/bJS1QM0+dvaerPKR3/6HWniAAgAABYQA= Date: Tue, 25 Apr 2017 21:49:50 +0000 Message-ID: <1493156958.26622.8.camel@hpe.com> References: <20170425211651.7640-1-toshi.kani@hpe.com> <20170425214422.GB15722@omniknight.lm.intel.com> In-Reply-To: <20170425214422.GB15722@omniknight.lm.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=hpe.com; x-originating-ip: [15.219.163.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AT5PR84MB0257;7:6O4TUXWm9J2NNbRGYAeH8o6F0fqHGJV4gFPGH4CfZTtZoucMZUqGIPhJB4Q2eUxB1p2IypPQ/nZA/vONpnkNlaC/tLSC4WH8mA2rkJORPXuXxQXRf19Q12eKBKMN3Sh8wmq9I8R81IArISdg7kksI6G7oDhnpU36IDpUVLNuBGh0M4/IiJYKep1b66EzrSHlBC4iGdeMltEFoD/vNKdXUI9roVxozkpAp2ElG2/u4Zf0bjgihTcmGn7GvDTrKnWHWRMsgGdGmKLuPiD3LJlDMU6gN1otTGmQCjqjZV9/CGRISRHA0TVvTIUV0rKfqQlW5p/23fSsv9nmjilcIJZyCQ== x-ms-office365-filtering-correlation-id: e7201d99-a750-4ce3-15a4-08d48c250024 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075);SRVR:AT5PR84MB0257; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(6072148);SRVR:AT5PR84MB0257;BCL:0;PCL:0;RULEID:;SRVR:AT5PR84MB0257; x-forefront-prvs: 0288CD37D9 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39840400002)(39860400002)(39410400002)(39850400002)(39400400002)(39450400003)(377424004)(24454002)(102836003)(2351001)(5660300001)(6116002)(3846002)(229853002)(3660700001)(122556002)(4326008)(25786009)(3280700002)(36756003)(86362001)(6916009)(2950100002)(5640700003)(6486002)(77096006)(8936002)(6506006)(54906002)(38730400002)(110136004)(81166006)(6436002)(8676002)(6246003)(7736002)(6512007)(2906002)(189998001)(53936002)(50986999)(76176999)(103116003)(66066001)(33646002)(2900100001)(54356999)(305945005);DIR:OUT;SFP:1102;SCL:1;SRVR:AT5PR84MB0257;H:AT5PR84MB0260.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <1365CE7062905441BACC7666CC2782B2@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2017 21:49:50.5862 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR84MB0257 X-OriginatorOrg: hpe.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v3PLpQ77013121 Content-Length: 1335 Lines: 46 On Tue, 2017-04-25 at 15:44 -0600, Vishal Verma wrote: > 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 ? nsio->addr is a virtual address. We need to pass the physical address of this range. Thanks, -Toshi > > >   if (cleared < size) > >   rc = -EIO; > >   if (cleared > 0 && cleared / 512) {