From patchwork Sat Dec 9 02:34:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Limonciello, Mario" X-Patchwork-Id: 10103541 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F21760325 for ; Sat, 9 Dec 2017 02:35:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD73287A6 for ; Sat, 9 Dec 2017 02:35:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F5A728D69; Sat, 9 Dec 2017 02:35:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE2A9287A6 for ; Sat, 9 Dec 2017 02:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753884AbdLICfO (ORCPT ); Fri, 8 Dec 2017 21:35:14 -0500 Received: from esa2.dell-outbound.iphmx.com ([68.232.149.220]:57377 "EHLO esa2.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753186AbdLICer (ORCPT ); Fri, 8 Dec 2017 21:34:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1512786887; x=1544322887; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=e7F8dVti0XmMb6FYS/A/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qH8AzwfT6s2bSv?= =?us-ascii?q?tl+UehxCqP2xjT6u5aJUA0krLWJIA6wrEqmJcfq1nMETHymEXylaOWcVgk+vSz?= =?us-ascii?q?5OTgf7XmoIKTO5FuhgH/KqQumsm/AOsiPgcSWGib/Pyw1Lzl/ULnXLVHlvw7n6?= =?us-ascii?q?rDvJzEK8kXuLS1DxJV34ss8RqyDjmr3MwdnXYdLVJFfByHj5LuO1HLOP34CO2w?= =?us-ascii?q?g06tkDds3fzGOrzhApDKLnjFjLjhfKhy60pYyAo01t1Q+oxbCrUFIP7pRkDxs9?= =?us-ascii?q?nYAgcjMwOo2+bnFMl91oQGVGKLA6+ZNr7SsFCR6uIsPeaMfokVtyj5K/U++f7u?= =?us-ascii?q?gmE2mUUHcamqw5QXcna4EepiI0mDZnrsmNgBG38QvgUiVOzqlEGCUTlLanaqW6?= =?us-ascii?q?Iz/C07CIyhDYfZQ4ChmaGO3D26Hp1IeG9GEEmAEHjreoiFQPoMdi2SLdF7kjAe?= =?us-ascii?q?VriuVZUh1Rewuw/+0bZnKfDU+iJL/a7kgdRr5+TJiTkz8zJuBsiQ2m3LSHt72i?= =?us-ascii?q?shQTMnlJt/rFJ2ylqF0q8w1/VeGc0V/PNETAw6OJjfyMR1DtnzXkTKedLfG3i8?= =?us-ascii?q?RdDzJDgrT9V5594LZEB2GtimiheLiy+jGb4S0biKAZsy+aPR23z2D8pwz3KA36?= =?us-ascii?q?4k2Qp1CvBTPHGr0/YsvzPYAJTExgDAz/6n?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GhAAD7Sitahz+a6ERcGQEBAQEBAQEBA?= =?us-ascii?q?QEBAQcBAQEBAYUYJ44jjn6ZCYIVCoU7AoRfPxgBAQEBAQEBAQEBAhABAQEKCwk?= =?us-ascii?q?IKC+COCQBgkcDAydLBxA/ElcGARKKKKkoOopsAQEBByiDW4ILgVaBaY5CBYpFi?= =?us-ascii?q?FqPaYI5kmcCk1+WXIE7H4IJb0+CKYJSEAyCBlmKSAEBAQ?= X-IPAS-Result: =?us-ascii?q?A2GhAAD7Sitahz+a6ERcGQEBAQEBAQEBAQEBAQcBAQEBAYU?= =?us-ascii?q?YJ44jjn6ZCYIVCoU7AoRfPxgBAQEBAQEBAQEBAhABAQEKCwkIKC+COCQBgkcDA?= =?us-ascii?q?ydLBxA/ElcGARKKKKkoOopsAQEBByiDW4ILgVaBaY5CBYpFiFqPaYI5kmcCk1+?= =?us-ascii?q?WXIE7H4IJb0+CKYJSEAyCBlmKSAEBAQ?= Received: from esa3.dell-outbound2.iphmx.com ([68.232.154.63]) by esa2.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2017 20:34:46 -0600 Received: from ausxipps301.us.dell.com ([143.166.148.223]) by esa3.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Dec 2017 08:29:35 +0600 X-LoopCount0: from 10.208.86.39 X-IronPort-AV: E=Sophos;i="5.45,380,1508821200"; d="scan'208";a="98092406" X-DLP: DLP_GlobalPCIDSS From: Mario Limonciello To: dvhart@infradead.org, Andy Shevchenko Cc: LKML , platform-driver-x86@vger.kernel.org, Andy Lutomirski , Mario Limonciello Subject: [PATCH 2/2] platform/x86: wmi: Allow creating WMI devices with the same GUID Date: Fri, 8 Dec 2017 20:34:21 -0600 Message-Id: <1512786861-1014-3-git-send-email-mario.limonciello@dell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512786861-1014-1-git-send-email-mario.limonciello@dell.com> References: <1512786861-1014-1-git-send-email-mario.limonciello@dell.com> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;