Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754255AbbBKWvJ (ORCPT ); Wed, 11 Feb 2015 17:51:09 -0500 Received: from mail-bn1on0130.outbound.protection.outlook.com ([157.56.110.130]:58684 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752664AbbBKWvE convert rfc822-to-8bit (ORCPT ); Wed, 11 Feb 2015 17:51:04 -0500 X-Greylist: delayed 933 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 Feb 2015 17:51:03 EST X-WSS-ID: 0NJMPF2-07-M92-02 X-M-MSG: From: "Suthikulpanit, Suravee" To: "Rafael J. Wysocki" , Mika Westerberg 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/0wygJznswuAgADMxwCAASoAgIAAUxEAgABWD4CAApWYgA== Date: Wed, 11 Feb 2015 22:35:25 +0000 Message-ID: In-Reply-To: <2016200.TRfI2dfssZ@vostro.rjw.lan> 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.14] Content-Type: text/plain; charset="iso-8859-1" Content-ID: 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)(51704005)(164054003)(76104003)(377454003)(24454002)(53416004)(2656002)(102836002)(2950100001)(2900100001)(46102003)(77156002)(62966003)(36756003)(87936001)(23756003)(105586002)(106466001)(47776003)(86362001)(50466002)(106116001)(54356999)(19580405001)(19580395003)(83506001)(50986999)(92566002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR02MB205;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB205; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:CO1PR02MB205; X-Forefront-PRVS: 0484063412 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB205; X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2015 22:35:27.4162 (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: CO1PR02MB205 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2829 Lines: 90 On 2/10/15, 23:07, "Rafael J. Wysocki" wrote: >On Tuesday, February 10, 2015 11:59:32 AM Mika Westerberg wrote: >> On Mon, Feb 09, 2015 at 09:02:11PM +0000, Suthikulpanit, Suravee wrote: >> > 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. >> >> Well, PCI is doing that already :) >> >> > 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. >> >> IMHO cleaner version is the one following PCI. > >I agree. Ok, let me reimplement this part to put "u32 cls" in the struct acpi_device_id, and use that for matching then. > >> Besides, how do you support modules with this? Or did I miss something? > >Good question. Ah. I didn?t think about this part earlier. IIUC, the current ACPI driver would create modules.alias entry with format: acpi:: What do you think if we append the _CLS of the device using the following format: acpi::: In case of PCI_CLASS_STORAGE_SATA_AHCI, this would become: acpi:::0x10601 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/