Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761227AbbBIVCY (ORCPT ); Mon, 9 Feb 2015 16:02:24 -0500 Received: from mail-by2on0114.outbound.protection.outlook.com ([207.46.100.114]:23167 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1761099AbbBIVCU convert rfc822-to-8bit (ORCPT ); Mon, 9 Feb 2015 16:02:20 -0500 X-WSS-ID: 0NJIVRP-07-M4F-02 X-M-MSG: From: "Suthikulpanit, Suravee" To: Mika Westerberg , "Rafael J. Wysocki" CC: Greg Kroah-Hartman , "lenb@kernel.org" , "hdegoede@redhat.com" , "tj@kernel.org" , "arnd@arndb.de" , "mjg59@srcf.ucam.org" , "grant.likely@linaro.org" , "hanjun.guo@linaro.org" , "al.stone@linaro.org" , "graeme.gregory@linaro.org" , "Duran, Leo" , "linux-ide@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linaro-acpi@lists.linaro.org" , Lv Zheng Subject: Re: [V3 PATCH 1/2] ACPI / scan: Add support for ACPI _CLS device matching Thread-Topic: [V3 PATCH 1/2] ACPI / scan: Add support for ACPI _CLS device matching Thread-Index: AQHQQ7stmZe/juvFQU6TV9cn/0wygJznswuAgADMxwCAASoAgA== Date: Mon, 9 Feb 2015 21:02:11 +0000 Message-ID: In-Reply-To: <20150209111538.GB1480@lahna.fi.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.0.121105 x-originating-ip: [10.177.96.15] Content-Type: text/plain; charset="us-ascii" Content-ID: <633C5637961F3042AB258E2B2FAEFCAF@amd.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-EOPAttributedMessage: 0 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; arndb.de; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(479174004)(24454002)(377454003)(51704005)(164054003)(106466001)(102836002)(2900100001)(50466002)(106116001)(2950100001)(46406003)(105586002)(83506001)(23726002)(19580405001)(50986999)(87936001)(2656002)(19580395003)(97756001)(54356999)(62966003)(77156002)(86362001)(101416001)(47776003)(46102003)(92566002)(36756003)(53416004);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR02MB200;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB200; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:BN1PR02MB200; X-Forefront-PRVS: 04825EA361 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB200; X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2015 21:02:15.8244 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR02MB200 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1768 Lines: 49 On 2/9/15, 19:15, "Mika Westerberg" wrote: >On Mon, Feb 09, 2015 at 12:02:43AM +0100, Rafael J. Wysocki wrote: >> On Monday, February 09, 2015 12:20:03 AM Suravee Suthikulpanit wrote: >> > Device drivers typically use ACPI _HIDs/_CIDs listed in struct >>device_driver >> > acpi_match_table to match devices. However, for generic drivers, we do >> > not want to list _HID for all supported devices, and some device >>classes >> > do not have _CID (e.g. SATA, USB). Instead, we can leverage ACPI _CLS, >> > which specifies PCI-defined class code (i.e. base-class, subclass and >> > programming interface). >> > >> > This patch adds support for matching ACPI devices using the _CLS >>method. >> > >> > Signed-off-by: Suravee Suthikulpanit >> >> Greg, Mika, any problems with this? > >Is there some specific reason why this cannot be done in similar way >than PCI already does? > >In other words, stuff _CLS fields to struct acpi_device_id and make >match functions match against those if they are != 0. That was my original thought. Then I realized that the acpi_device_id is used to create the device matching table, in which could contain several _HID/_CID. However, most of the added _CLS field would likely ended up being unused and taking up space. In contrast to _HID/_CID, a driver is likely to match just a single _CLS. So, I think it is cleaner to have just a dedicate struct acpi_device_cls, and a matching function for it. Thanks, Suravee -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/