From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932776AbcFGSpq (ORCPT ); Tue, 7 Jun 2016 14:45:46 -0400 Received: from mail-bl2on0139.outbound.protection.outlook.com ([65.55.169.139]:1211 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932119AbcFGSpo (ORCPT ); Tue, 7 Jun 2016 14:45:44 -0400 From: "Kani, Toshimitsu" To: "dan.j.williams@intel.com" , "linux-nvdimm@lists.01.org" CC: "hch@lst.de" , "linux-kernel@vger.kernel.org" , "david@fromorbit.com" Subject: Re: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm driver Thread-Topic: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm driver Thread-Index: AQHRvqM1zsBSEZfSCEy9kw3qYCIeLZ/eT/mA Date: Tue, 7 Jun 2016 18:11:31 +0000 Message-ID: <1465322493.3504.143.camel@hpe.com> References: <146507355220.8347.12117020810872172684.stgit@dwillia2-desk3.amr.corp.intel.com> <146507357415.8347.2659418918775329626.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <146507357415.8347.2659418918775329626.stgit@dwillia2-desk3.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=toshi.kani@hpe.com; x-originating-ip: [15.219.163.9] x-ms-office365-filtering-correlation-id: 8911d504-7565-4070-3c5b-08d38eff2747 x-microsoft-exchange-diagnostics: 1;CS1PR84MB0005;5:bLFpaFMpa/5dM7WFi8sgrc22frHDhcDnAziW3VAZzayOYW/stedmp9DQ1jpvhCVeo/i395o9dqy3Y5B4DcvTycaKfZIt1TwE6U8ln+fgiTErj2xeJQmTf3F+kJxcP53s7gTyRNFKlij1SknKZAZXQg==;24:NJVeQ17Sx++NM20GY/i7zCcv+MaiRnAWW9GTIdCwS/lDWFtKGOIhpfbyp6xLuOn3e3CtKOCyjAgLkMJWGVfb7r+NGzawk6SPKo2zWxFvDfM=;7:JruXotBopetg1wjQODKWUZyVTf2G5del6A0gBod2v5lTX2RgLcC0K60eyXSfBJihCXgqka3PK8vi1BugRV7jKyLg3YyDG6y2MxEbTIMzQuvY1klUz0qiMqFZMj/Z7OP0uiyQxr2uXPQYJSP05GF1ZGWudVc+CQD5WhFyfXQSgS7gAFJwepqPzWKtpxOnNdHVzCSsrnXKTU1qDjIR2Hlj8CHCTMaO6x90fSj/5H3eEcQ= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0005; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:CS1PR84MB0005;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0005; x-forefront-prvs: 09669DB681 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(6009001)(24454002)(189002)(199003)(377424004)(4326007)(33646002)(99286002)(36756003)(76176999)(54356999)(10400500002)(6116002)(106116001)(101416001)(2906002)(102836003)(106356001)(3846002)(105586002)(5001770100001)(92566002)(8936002)(586003)(11100500001)(189998001)(5004730100002)(68736007)(2501003)(97736004)(81166006)(8676002)(86362001)(3280700002)(2900100001)(81156014)(66066001)(87936001)(5008740100001)(2950100001)(122556002)(50986999)(77096005)(103116003)(3660700001)(5002640100001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0005;H:CS1PR84MB0005.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2016 18:11:31.4750 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0005 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 u57IjoEc000480 On Sat, 2016-06-04 at 13:52 -0700, Dan Williams wrote:  : > diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c > index 420e1a5e2250..5b6f85d00bb5 100644 > --- a/drivers/nvdimm/region_devs.c > +++ b/drivers/nvdimm/region_devs.c > @@ -803,11 +803,29 @@ EXPORT_SYMBOL_GPL(nvdimm_volatile_region_create); >   */ >  void nvdimm_flush(struct nd_region *nd_region) >  { > + int i; > + >   /* > -  * TODO: replace wmb_pmem() usage with flush hint writes where > -  * available. > +  * The first wmb() is needed to 'sfence' all previous writes > +  * such that they are architecturally visible for the platform > +  * buffer flush.  Note that we've already arranged for pmem > +  * writes to avoid the cache via arch_memcpy_to_pmem().  The > +  * final wmb() ensures ordering for the NVDIMM flush write. >    */ > - wmb_pmem(); > + wmb(); > + for (i = 0; i < nd_region->ndr_mappings; i++) { > + struct nd_mapping *nd_mapping = &nd_region->mapping[i]; > + struct nvdimm_drvdata *ndd = to_ndd_unlocked(nd_mapping); > + > + /* > +  * Note, nvdimm_drvdata guaranteed to be live since we > +  * arrange for all associated regions to be disabled > +  * before the dimm is disabled. > +  */ > + if (ndd->flush_wpq[0]) Hi Dan, ndd is NULL on our system since nvdimm_probe() always fails in nvdimm_init_nsarea(), which then calls put_ndd() and nvdimm_drvdata_release(). Thanks, -Toshi