Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752326AbdHPP0L (ORCPT ); Wed, 16 Aug 2017 11:26:11 -0400 Received: from g2t2353.austin.hpe.com ([15.233.44.26]:41384 "EHLO g2t2353.austin.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbdHPP0J (ORCPT ); Wed, 16 Aug 2017 11:26:09 -0400 From: "Kani, Toshimitsu" To: "tony.luck@intel.com" , "rostedt@goodmis.org" , "bp@alien8.de" CC: "linux-edac@vger.kernel.org" , "lenb@kernel.org" , "mchehab@kernel.org" , "linux-kernel@vger.kernel.org" , "rjw@rjwysocki.net" , "linux-acpi@vger.kernel.org" Subject: Re: [PATCH v2 4/7] ghes_edac: avoid multiple calls to dmi_walk() Thread-Topic: [PATCH v2 4/7] ghes_edac: avoid multiple calls to dmi_walk() Thread-Index: AQHTDKTuWyxK/OMe00e0Ovda8CeGBqJzlIKAgAEZcQCAAIyugIAD9yeAgAW2iQCABSfDgIAACkUAgAAEFwCAAAdxAIAACkmAgAAGWwCAAAC7gIAAB8WAgAAEpwCAAAu+AIAACWYAgAAIzwCAATq3AIAABjEAgAEXv4CAAHGnAA== Date: Wed, 16 Aug 2017 15:26:04 +0000 Message-ID: <1502896578.2042.155.camel@hpe.com> References: <1502732561.2042.141.camel@hpe.com> <20170814180526.wtfjzgc6uye2qtx6@pd.tnic> <1502734083.2042.143.camel@hpe.com> <20170814183551.sgk2i7lxpmpyodhv@pd.tnic> <1502736750.2042.145.camel@hpe.com> <20170814193432.mjldfhfal5ba5dt7@pd.tnic> <1502741290.2042.147.camel@hpe.com> <20170814203942.6t3mrq3hc324blab@pd.tnic> <1502810766.2042.149.camel@hpe.com> <20170815154815.wy3dqwb4yi3feahg@intel.com> <20170816082931.p6rpvtlxwt5nccxr@pd.tnic> In-Reply-To: <20170816082931.p6rpvtlxwt5nccxr@pd.tnic> 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.203.227.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DF4PR84MB0185;6:d6R6nSngkWdz2ZbQcWn/4QbkS1JddSENlNl01kBST055HLuXuuHNN1TLDqYR+icZ4wAVyLv5486zSnlkNgEVW6IfPV8jmNmXxBqkY/7X9JepGGG0UnAQa+BUkL4nRzmHwvZGCmE3bJzNi4Op2n5KcxC5vQlxd30c0eg5/xtZA9xhHVmh0hLv234v0uGJMCQ2zAMtEJvoQ2OyidPfzlvmCJP4X3hX2/+ygSFKtJr60mZ2mLppe6LE2p3y399JA2CuQha2m54Bxuqk7RwjykqTW3uq/7hPY0mNwN8SGIrsowsDzijJ8n3zSbJrhC7XZrnnjgLQvA4tZn+5mEdV/kofSA==;5:7SFN0dkxURIwjZJYVkKYlU7WTLNLV42sCxJRU5yNFQiKq86vForKReUavXeDWNiuBCjdTEb0Toafee8kC52dXKCHxpaHVuT1A6JTI/nHzOCx/1RPXPCpwhr/R6UyALEID5sLIIwefKDxm6aGx697IQ==;24:SBj3chrJZADXbj5SlxVDLWqr6rz2vrMeayqmt8Q5bc3ulVVh7hLHMKTxSu9n0V11eigxqCInoFFfsW9Q4LkJIuDxXhe1yf54yy9gVKk74vU=;7:1dtTVfdE2WelBDgDM+mko01/fWhK3DQm2YXAGjRolMEFuQe8vwSR+TLwZpr3YN0ZOGm4e07RTUNxzB7Rah6PfWqfQsbfV8MbbYxw0wwuvHBjhkO+PRoC4jc912ac8yj5U4HPzSkn/Oiu8kRDaNQnkQc6fZEUNmRwVevqilbKSCVdCENyxD4BUVThz7PzbZuHksZF46UjCpzovLVqF7wJKqpXkC9Ld3RSjNHhI1oijdU= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 67861cb0-93c7-489b-069f-08d4e4bb1c1e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DF4PR84MB0185; x-ms-traffictypediagnostic: DF4PR84MB0185: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DF4PR84MB0185;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DF4PR84MB0185; x-forefront-prvs: 0401647B7F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(24454002)(377424004)(199003)(189002)(81166006)(8676002)(81156014)(68736007)(5660300001)(7736002)(6506006)(105586002)(8936002)(305945005)(6436002)(6116002)(3846002)(102836003)(77096006)(106356001)(6486002)(2906002)(66066001)(2501003)(229853002)(3660700001)(3280700002)(2201001)(2950100002)(33646002)(4326008)(54906002)(76176999)(54356999)(50986999)(6246003)(103116003)(25786009)(93886004)(6512007)(478600001)(53936002)(189998001)(36756003)(14454004)(97736004)(86362001)(101416001)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR84MB0185;H:DF4PR84MB0187.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2017 15:26:04.6735 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0185 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 nfs id v7GFQIDp021327 Content-Length: 1176 Lines: 34 On Wed, 2017-08-16 at 10:29 +0200, Borislav Petkov wrote: > On Tue, Aug 15, 2017 at 08:48:16AM -0700, Luck, Tony wrote: > > Won't the user see all their DIMMs reported for each memory > > controller > > under /sys/devices/system/edac/mc/mc*/dimm* ? > > > > That sounds confusing. > > Right, and adding the locking was really easy. If only people would > debate less and actually try to do what they're being advised to. > But not really: if you wanna have something done, you have to do it > yourself. Sorry, but I did not agree on allowing concurrent accesses to mci...  /* Memory Device - Type 17 of SMBIOS spec */ >  struct memdev_dmi_entry { > @@ -169,14 +173,11 @@ void ghes_edac_report_mem_error(struct ghes > *ghes, int sev, >   enum hw_event_mc_err_type type; >   struct edac_raw_error_desc *e; >   struct mem_ctl_info *mci; > - struct ghes_edac_pvt *pvt = NULL; > + struct ghes_edac_pvt *pvt = ghes_pvt; > + unsigned long flags; >   char *p; >   u8 grain_bits; I believe you now need to protect from a race condition that a single mci and pvt can be initialized / consumed from multiple threads. This protection is missing in your patch. Thanks, -Toshi