Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp943202ybi; Fri, 24 May 2019 14:12:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoe+Qb+bum1M0w5ATIn5WUexQrcVdKjr4eajtsDgs7t0nf6N7YVpUiPMh0MQId6Ns5kVjd X-Received: by 2002:a63:2a89:: with SMTP id q131mr106921059pgq.359.1558732332475; Fri, 24 May 2019 14:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558732332; cv=none; d=google.com; s=arc-20160816; b=fPKEMnwG0pEFOesVOC/Ljq7vrQLTVf1CIJhMV7dMbXLS6o5dDSHWo5xMuStjbKXi9m 6SDkL46XMp2Q7nNchqrY2z8coqEj6zEyq9gEfRQhoRRQJvms9wi5Qxz8eRmgI3QAA5+w rQlFSOWWUDNOr1mKYgXEMAbSUaGXVPUEda2NZJ8k07GDlEA13U73IknEROJK7DSrF0bP 5YUdTqZGqko0R5mzVRAjjITu/mS9QeFNrQ70RkGh0E5SnEvRCxukkgutG/tLcjeBi8Ov kAOIM+24zyckQnfItYQXpRa2UdocdgbH6oiDYpB3GJsX+Zm/CsCKteJTQpw5JtvSSHOH 5tCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NqwnG1uIANfo29FPPFO9XzdxaIL8u/YShBseQ7nZRAg=; b=eouTE2SdSPmXCGK+npI+DEw8mroYt+JVrVEzyNhOEoUCLmB21ZxdpDHjrT9Cl21Nto GIavcaPITQKt7+WnzIKF3aZ3HW4rfTPEoHGV29bbubA6y6+Aku6ha0J9lBnRBMEUgv+o /v9u0oZK5yC9R8N/BpAXQoF0cv/N6VV2VMXHV8FnUU31nY5N4HNfonYd+Yg2YicxuBno 4WHEXhaa57TBdr7mi7EE9XzPEnZD7Y8S7B7ujbJYUJjkfRAFD1XTWrvQbJkUXIKgsEJN +HBKXrME9tXwCpeUq2oOqorb1g6w90AJEqjI2gQS05XqgV6H2QLtqRSdC2gSL/0gs501 RyQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=SQ92VKPG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si5969252pfa.67.2019.05.24.14.11.55; Fri, 24 May 2019 14:12:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=SQ92VKPG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404176AbfEXVKr (ORCPT + 99 others); Fri, 24 May 2019 17:10:47 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:45133 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391771AbfEXVKq (ORCPT ); Fri, 24 May 2019 17:10:46 -0400 Received: by mail-qk1-f193.google.com with SMTP id j1so9504844qkk.12 for ; Fri, 24 May 2019 14:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NqwnG1uIANfo29FPPFO9XzdxaIL8u/YShBseQ7nZRAg=; b=SQ92VKPGzUpQMVWPmzyFFvqntCrKJfUDQ81Kl1fc2lDQ4knAU0wvsoetXOYHQzC5mC aM/JAZnnPh/EYJMQRWlUfVk2UwIhyXH1lNN0LU3qXnZjLBul+NnypLeh7o5b4HJkgfj9 NaJWpGlQqNt5X397cFWigSHMLSIrVHSV+E3/q42XVK+D+pdJQMDMHAYBU1EayTMIgYdv QkfDq8h7q+9cj5n2X9diEXG5BmSEJMeZiLoCbo5jdwXGnvE+ooU3nujenKRix/cVslAG 5GbBpmWX66iMdRFHApqRCoJTb4konvSDaXKPupYgO7jRIVi1WOXtaKuxqduRfE4R9pfr DdNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NqwnG1uIANfo29FPPFO9XzdxaIL8u/YShBseQ7nZRAg=; b=F4W7DRcb/TeM1jeVZiuL11/ueDxa9hP770owOQAMFlV8ZDfuEcbrvoo7iJECVPNYL/ buvI+UWg47AT7bnFOu8fuyrp+4DpyPMw0X1DB5azHuvVv4XorD4bWnfFsldxtVSa3bQ4 jPBCaqRYzBBXA0ZfmnNpNDIwbJb8142seg9w7S2LRB6FFEENHhHg6Eeynb8dJvx4JOKh xctmap/I3NftB6bsJL2tGb/p821VOnO5WqjrksBZmv/vOOMZQ9mqUZhbI8TRBdCUE5nQ e/8pYpGo5nDDy/lwcV2osfmdru8GsLnsPQs85kryhkxq2HkOvZ6DhXmEuxH3qBN7aKt4 Qamg== X-Gm-Message-State: APjAAAXT9f4bSdoDRzddFm0kBgxzP55gU74JJxtISUhVgiLTwof42sbT AQ4bwaK6UHsVjlWWemRwOPsIiOJdim8oDUMn4lLKqQ== X-Received: by 2002:a0c:b04f:: with SMTP id l15mr70291951qvc.191.1558732245610; Fri, 24 May 2019 14:10:45 -0700 (PDT) MIME-Version: 1.0 References: <35811fe2-7aac-aa3c-46dc-2bef515b0f47@gmail.com> In-Reply-To: <35811fe2-7aac-aa3c-46dc-2bef515b0f47@gmail.com> From: Daniel Drake Date: Fri, 24 May 2019 15:10:34 -0600 Message-ID: Subject: Re: [PATCH v4 04/13] platform/x86: wmi: Add function to get _UID of WMI device To: Yurii Pavlovskyi Cc: Corentin Chary , Darren Hart , Andy Shevchenko , Chris Chiu , acpi4asus-user , Platform Driver , Linux Kernel , "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 14, 2019 at 12:59 PM Yurii Pavlovskyi wrote: > > Add a new function to acpi.h / wmi.c that returns _UID of the ACPI WMI > device. For example, it returns "ATK" for the following declaration in > DSDT: > Device (ATKD) > { > Name (_HID, "PNP0C14" /* Windows Management Instrumentation Device */) > // _HID: Hardware ID > Name (_UID, "ATK") // _UID: Unique ID > .. > > Generally, it is possible that multiple PNP0C14 ACPI devices are present in > the system as mentioned in the commit message of commit bff431e49ff5 > ("ACPI: WMI: Add ACPI-WMI mapping driver"). > > Therefore the _UID is returned for a specific ACPI device that declares the > given GUID, to which it is also mapped by other methods of wmi module. > > Signed-off-by: Yurii Pavlovskyi Some extra background may be useful when reviewing this. As researched in https://marc.info/?l=linux-kernel&m=155498017207933&w=2, we are dealing with a tricky situation. asus-wmi currently serves two different classes of device: eeepci-wmi and asus-nb-wmi. The eeepci devices have: _WDG : includes a METHOD block with GUID ASUS_WMI_MGMT_GUID, and an EVENT block with GUID EEEPC_WMI_EVENT_GUID _UID : ASUSWMI The asus-nb-wmi devices have: _ WDG : includes a METHOD block with GUID ASUS_WMI_MGMT_GUID (same as eeepc), and an EVENT block with GUID ASUS_NB_WMI_EVENT_GUID _UID : ATK To support new devices we now need to start concretely identifying which of these we are working with. But complications include: - The main MGMT_GUID used for matching at the moment is shared over both device types - Some Asus products have both of these (via two separate two separate PNP0C14 WMI devices). Currently eeepci-wmi and asus-nb-wmi register themselves with asus-wmi, which registers a platform device for each one. The platform dev probe then succeeds the platform device probe when it finds any _WDG entry for the main MGMT_GUID and the _WDG entry for the corresponding event GUID (not necessarily as part of the same underlying ACPI Device). In the case of both devices being present with duplicate MGMT, the first one that is parsed wins, and the other is ignored (see guid_already_parsed()). Sticking with the current approach, which is imperfect for devices that have both devices, adding a method to detect the _UID seems reasonable. Although actually I just realised you could probably also detect the difference by using wmi_has_guid() on the EVENT UUID without having to add a new function. I'll keep thinking about how to improve the situation around two devices present (but don't want to needlessly conflate this patch series with that). Daniel