Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754252AbdHUWVq (ORCPT ); Mon, 21 Aug 2017 18:21:46 -0400 Received: from g4t3426.houston.hpe.com ([15.241.140.75]:35590 "EHLO g4t3426.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753648AbdHUWVn (ORCPT ); Mon, 21 Aug 2017 18:21:43 -0400 From: "Kani, Toshimitsu" To: "rafael@kernel.org" CC: "linux-kernel@vger.kernel.org" , "mchehab@kernel.org" , "rjw@rjwysocki.net" , "bp@alien8.de" , "tony.luck@intel.com" , "lenb@kernel.org" , "linux-acpi@vger.kernel.org" , "linux-edac@vger.kernel.org" Subject: Re: [PATCH v3 1/5] ACPI / blacklist: add acpi_match_platform_list() Thread-Topic: [PATCH v3 1/5] ACPI / blacklist: add acpi_match_platform_list() Thread-Index: AQHTGFwjnywryIINFUyGdWm/Gs0MS6KOsEQAgABU+oCAAAkSgIAAAqkAgAAGRQCAADD1AIAABxqAgAAOwYCAAAYwAA== Date: Mon, 21 Aug 2017 22:21:40 +0000 Message-ID: <1503353508.2042.170.camel@hpe.com> References: <20170818194644.14538-1-toshi.kani@hpe.com> <20170818194644.14538-2-toshi.kani@hpe.com> <20170821112657.hrtjoeagxhc67rrr@pd.tnic> <1503333107.2042.163.camel@hpe.com> <20170821170415.kttnqiwj2fkntsc7@pd.tnic> <1503335626.2042.165.camel@hpe.com> <20170821173612.i3zxlmxklmvv5kzd@pd.tnic> <1503349011.2042.168.camel@hpe.com> In-Reply-To: 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;DF4PR84MB0249;6:em1zEhTz2J5GAPdCANuPGvV0P42JzPaN9GNQnVW20rcQc9M+u7MRCyPb/9howcNOoesee5wT7a8yAMKshYo+vZuXjVJnmbzfSxNUcLsYBWUdhpJjdU5/DiU3TIUI7CBJsJsOmHIofPCWF8I7s4SEHQQB1y70wmnYL4xtgC0Q9w1B/MRVZIIQ5U/Px7na+ZVTi/PDVEIsrkWbzbmVNtaBqoSXKdUbEGRfafP9ZUvF3oAEi0mQUMVQVSa7JacMA1NIclgj3sp6/s4J8VcF3bsvHviiqZiJKHmDvFPLDUzMzzYlvjFYQ189xFA2bzJEM2BIfH1jOssGdops30f4SZGedg==;5:sWh7m1Su3euuD6ODRvZcUD/h1he0QoQeji8gL4v6stF8AM/NdJzwowzMSjAKUBD/gZGZxA4kHj8vT9s8dpjAsKszWrI5HoCOqSf/0XlyMPLUQAG3+av0bRBaJpW5xkU9s/dX3AOOQiYDnzyXr3nVpg==;24:+V8d77YglvCb5/zT10cD71SyzJJ2Xlfodpy3VehDD6z+t4z7riOrEk9LLMOUBE2nXp1p8x3iP+LL4KzKuzJdmO2WZwGJUXDWpWlKD3ajdTM=;7:1mA7DjA/vo1aYg3+h+CzC2G4IatvmoudwFvTxvD3UXhI0pjmMSbgaKULpma25SsqoiL2sRyEjt/XI6ef/6wn8ZTElZnHTD5zF1lehHhmEGnzhods/HBgodN/sJnSd0THdKKeTr5eDMCOLDu+fGCRqTvWEd2HPd4BrTrGiWD49thFtE0a23Wa68FL8nRp0leQNdK2nmz920m7bspDu4UssoUwV2B7EAn3K4VZLYN+MG0= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 45a2d657-f52c-463c-2b5f-08d4e8e2ff0e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DF4PR84MB0249; x-ms-traffictypediagnostic: DF4PR84MB0249: 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)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DF4PR84MB0249;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DF4PR84MB0249; x-forefront-prvs: 040655413E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(377454003)(51914003)(189002)(199003)(377424004)(24454002)(7736002)(5660300001)(6486002)(478600001)(66066001)(77096006)(6116002)(103116003)(229853002)(6506006)(102836003)(3846002)(50986999)(305945005)(54356999)(8676002)(53546010)(86362001)(14454004)(101416001)(76176999)(1730700003)(36756003)(8936002)(6436002)(81156014)(81166006)(2351001)(106356001)(5640700003)(6246003)(54906002)(2900100001)(97736004)(3660700001)(3280700002)(105586002)(68736007)(2501003)(25786009)(33646002)(110136004)(2950100002)(4326008)(6916009)(93886005)(6512007)(53936002)(2906002)(189998001);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR84MB0249;H:DF4PR84MB0187.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: <1C78E19349540A47A832F5E24727D7D6@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2017 22:21:40.4516 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0249 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 v7LMLpoe032085 Content-Length: 3029 Lines: 69 On Mon, 2017-08-21 at 23:49 +0200, Rafael J. Wysocki wrote: > On Mon, Aug 21, 2017 at 11:06 PM, Kani, Toshimitsu m> wrote: > > On Mon, 2017-08-21 at 22:31 +0200, Rafael J. Wysocki wrote: > > > On Mon, Aug 21, 2017 at 7:36 PM, Borislav Petkov > > > wrote: > > > > On Mon, Aug 21, 2017 at 05:23:37PM +0000, Kani, Toshimitsu > > > > wrote: > > > > > > > 'data' here is private to the caller.  So, I do not think > > > > > > > we need to define the bits.  Shall I change the name to > > > > > > > 'driver_data' to make it more explicit? > > > > > > > > > > > > You changed it to 'data'. It was a u32-used-as-boolean > > > > > > is_critical_error before. > > > > > > > > > > > > So you can just as well make it into flags and people can > > > > > > extend those flags if needed. A flag bit should be enough > > > > > > in most cases anyway. If they really need driver_data, then > > > > > > they can add a void *member. > > > > > > > > > > Hmm.. In patch 2, intel_pstate_platform_pwr_mgmt_exists() > > > > > uses this field for PSS and PCC, which are enum values.  I > > > > > think we should allow drivers to set any values here.  I > > > > > agree that it may need to be void * if we also allow drivers > > > > > to set a pointer here. > > > > > > > > Let's see what Rafael prefers. > > > > > > I would retain the is_critical_error field and use that for > > > printing the recoverable / non-recoverable message.  This is kind > > > of orthogonal to whether or not any extra data is needed and that > > > can be an additional field.  In that case unsigned long should be > > > sufficient to accommodate a pointer if need be. > > > > Yes, we will retain the field.  The question is whether this field > > should be retained as a driver's private data or ACPI-managed > > flags. > > Thanks for the clarification. > > > My patch implements the former, which lets the callers to define > > the data values.  For instance, acpi_blacklisted() uses this field > > as is_critical_error value, and > > intel_pstate_platform_pwr_mgmt_exists() uses it as oem_pwr_table > > value. > > > > Boris suggested the latter, which lets ACPI to define the flags, > > which are then used by the callers.  For instance, he suggested > > ACPI to define bit0 as is_critical_error. > > > > #define ACPI_PLAT_IS_CRITICAL_ERROR     BIT(0) > > So my point is that we can have both the ACPI-managed flags and the > the caller-defined data at the same time as separate items. > > That would allow of maximum flexibility IMO. I agree in general. Driver private data allows flexibility to drivers when the values are driver-private. ACPI-managed flags allows ACPI to control the interfaces based on the flags. Since we do not have use-case of the latter case yet, i.e. acpi_match_platform_list() does not need to check the flags, I'd suggest that we keep 'data' as driver-private. We can add 'flags' as a separate member to the structure when we find the latter use-case. Thanks, -Toshi