Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752880AbdHOPhy (ORCPT ); Tue, 15 Aug 2017 11:37:54 -0400 Received: from g9t5009.houston.hpe.com ([15.241.48.73]:50036 "EHLO g9t5009.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751692AbdHOPfx (ORCPT ); Tue, 15 Aug 2017 11:35:53 -0400 From: "Kani, Toshimitsu" To: "bp@alien8.de" CC: "rjw@rjwysocki.net" , "lenb@kernel.org" , "mchehab@kernel.org" , "tony.luck@intel.com" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linux-edac@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+AIAACWYAgAAIzwCAATq3AA== Date: Tue, 15 Aug 2017 15:35:51 +0000 Message-ID: <1502810766.2042.149.camel@hpe.com> References: <20170814162436.lta5xm742hh6g7yk@pd.tnic> <1502728754.2042.139.camel@hpe.com> <20170814170552.j3lhzvnwlpz75y4g@pd.tnic> <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> In-Reply-To: <20170814203942.6t3mrq3hc324blab@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.211.195.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DF4PR84MB0185;6:K2y4xHfvtzdpKVoe18DVbHaNd8MZEY2jvHGlys1jT9eYfnAOVJ4gCkERA03NtP0HQ3BinmIpP2oj5xnW5rxYzpQerDhAtgJaPKoGNHUGhCYL9r26Vv28vnH/joYFMPZya/Lpf0h/K5Lh7CZIhx1HUn9ujLly7QjSLmbXnEZrZYWeXyLHP8Reb9WDJBO0BHy14WokfJLU6pXXK1DsjtholdcLXSbhMorNnDk/2cb7camUmItzbxngcebe4OzVRBB2hD0HSFgWkzCrDksW6xI3sH3KfQ37zVrvz+mzxmFiX39xnI4AWwa9GTrG3K1F15KP7B2dicIxXw5qiEKNVildeA==;5:ECcmxDIC6s5Czti8omHt93mGpmIaOLWzxS/NeDsd1ZAJgBgUQq9AlWVpYUsq44/VRvac98EGqlj7DjNVm3+rN/xZqtneDnD8y9m7Vt3nB4ko2TjR1McglTtavN2LC+ZtWki0bg6IpBd8mLutdhInOQ==;24:pHxj8lD/aXZ0yW3yr2UFzd64CqzuErCpT5qc3fxv7+dntXG5z9Kikt8gkqNwUCQsc2HT3BB0aYaLRGvEQ/lXV4Pcl4na+7Yp2iXMqeVYqLs=;7:3eV7ArJwg+YtQM9lxTMl5t6XeCn4qPZlYNhrf4+EJvYiSRRY4IenwCTIeYQ7GzdCZOnnTuavMFmZeohsBH8CXLPfMorIpQsEfKnm5yaoz1Km/W3YIgERyWMCu5O9zxruYvXDY1SzwjwkGc9Mpxj7FVVHCBGI2RJTAbgO5j9N4JZ9biw2dTutw3Y2tq+Cq6g2BCDsEHPpzHJ4NESefbqp/9KI5vkrEOvVIiMXrjpPBNU= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 69c7db48-77bb-46ea-6992-08d4e3f34f6b 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)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(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: 04004D94E2 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(199003)(377424004)(189002)(24454002)(189998001)(76176999)(54356999)(101416001)(2950100002)(305945005)(50986999)(66066001)(103116003)(6512007)(110136004)(2900100001)(5640700003)(97736004)(93886004)(77096006)(2351001)(53936002)(4326008)(54906002)(33646002)(36756003)(106356001)(6246003)(3660700001)(86362001)(105586002)(25786009)(14454004)(68736007)(478600001)(8936002)(2906002)(6506006)(3846002)(2501003)(102836003)(3280700002)(6116002)(6486002)(6436002)(81156014)(6916009)(7736002)(1730700003)(229853002)(5660300001)(81166006)(8676002);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: <5CECFBCC3EA51C47B23091B714FA3A4F@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Aug 2017 15:35:51.3048 (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 v7FFcUTu024962 Content-Length: 1802 Lines: 44 On Mon, 2017-08-14 at 22:39 +0200, Borislav Petkov wrote: > On Mon, Aug 14, 2017 at 08:17:54PM +0000, Kani, Toshimitsu wrote: > > I think the current code design of allocating mci & ghes_edac_pvt > > for each GHES source entry makes sense. > > And I don't. > > > edac_raw_mc_handle_error() also has the same expectation that the > > call is serialized per mci. > > There's no such thing as "per mci" if the driver scans *all DIMMs* > per register call. If it does it this way, then it is only one mci. ghes_edac instantiates an mci as a pseudo device representing a GHES error source. Each error source associates with all DIMMs, and may report errors independently. As ghes_edac is an GHES error-reporting wrapper to edac, this abstraction makes sense. > It is actually wrong right now because if you register more than one > mci and you do edac_inc_ce_error()/edac_inc_ue_error(), potentially > different counters get incremented for the same errors. Exactly > because each instance registered is *wrongly* responsible for all > DIMMs on the system. I do not see a problem in having counters for each GHES error source. This is just statistics info, and ghes_edac does not expect any OS action from the counters. > So you either need to partition the DIMMs per mci (which I can't > imagine how it would work) or introduce locking when incrementing the > mci->counters. I do not think changing the calling convention to edac library interfaces is a good idea for a special case like ghes_edac. Such changes can be a burden for us going forward. I think ghes_edac just needs to work with the current prerequisite. User apps like ras-mc-ctl works as expected for a given (not-so-great) DIMM info from SMBIOS as well. I do not see a probelm from user perspective, either. Thanks, -Toshi