From patchwork Sun Dec 10 20:24:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 176402 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6683724vqy; Sun, 10 Dec 2023 12:26:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgCrd6truZcrI1y1OlouDydOEME6ibXfMworvU8AbyYhnopoAPjI5dvz4RMt8noU2k8lfB X-Received: by 2002:a05:6358:3419:b0:170:d757:f369 with SMTP id h25-20020a056358341900b00170d757f369mr407943rwd.38.1702239981497; Sun, 10 Dec 2023 12:26:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702239981; cv=none; d=google.com; s=arc-20160816; b=xlLWOv61n3OH3h6/cSW618VrOtKgo+CJ9MNSM+IiKLkY4DJGgDteV3a9HccnEvaRWB EbpPypYZJIPV1d1Xn8aaHyc/DVu4f4Ky1APpJmnz5WxxiSKtSwxX7LLA3/8R89UAZt+H 8BXMACWMJZetMxPfqrcJ8bZ8Yqk8cRwO+VI4FoJNsjLsNO8cmIrYMucwKrcvkqXGzIbX Ar8u8S+yZFye6/qOTO+HHxcn7dQ7FD3+MYJ0zbtl4KeDrApgIBY4qRHOGuxQ/cWyP7o8 gWrmuMhupqmUXtBB4KcPW7P3vSVPWx1tLdkEmUJDFNdFcBYjCZO0KlG5fS1RLqw//JUo IjcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+N2ylLtYz17NPtKniZ0dtS5uaRiZukdehyRKgNvix/A=; fh=li8yxIESWfZR7lmBO8wCmgOg4WdXsWPyQvEuWPhaOvo=; b=vCmk1Pb5SsrT9iEfEd82/fX9ybqdwElVui6bxBcCnIawdheNthW3eWKVb/8cMEGTZ+ 7VFQAMvDardBxWFdT6Mwtec5oNMvj9gIIDzmdfpQgjGAnS8ADu9pEJEORw+A+bVyYC8B jemcoQ3EMw8hqyQO/3bY3SQbSlbM7PLh+FZZh1vmjfFHg+HxoAJ/RVZf7T8j7+s4AKC7 3VKLGuDgp0vjPcaOtvEX6/4BfIPFvAhrjWrRGBivHG3m4/krY6Y1DaViLjDgDUT/rSpy JgkOOI1TkCZkxMbotUQJN4QOCtuUtU8o8Y9y3RPUjujhgmIsM6b7Q0h9PecpHS+ayZDh oLzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=kKncfG8h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q18-20020a17090aa01200b002888a147111si6340519pjp.71.2023.12.10.12.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 12:26:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=kKncfG8h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 9D9D6807090A; Sun, 10 Dec 2023 12:26:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbjLJUZF (ORCPT + 99 others); Sun, 10 Dec 2023 15:25:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231313AbjLJUY6 (ORCPT ); Sun, 10 Dec 2023 15:24:58 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43DEEEB; Sun, 10 Dec 2023 12:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1702239891; x=1702844691; i=w_armin@gmx.de; bh=9X/ndjF0qighzqFD38BDT0oCZveOZxeu5EzMzNvtGSY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=kKncfG8hsHirtke4S1FBYVxunBEoaYhoOLsxAWAJJv/YMBipY+16uKMEMQuRjECo 80YNKY1uAiv4fhqM33Id0bBzl3lElqVRnyJl2WJa6qCQy2O8NoIAli8GDiCEvpPDK Bn1mtNKE/09GxlpnQxVt3fdrNQiRXaExxp8eRaaL7HQGNTdprhfkS/uK9ZRlCUWAF m3yyw+bMr7qghUx9+Ky38q4IG7YRFP5b6MMVU5Bo5qN93TshYZrMb1yaL2GR5wLPD 6paonzgMgcg3CN/czrldEMb7g4M6WxDolHAcJ3RWrwNv0mKmbgwUGnyrdYrCl6zB8 +na7+EtFf6wdrSy68Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5mKJ-1rIxiq1mPr-017Ho0; Sun, 10 Dec 2023 21:24:51 +0100 From: Armin Wolf To: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, corbet@lwn.net Cc: Dell.Client.Kernel@dell.com, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] platform/x86: wmi: Remove debug_event module param Date: Sun, 10 Dec 2023 21:24:40 +0100 Message-Id: <20231210202443.646427-3-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231210202443.646427-1-W_Armin@gmx.de> References: <20231210202443.646427-1-W_Armin@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:gxVqnCyDxUDGQkxB/vb9rTwI2WIj9Lz6rYKGNRn2PQV5PzSCuKe RazhoLs+5F1OSGabVdlzXr/H/IcTChsR2CGMgXd6jknrbKnrEo4ocdAj1I4fXwHXqkDx48t kO0C2oMu5gel2Pw9B2p6iBoz0lRxDOo7KSeAF0icXSMcMsmgtWxfRnitc4r9yj8ILz5N0Ay 9e5EI4rRhgwo7RsiIGNrQ== UI-OutboundReport: notjunk:1;M01:P0:sILp1v5shW8=;Acn5DnIaQxHF1DQgghBbQcgUHhH As+bLb/RR+xof6keTYpLFqjD3pyH3gKx1mUoL6uSWlf3EHsmkXimoS1TBTVasja6yn8n3OJUN 1+BB+VD9V8Z7DxCqGOCOY2DEhlxtlawYAtTpa4RWhBOdkHrpOoGN2rQPtjqZRzMvzZb2arMls JOxFFZe9HdMJS9aui4HaG9G68dWKshmKtKPhMotJGBu3E2o2vRrhYMY6df4xwnyxm1JGw9PqZ TE++MOl9J+xnGv8whkRlbfmrad6G4ddbRW0jhTbyh/Fhw95J/Mn44tXFPPdV0BiIHjC8CdhrR qT8su+wYn4W8lGsAemHujMyy3kNyWBxkuCy07heco8m5oedXDAe77BkhLX3CefxD4aehkGPEy V9rG1amxfbNlAHQM84CLH9Pdio7nnTxLIqaOEoWq5UHsDoDIQZc56gG5s3XDHJXFmpd8cDwMr Dp4Wps2txBhdxPS6FqgoHH32B8q1vchhkmRQxPc+EHQMLT4aIeNPUaYmOtBFyALP4kU1L63yI JlKgj7XKqiWiX5uJvGLS11lyrXeKltVRCJ7YKzbE2G8ObeQbOpuTZDPSDS28ncBitoSRXpRI2 eUZUQHFGSt4wDBS+VqmvZUdbHs+om7WYxhXF1GQZ2CJ4PPN5nIe5iTXEckwKuBb/I8F/joY1X 7wXKudVBVI4beQWdV9BB1vp3rdIjLOaticKS8uQQcCHojteumAtoiikdDvsCujRU0DcllOVD7 K7i6qxTAjXUy+UG2YhbkWabDaGTUoItWel1emFQ6/7sc0ntxZ4TB9ZpUIfHlz5Rk75jGyjd0o KKHgmNhcgPJGezKx8vajAMaYXLAAX+G0L9tmXzsFqNWQCVHwvHbSxABS1oeYrYxK4iLl8IpZ2 Rj+ke4JO339fggMHFmjSnK0YaDDgodPi8467Cf3KmUtcfruSaelBUwCJVlYqCEpYNR4hsVy5A x0HdzVc4Mp5f0RvZRrElueaafis= X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 10 Dec 2023 12:26:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784927990875839573 X-GMAIL-MSGID: 1784927990875839573 Users can already listen to ACPI WMI events through the ACPI netlink interface. The old wmi_notify_debug() interface also uses the deprecated GUID-based interface. Remove it to make the event handling code more readable. Reviewed-by: Ilpo Järvinen Signed-off-by: Armin Wolf --- drivers/platform/x86/wmi.c | 74 ++++---------------------------------- 1 file changed, 7 insertions(+), 67 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index e8019bc19b4f..7df5b5ee7983 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -85,11 +85,6 @@ struct wmi_block { #define ACPI_WMI_STRING BIT(2) /* GUID takes & returns a string */ #define ACPI_WMI_EVENT BIT(3) /* GUID is an event */ -static bool debug_event; -module_param(debug_event, bool, 0444); -MODULE_PARM_DESC(debug_event, - "Log WMI Events [0/1]"); - static const struct acpi_device_id wmi_device_ids[] = { {"PNP0C14", 0}, {"pnp0c14", 0}, @@ -592,42 +587,6 @@ acpi_status wmidev_block_set(struct wmi_device *wdev, u8 instance, const struct } EXPORT_SYMBOL_GPL(wmidev_block_set); -static void wmi_notify_debug(u32 value, void *context) -{ - struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; - union acpi_object *obj; - acpi_status status; - - status = wmi_get_event_data(value, &response); - if (status != AE_OK) { - pr_info("bad event status 0x%x\n", status); - return; - } - - obj = response.pointer; - if (!obj) - return; - - pr_info("DEBUG: event 0x%02X ", value); - switch (obj->type) { - case ACPI_TYPE_BUFFER: - pr_cont("BUFFER_TYPE - length %u\n", obj->buffer.length); - break; - case ACPI_TYPE_STRING: - pr_cont("STRING_TYPE - %s\n", obj->string.pointer); - break; - case ACPI_TYPE_INTEGER: - pr_cont("INTEGER_TYPE - %llu\n", obj->integer.value); - break; - case ACPI_TYPE_PACKAGE: - pr_cont("PACKAGE_TYPE - %u elements\n", obj->package.count); - break; - default: - pr_cont("object type 0x%X\n", obj->type); - } - kfree(obj); -} - /** * wmi_install_notify_handler - Register handler for WMI events (deprecated) * @guid: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba @@ -656,8 +615,7 @@ acpi_status wmi_install_notify_handler(const char *guid, acpi_status wmi_status; if (guid_equal(&block->gblock.guid, &guid_input)) { - if (block->handler && - block->handler != wmi_notify_debug) + if (block->handler) return AE_ALREADY_ACQUIRED; block->handler = handler; @@ -698,22 +656,14 @@ acpi_status wmi_remove_notify_handler(const char *guid) acpi_status wmi_status; if (guid_equal(&block->gblock.guid, &guid_input)) { - if (!block->handler || - block->handler == wmi_notify_debug) + if (!block->handler) return AE_NULL_ENTRY; - if (debug_event) { - block->handler = wmi_notify_debug; - status = AE_OK; - } else { - wmi_status = wmi_method_enable(block, false); - block->handler = NULL; - block->handler_data = NULL; - if ((wmi_status != AE_OK) || - ((wmi_status == AE_OK) && - (status == AE_NOT_EXIST))) - status = wmi_status; - } + wmi_status = wmi_method_enable(block, false); + block->handler = NULL; + block->handler_data = NULL; + if (wmi_status != AE_OK || (wmi_status == AE_OK && status == AE_NOT_EXIST)) + status = wmi_status; } } @@ -1340,17 +1290,10 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) list_add_tail(&wblock->list, &wmi_block_list); - if (debug_event) { - wblock->handler = wmi_notify_debug; - wmi_method_enable(wblock, true); - } - retval = wmi_add_device(pdev, &wblock->dev); if (retval) { dev_err(wmi_bus_dev, "failed to register %pUL\n", &wblock->gblock.guid); - if (debug_event) - wmi_method_enable(wblock, false); list_del(&wblock->list); put_device(&wblock->dev.dev); @@ -1445,9 +1388,6 @@ static void acpi_wmi_notify_handler(acpi_handle handle, u32 event, wblock->handler(event, wblock->handler_data); } - if (debug_event) - pr_info("DEBUG: GUID %pUL event 0x%02X\n", &wblock->gblock.guid, event); - acpi_bus_generate_netlink_event( wblock->acpi_device->pnp.device_class, dev_name(&wblock->dev.dev),