All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@dell.com>
To: dvhart@infradead.org, Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	platform-driver-x86@vger.kernel.org,
	Andy Lutomirski <luto@kernel.org>,
	Mario Limonciello <mario.limonciello@dell.com>
Subject: [PATCH 2/2] platform/x86: wmi: Allow creating WMI devices with the same GUID
Date: Fri,  8 Dec 2017 20:34:21 -0600	[thread overview]
Message-ID: <1512786861-1014-3-git-send-email-mario.limonciello@dell.com> (raw)
In-Reply-To: <1512786861-1014-1-git-send-email-mario.limonciello@dell.com>

In: commit d1f9e4970742 ("ACPI: WMI: Survive BIOS with duplicate GUIDs")
parsing two of the same GUID was prevented in the WMI bus driver.

At the time no one understood why GUID 05901221-D566-11D1-B2F0-00A0C9062910
was being duplicated.  It's now known that GUID is used for the binary
MOF file of a _WDG entry in the ASL.  It's entirely possible for multiple
_WDG entries and for multiple instances to bind in a given driver.

NOTE:
The only known instance of duplicated GUID's is the WMI BMOF GUID above,
but it is possible that other vendors may duplicate GUIDs as well. It
would be better for drivers to not interact with the WMI bus by GUID
string but by the struct wmi_device provided by the WMI bus during
probing.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/platform/x86/wmi.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 45d9010aafcf..5ac17e360fa2 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -1102,28 +1102,6 @@ static void wmi_free_devices(struct acpi_device *device)
 	}
 }
 
-static bool guid_already_parsed(struct acpi_device *device,
-				const u8 *guid)
-{
-	struct wmi_block *wblock;
-
-	list_for_each_entry(wblock, &wmi_block_list, list) {
-		if (memcmp(wblock->gblock.guid, guid, 16) == 0) {
-			/*
-			 * Because we historically didn't track the relationship
-			 * between GUIDs and ACPI nodes, we don't know whether
-			 * we need to suppress GUIDs that are unique on a
-			 * given node but duplicated across nodes.
-			 */
-			dev_warn(&device->dev, "duplicate WMI GUID %pUL (first instance was on %s)\n",
-				 guid, dev_name(&wblock->acpi_device->dev));
-			return true;
-		}
-	}
-
-	return false;
-}
-
 /*
  * Parse the _WDG method for the GUID data blocks
  */
@@ -1157,15 +1135,6 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
 		if (debug_dump_wdg)
 			wmi_dump_wdg(&gblock[i]);
 
-		/*
-		 * Some WMI devices, like those for nVidia hooks, have a
-		 * duplicate GUID. It's not clear what we should do in this
-		 * case yet, so for now, we'll just ignore the duplicate
-		 * for device creation.
-		 */
-		if (guid_already_parsed(device, gblock[i].guid))
-			continue;
-
 		wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
 		if (!wblock) {
 			retval = -ENOMEM;
-- 
2.14.1

  parent reply	other threads:[~2017-12-09  2:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-09  2:34 [PATCH 0/2] Parse multiple duplicate WMI GUIDs Mario Limonciello
2017-12-09  2:34 ` [PATCH 1/2] platform/x86: wmi: prefix sysfs files in /sys/bus/wmi with the ACPI device Mario Limonciello
2017-12-09  2:52   ` Andy Lutomirski
2017-12-09  3:41     ` Mario.Limonciello
2017-12-09  3:41       ` Mario.Limonciello
2017-12-09 21:32       ` Andy Lutomirski
2018-07-06 23:00         ` Darren Hart
2018-11-29  0:22         ` Darren Hart
2017-12-09  2:34 ` Mario Limonciello [this message]
2017-12-09 20:43   ` [PATCH 2/2] platform/x86: wmi: Allow creating WMI devices with the same GUID Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512786861-1014-3-git-send-email-mario.limonciello@dell.com \
    --to=mario.limonciello@dell.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.