From patchwork Mon Feb 19 11:59:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 203027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1234226dyc; Mon, 19 Feb 2024 04:02:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhcMFTcGqQ6A8NbHE6FBqqsi8iTQDkQNvMx+4Kts77Z70wxfMXZa7BZxI11wxAnRSAZn3MftZhvYmkm+xHK4T9wmBx1g== X-Google-Smtp-Source: AGHT+IEqGa8RKfiAEq49sa9N+uBKdQM8zPS7pnLd+ey7Gna2CNf0pTdcSz6jbaNdZAikEtXDH+LT X-Received: by 2002:ac8:5d92:0:b0:42d:a884:7dfb with SMTP id d18-20020ac85d92000000b0042da8847dfbmr15044900qtx.2.1708344143600; Mon, 19 Feb 2024 04:02:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708344143; cv=pass; d=google.com; s=arc-20160816; b=qesbqOD1VHGwRpnQBNbD1/CQbS5bGqOt9Ib0v1XsCmmqKT0ZpLJlKH7H6HWPLwDJmG Ggy1FGO9ngyKxtDAJP+V/YwArhIGUzoOJ4xLspA8pAgOzeZ3pBTuY7wukeZL8Ln/UjKQ /zoGESyhDrrNb/t9Ktf4Nl43+6w2wFUf5EPNNlqw0iMuEXNve7ff4UMkh1ynpIV+ldn4 3Ls8TKUiIh/1+P7FM5MjOY5+jaVvWdWEgXdFLePmIUJ8WiwemGggle6GhXpnbhHiA0d9 rczyTAIz9ipU86YbnC05+tVSBJmrOCJIkMuggl3dvYHJxABq6CPtvy6y3R1SIcOPyz+6 o//g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=sDqMXbzWpbge87uDu7Ez2KfwzTGSushLHKwBsyx5VEk=; fh=53tDE54uAbGWTgaegrI/oOrsTh38Ao2IXD0IrA5mCUE=; b=AXTNGiPBzzQh39bTPkqsrcs1sOYSQXW1SDOdWOleNN7Z31IGmqnlDN76w/KyM7XJiP pft4l8SISBgsGEz/4fwaoiz0DOoxGi/splBnGjf12EVOHOzjlR10Zgeej4QWKbHG34kB IdoWR9f7U8aogmGftximRNc5izorSjnt2xbqdYX8gyGPR0BlAEIMAcTZQuI9Da7A0m/U EpiAUyQGRmcmN+DZVmP5WHk7IdW6jQMnqU58MO5QCETS4f+UyzJJoH1DR3APTsyY/Djl 0P4iqEh6zUefB+GoLjRMZxpc0OkqLW+ZH/ve4qFR4xheRvLTd7fjXT/QekKMjIwt5Mkj FoqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=Ms65bXKh; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-71264-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71264-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jr14-20020a05622a800e00b0042c44c065e6si5734327qtb.733.2024.02.19.04.02.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 04:02:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71264-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=Ms65bXKh; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-71264-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71264-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 58C8E1C23698 for ; Mon, 19 Feb 2024 12:00:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44C8D32C8E; Mon, 19 Feb 2024 11:59:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="Ms65bXKh" Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B43552D60C; Mon, 19 Feb 2024 11:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343981; cv=none; b=WaguCnGqZXHuQ8Hk7TSV2iduCGE2gwiiCjZQ/q1x+o2tdkr04KEbWpMxeaqWAaBo+HBMVtzC8tqq7gwpe97holtDvKTbNmFZ+Wd/F651xKvNJLox3yrErDdFkEPdTWAZBH7LF/Usjjiaq85I/Zfc9CTa67z131bzQBjT4ki0y5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343981; c=relaxed/simple; bh=Mp9hOgHSBLyn/IkdgO0pLAaR0KKQJX46nMeFoyl+HGA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ub8QomU3fhbTKHDBJWp1uXtEMvOgwc2iYr1+lc4uICbi2uTWe6vbpPSip2LIxpEF5Bp2DEi/xr6CWiIwBFZgLoiEhkqjNqkQdhq23UXVanX7MOV9W/IePcj4VjDXDVGXJadgA9TRbgVgSZp4JVFJdQLg2DjxlXufU4Aa5wGJqec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=Ms65bXKh; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1708343966; x=1708948766; i=w_armin@gmx.de; bh=Mp9hOgHSBLyn/IkdgO0pLAaR0KKQJX46nMeFoyl+HGA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=Ms65bXKhzTGXO41frnXR++7fkeAcC4cH9oR5mmV0AOKnCdYG6BIBR6VU9NeFBWPH OghH2LUDssNzsUYfdQfGK3xw1NsAY10evPa/FdRkWzEnLv2i8eH+UTPj7cA5Wrkru e/G81k5Iz0yAUp/56M+oK0uHDVN07x+fa5lzOisNvM/OawtWbSyLBLvKjhA0HTapm eAkCmcYlZZ/MkbFYj2TsS13gb/jBT6VtCgd9bw0Lq1ez/GkklufEyYbJFNMCX2H9W rDmMaS/bav2xhinbtM7suBOwnhqYrFuhFZYO7AjjAKjGMHDaqJdlTCeHjS6iRLdUv /P/kL3IRi+SjcuoibA== 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 (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N2V0B-1qwd291vP5-013sCi; Mon, 19 Feb 2024 12:59:26 +0100 From: Armin Wolf To: corentin.chary@gmail.com, luke@ljones.dev Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] platform/x86: wmi: Prevent incompatible event driver from probing Date: Mon, 19 Feb 2024 12:59:15 +0100 Message-Id: <20240219115919.16526-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219115919.16526-1-W_Armin@gmx.de> References: <20240219115919.16526-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:8mOAKKOQfSiI7qUYZqObHAvj7W+O+jwuXvBstGidfNlbqOkaW1v FGMjUDnZbFTCDGvotT188mA/iUzsuFn7+Lz4mIbOZc2zFQ5mt4o2xP7YKWXQZuTPy5YMneU EScEkSubl2UCFkA/yJrxLRVOBI4Q5u1yETJTYNXpxlXMdZh9lq3T/qa9JTfHEHwX+vy46VS +YrF5CLPC+sGCfj14FOrQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:v4V1t7bD45w=;MRvAHFwlkPrjiWrjqJAfBfpOjLo thiBgDIKGaWlqLb1MiXL9Hy/gUQaaHe5kIO5iyKm9wNxvmOB+ZjjigZ9k4ylWJ7hZe8t/3YFS hM99gHOMSdS1zF/Z2MIMprlISG9TA01+OMmrZfQDZOR9lRfZQIaWNKVdDJ0Ww58mPI3N7MS+H dLllHwZVL32gbfc6JTY2p6uGBhCP50iMbPULyyq9KYVYIYf5HexHcTjuDSsfuhPPkleeiZBl2 NQ9jdfd2xMeX+rmHVtvXFSBjD87rkFt3av+I57Fs9vaQa8+fJ5hW54z5atvEC1oHtso4fyart oTTz4/A/zG56gEpV15MeRz0FZrZHi1uOIedIQv8ahvoD2GGrh+DLR/rPQhtPVZo+K91iIdptT 8xgXBj+8aiaP7F3TuHpsYKnssPHwrG0mMg/mwmYtViSzSZoHNm3XRtdE0pex+VpklD1tCRHoo IgDCgbMFlqe6lD+7dVBPHIV5YxyItQhU5qFl9MzvDoc+QWNPD4fCUfwz4Ploc4+DW31kjZ7+6 FkRV96HQft6fE0E4zApz/Ml3ZYNL06DFWhLIiRcw85Q5tsqopSJ45V/PYTOAG8Tkc2OWVcrqj rNX8TioQAdVh1+wdma0vkuaE0/XnQjuxC0XHvLRvyeB7cDATn8k2GUcbsZ8+ZZ8iGboItemsX IvrKBlInugVQ6dV+HaEBHTTLe1HTr9wgzWoyH9fgWY2J2ArHkhoWsJP3mjqzUllve28sVulSr dLu/VxyFKrkRFfpAyzJ8y5G06mjfvcjaRLCIyDPDf/cSB3Ubij4ABaLGXZm8mkb160/fO/OwT C6ro+/kP3zq43TkVoSIvlxNOeYCfrnSTeBej/XT/oAjgQ= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791328668937179599 X-GMAIL-MSGID: 1791328668937179599 If a WMI event driver has no_notify_data set, then it indicates support for WMI events which provide no notify data, otherwise the notify() callback expects a valid ACPI object as notify data. However if a WMI event driver which requires notify data is bound to a WMI event device which cannot retrieve such data due to the _WED ACPI method being absent, then the driver will be dysfunctional since all WMI events will be dropped due to the missing notify data. Fix this by not allowing such WMI event drivers to bind to WMI event devices which do not support retrieving of notify data. Also reword the description of no_notify_data a bit. Signed-off-by: Armin Wolf --- drivers/platform/x86/wmi.c | 10 ++++++++++ include/linux/wmi.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 5a613b06b269..8fb90b726f50 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -57,6 +57,7 @@ static_assert(__alignof__(struct guid_block) == 1); enum { /* wmi_block flags */ WMI_READ_TAKES_NO_ARGS, + WMI_NO_EVENT_DATA, }; struct wmi_block { @@ -869,6 +870,11 @@ static int wmi_dev_probe(struct device *dev) struct wmi_driver *wdriver = drv_to_wdrv(dev->driver); int ret = 0; + if (wdriver->notify) { + if (test_bit(WMI_NO_EVENT_DATA, &wblock->flags) && !wdriver->no_notify_data) + return -ENODEV; + } + if (ACPI_FAILURE(wmi_method_enable(wblock, true))) dev_warn(dev, "failed to enable device -- probing anyway\n"); @@ -1094,6 +1100,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) struct acpi_device *device = ACPI_COMPANION(&pdev->dev); struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; const struct guid_block *gblock; + bool event_data_available; struct wmi_block *wblock; union acpi_object *obj; acpi_status status; @@ -1113,6 +1120,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) return -ENXIO; } + event_data_available = acpi_has_method(device->handle, "_WED"); gblock = (const struct guid_block *)obj->buffer.pointer; total = obj->buffer.length / sizeof(struct guid_block); @@ -1131,6 +1139,8 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) wblock->acpi_device = device; wblock->gblock = gblock[i]; + if (gblock[i].flags & ACPI_WMI_EVENT && !event_data_available) + set_bit(WMI_NO_EVENT_DATA, &wblock->flags); retval = wmi_create_device(wmi_bus_dev, wblock, device); if (retval) { diff --git a/include/linux/wmi.h b/include/linux/wmi.h index 686291b87852..781958310bfb 100644 --- a/include/linux/wmi.h +++ b/include/linux/wmi.h @@ -48,7 +48,7 @@ u8 wmidev_instance_count(struct wmi_device *wdev); * struct wmi_driver - WMI driver structure * @driver: Driver model structure * @id_table: List of WMI GUIDs supported by this driver - * @no_notify_data: WMI events provide no event data + * @no_notify_data: Driver supports WMI events which provide no event data * @probe: Callback for device binding * @remove: Callback for device unbinding * @notify: Callback for receiving WMI events From patchwork Mon Feb 19 11:59:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 203025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1233191dyc; Mon, 19 Feb 2024 04:00:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUFsfSH3TqxoFz5DiL/hdwpm8BRi5yAsCXfqnWLOZCHtaICosrD0tGNcZ1XKvBZVZ8pYV5mEf5BBzyMkqDqsFkfDk/sUg== X-Google-Smtp-Source: AGHT+IE2KYd5162m6aQYTLw6HvwW6EZmwAGdT9rbQ/S0geIFTvfKxDuXpkP805lomy9YDBPBq3VR X-Received: by 2002:a17:906:b791:b0:a3d:5271:2b2d with SMTP id dt17-20020a170906b79100b00a3d52712b2dmr8091121ejb.65.1708344055653; Mon, 19 Feb 2024 04:00:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708344055; cv=pass; d=google.com; s=arc-20160816; b=cNAJHbl8DmpGEjxK65W3Bo8uqZ2yfk4/VL9hO9Fj3vkt0gEvNdwZdEho+sC4EH8q/+ +4sXnSmjNi9SFW7xtCd0eleoGVHhLP+NxwZbz6FwUIDhyyfKKM4pvSWx5DUuibpUryRc wu804jLPTZn43xuetQOX8H7unMe8G6Xz8DXIYkEUW9k00g//vHBj2ygNUcG8aXDUTq+q or9/A2wlsw8AROg/CWjCLDwZHjLVQMsyJSjyUb2VH4ODc75WYwl08pP5eKdq/3kgKCVF br5BJPcQBo77mTIiDApf1ThA398R/G8QiGfA+pUiYRyuZPF9r1NtLbSXTK+IRt+eJ+v/ GKCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=qHfzr9Z6AbrLnleJ2vRO1YVBS5jWB6XYcpAOq7kcFsM=; fh=53tDE54uAbGWTgaegrI/oOrsTh38Ao2IXD0IrA5mCUE=; b=cQn4Gksfwn6PTfucqzc+92j26dR80hWRbe9TNZ2vN3tJISJeUSLiDWRImpesN5RH+1 onzBGA+FVR+LRWIxiSKhwaVS4v/2854WxB0l0AjWq8W94zPfAIpz8F25wfvcnYdjJGqv mYpoxKDkSyB6jxotoIF9N43RBtcN30MNr+6B/jui8BDENC8/xVLuQXArwvjqm1k7Hl+T ojT/Ni5iriMVKlVPoZMBkUG7FrkeYD6+mpmrMtSg361YocBjMkYsXP2gMLv0U/uNG7h7 lnGjCIKBeMyeE8uXcyTkRol1KnH29nvhPKTjdRSJFbG6TI6JxAM27LRZL4pwVwixX5lQ fWoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=EmTgCLO2; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-71266-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71266-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kl10-20020a170907994a00b00a3e73c92596si1174070ejc.171.2024.02.19.04.00.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 04:00:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71266-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=EmTgCLO2; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-71266-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71266-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 462CA1F21E72 for ; Mon, 19 Feb 2024 12:00:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E7B233CD4; Mon, 19 Feb 2024 11:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="EmTgCLO2" Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C614B2E405; Mon, 19 Feb 2024 11:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343982; cv=none; b=hmA4X9xA/50UX0vQ0si7+IyIuCPOhRV1WD7kLSHklRxDdCkAbJ/ZW3sI8/pjnST30tQrvGVobobTHcHylnvBsuW7dcvXYO8mnjrw8FUGvrXX4ZguW97JfqpOM3GXrOaLQyMvPz9faQ4CQ3PbuAQqyZTqAYP4F4UuBewS0dKNDos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343982; c=relaxed/simple; bh=qHfzr9Z6AbrLnleJ2vRO1YVBS5jWB6XYcpAOq7kcFsM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N7nr46yG16C1YEDo5GqpdVXMYp0iG4YPiAPV219dydC6doPCtlbGuUSqCGtyED//KcXmCJaWa8ZewthdAYokoJSL8n+DIDALtXYTd04OmQexkswD6VW8wGaYRvQA1H318RKGxSAAzLY7hDiAPHcyJKuXbbYfUHZKWXQI4cqdSi0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=EmTgCLO2; arc=none smtp.client-ip=212.227.17.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1708343971; x=1708948771; i=w_armin@gmx.de; bh=qHfzr9Z6AbrLnleJ2vRO1YVBS5jWB6XYcpAOq7kcFsM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=EmTgCLO2wSkDlsTcGb7KzGMNJBIjQJA7HdTi8wQZlcl2x2ZlyWZHqh2nTRE+9nHa duLFAjlPMpSnAz5eT5XKuHKOKB2oyXADJ2cQxPSGvDCSkkb74fGOyE7MOVADf/Jmm r3K3sb6MBkW6lfA5xlP8cTRXYHR7KbD3At/wmM9/6X3zXHFthYAcPDlBOP6xd1vKd oQlCeEw+tztsFCHcFavp1AMJa4wh+SjGRNPByzdcl+5Tfblf6QmQ0neEa9h+8lVR1 S/JqGwY0YANiJ5b3UrrDpFHEywR3/nW5erG6dDdQfnkyi7oMkufdfuDV/JnYTn/60 HQFG15unTEhPPlyy1w== 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 1N17UQ-1qvnXl2og6-012XiL; Mon, 19 Feb 2024 12:59:31 +0100 From: Armin Wolf To: corentin.chary@gmail.com, luke@ljones.dev Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] platform/x86: wmi: Update documentation regarding _WED Date: Mon, 19 Feb 2024 12:59:18 +0100 Message-Id: <20240219115919.16526-5-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219115919.16526-1-W_Armin@gmx.de> References: <20240219115919.16526-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:HVa15Z2LrHiydE7egWuwmvdECI1Tv1ZQ4wpN3HEd4/nYZH066wW 6rSrrp1W7tjcnHIFkdtKe1fK1O2U0hrxiukCjwvvFX5RsyR742wCAH81sE/atj1I+FtCWG8 5pCq3lvrnfiGk1QzXXaPl8b0MaZqe+uhXBz4R6AugdZixXijUl1v37OCbLAfFGUnIrvvEyJ Ier5ZaABptv+RqAwnD0MA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:hkUeSe5q1/k=;jg/Rfqe6pDRd5XWkin84hm86CfJ /EHlUVVNaQOTFfJTVPcgDK9MYH7yLhR5n/H3Ho6et9/euvbQNBq0op72oMmyxmcNnzyWJ9afE EcP8mUtazAH3WAtCT75dpP47HHHtb31VKQY/2qfeflVIYYXIZ8CiL1wp2Uxyz1E/uCIH8YqhT fK0L/vm2Nzxm7Qben1bwMMBeuFrMQcf09eQ1c6IwpOxY9PGjk58kd2mMGx0JZS5nYhtFnnEIX hfGNLAZQkc5nsI6qXKIEoyG79DmAcg0ZPsFeQw0yg1l/Og/iKcAFGRHePQjpuqZBrE+0XWIYE i5MueCxE5mkB6VXZG1lFxPOClRZc0dmcn0k84TQPe2NMvcdi8/72jKjjHejsVoB2RtVlqO13N gxF6jCpKQ07h9zsqwQtpjyR34eDE+J2dAkfiJFT/cgc9LCJbIJ5RbjpPSIn+yYgGeFy3eo2J1 mpDdwgleJ+UMYcZ3bpiYqmmQdEANFn+SIoP8gEm+bWgBa2GAKlj13sALw2wsgiMDUpE3ajI+o iqw+kqxqV8P0Jm3+1NW+tzm0ru1Gmnf//Kk65z1n4pOMSOOwIYB65DGr5mDbk0KZqSq3uGx/e Sy7vOSJIHm1MNF+UFNsMUAnnNP1ORM4zLozedPKJ9yf9ZVnNKSQeSEvRHXvrLyzOR9BpdPtm3 X/eGU1aXTEqZlRmzi47nEJIE1OJv7npeY3tnM2uYXl7uRExbZF0uPkqzW5bsGgm7SpHDHNPgl Tg5sES+L3JJo/KhfEX38MkQYxIXSNTR6weuvsLOHgst9DeP5z4RjNn/Q8DnHB9EPUxMG9OQrd heqt/6eMzvqpuNriGw8jgIF0RbZrGELSeG1atJspnRDac= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791328576173305681 X-GMAIL-MSGID: 1791328576173305681 Update the WMI ACPI interface documentation to include the fact that _WED should be evaluated every time an ACPI notification is received. Signed-off-by: Armin Wolf --- Documentation/wmi/acpi-interface.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.39.2 diff --git a/Documentation/wmi/acpi-interface.rst b/Documentation/wmi/acpi-interface.rst index d31af0ed9c08..06fb7fcf4413 100644 --- a/Documentation/wmi/acpi-interface.rst +++ b/Documentation/wmi/acpi-interface.rst @@ -93,4 +93,7 @@ _WED ACPI method ---------------- Used to retrieve additional WMI event data, its single parameter is a integer -holding the notification ID of the event. +holding the notification ID of the event. This method should be evaluated every +time an ACPI notification is received, since some ACPI implementations use a +queue to store WMI event data items. This queue will overflow after a couple +of WMI events are received without retrieving the associated WMI event data. From patchwork Mon Feb 19 11:59:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 203026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1233299dyc; Mon, 19 Feb 2024 04:01:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVN39fy2ANjQdfuYKDLmBRwHFcd/FGMMShVS/OM6+i8COXkeNa3IJqZi29UZBhC9w+SVZNsR0NLTaJtGSSCAUazXrgmWg== X-Google-Smtp-Source: AGHT+IGFEo8IDQGHRbwF9CGP+a37KFvJalY6FIQBWpUklKLjl57+agHbPJBr3wfNKkgzusn+1qRG X-Received: by 2002:a05:6402:1a50:b0:564:8adf:9a7f with SMTP id bf16-20020a0564021a5000b005648adf9a7fmr1062697edb.17.1708344063531; Mon, 19 Feb 2024 04:01:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708344063; cv=pass; d=google.com; s=arc-20160816; b=ruBCIROjHUb/4GYISZ5KT+nXB3Y2k4QIxDuZfOwng5s9fx5IBjPMcwgOQsXQYI81LU Eae+rExtrbf/1HOTmW+oK/9QYS/FhG9/RMdE8DlN0pjQuISuaz0YdjrZu9OQRmFHfLML Sz91z+jaC9QQ//9dKMkjw/sAIbf17phujusECGuqAsP7oA1JI0c05ZXUUesQRfVJGZut +XRM/+D909XRa48WnqxwsiNeJJXvPxn2T5korak6ENZ0mDK2xV5XgCGHMYbcGBHjFR0J yoX395SxWB7LQ+HaA+ml7JjxUQSXGpsCP9dCZet00WsgDVCq99TLXmNPzH+rfMjowGQ6 I6hA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=tdFebCP06FL2AsMK6IqE5wgK5hTseUHsZlGCgIIVtsA=; fh=53tDE54uAbGWTgaegrI/oOrsTh38Ao2IXD0IrA5mCUE=; b=0sG8FIn2ONkrZ5H9Gf/w9KL/C/D3rG4NAxBc0L6jvR+7MDtfTnKf3GfQilafcHUrZH Kp9+gg+FRYTxnaeKQ5qyvmvb3o17bd6lqb9/Tq8Geo5HhRyZRSIlmPAPQZNW7iyo0UIe bsi55d8QWHsMHcB4P1z1GbglK1X211zvI4C08sblbGL2qDasqZAIqxd5jWbNeEoFKWnJ JSvQFAYdLvmP+kTjXF5xYKQhi1T+7mt08vI3rS+11zejUjXdDS+RLnAk7Ea5dBLoYr89 aUCewb19xodmYNSpSw1iQFB1XlGYSzjfO7i3zjLSTl1XhIypukHV8yptzAxij0XWtIu9 uMbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=I4mq0iXe; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-71267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71267-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v17-20020aa7d811000000b00563a7724f40si2381124edq.607.2024.02.19.04.01.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 04:01:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=I4mq0iXe; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-71267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71267-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 003F11F225AA for ; Mon, 19 Feb 2024 12:01:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21AEC33CF6; Mon, 19 Feb 2024 11:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="I4mq0iXe" Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 265A52E64F; Mon, 19 Feb 2024 11:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343984; cv=none; b=qMz+Zuml6D6gEIXtqUvcYwA3QIq5UOJG/YMU5ZuMpJ1g+F0OxJaTjRjnBNuNuQ1vwRcbx9uFoxdTfEyYrwXyTpOkxAoW2mHKl4Ik45lXdheCeFh8rQFN8Od1Lgt2HvJAWEcoXmptoiguxWauaAMgwdEPPhdAHMybp//ZBPAeHg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343984; c=relaxed/simple; bh=jNbs6mh9NRNmcMy+geYDC/0FJuXGdyoG3yuMN5TBvyE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d1AaW/w0V35xyWLWcBtsMOoXiIqCA7kSQ2B7b+Zm5sHyWoYdz3YWc7mBLO/K22w0vSdQNcAQLPJWPPMRNoVnRfiP/WJ3giQ4lEvkCSBEMsbSheCnOMzW7g2vHccXWhu4MBVj/yczJ5SEASA3CoDPr5C3eKD/wV6pmIySq0jGvNU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=I4mq0iXe; arc=none smtp.client-ip=212.227.17.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1708343973; x=1708948773; i=w_armin@gmx.de; bh=jNbs6mh9NRNmcMy+geYDC/0FJuXGdyoG3yuMN5TBvyE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=I4mq0iXeFesQug4BYeka52DUBNP8YLI8wT2M2IDy8gtqTUhvc67lC7oOKd04Yqs/ XMxxUN3zGfXHQuvBr6gMSoTQkZcgB508c8VPiRk4JAzGnyDfnu0Lx90TiF8HxIPBI LnIGolY0b0HOEf0o80hkBQ9aPiw40WmgIYMnydVNsxvpa4QEUxsDb4/2uIC/W0zyp ANBj8Wb2WvZlkMskAPHq49bdf5FWE69J14yPdzvR1JS8PEJS7/rvjPmKuFhNaxkFk uW+F9fdEgz52haLW3W7uohoZVE4/hSeV+QVqZRGk14BlHzyRafckeAZs8Cgl3ChZ6 nI+VPfEfCo/D3Y/dVA== 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 (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MS3il-1rUaKc07kh-00TR3q; Mon, 19 Feb 2024 12:59:33 +0100 From: Armin Wolf To: corentin.chary@gmail.com, luke@ljones.dev Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] Revert "platform/x86: asus-wmi: Support WMI event queue" Date: Mon, 19 Feb 2024 12:59:19 +0100 Message-Id: <20240219115919.16526-6-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219115919.16526-1-W_Armin@gmx.de> References: <20240219115919.16526-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:ZJ35nPdHK8By7gcfdclwJO+Zz2VmNR2oBXLTl1BfboyzseFu4eM 9j0u4g9AnK4alZu5BgzD1/RrSyATmuST0UgaMyYSg44fH80oZRxZx+l2Ejej8RujZIsDSQt 3YScrQCg2HB/DrYN5fOQJ0A45lpjER+tb13KsNf8H7CSTBrswl333dGGPVLIgP15EKZ/vHA XvC4TfXpBMqlYS5Vs6UAw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Q79NRxKhYPU=;eELxmKwKpi3aicwQv7bWuu442fg 5ivSD5qpdpakCi748gekkHyOzAnbt4cgowvdS2dxunpxFNLiDTd5iJyvYKQYzAEb546c+YrR0 pC2u4ztK81cPvnfeCJm9rWvQfbxheVhN/Ue5L4Cs4i5q9ET2UpVeUC42A/42yHoVjJqAe7bpp tiRzZyrwU+qdDmQ00MtPCkYwjLPia+p+frjkOzxVNfz81JqbS1ROIKBDj80rSFPxTIlEkwUtc UbX9PIi4py/ZqPETtvx/U9PLVd110ASe03cLKSZEwRaeYM7q9uyLHsQLA0JrfUGdJH2UodVfo vv4Sq7Hc4JlT+8nHZdEZ5crfMfKP9asoHYLQhmIFqJzDeSgeXbIBZRJRNGm4OYgqZNFtZwqhA 40Q9c9qhiIx6RTVlCIuxoHdujJCV3W0m5lttOaKPUiR7K4AqftlhGMFLnmacP8fgcIZKzz08S Pcs/FMqSae/o7LefEeghybqlwOTh5WYdvr5zzn1gp9oLrR0+QE6pebZakBueYZn7Cj48XvROn E6Icbyh41zh+SA0+iYjtpgacOKdZWGp2mFfUCE6ObbW4HxfUqOk2IbXSrI5BCtHYk32NcbkjK qL6zYJS9dqByjqcCC25CxlDknPS8fovTg3swtsNBzJE2SUyIkZpFPu+2nfpzj+/SV2wVdZvD5 bC9f6wgt3hjC4tOuGeHlH5d1r9eLb1drxSEjb8jGouZBT4RYyrtKCdE/j5GLjdrZXqgsEDAa0 d8KQmrPFF219Sd4Jqpl9j3fVqoyrSRQn9HElySRbS4mD3bP7qm1FwoaxCkpPEVLzFlDfTbmmq FGl8z4CeBY7eURaysQcEH9s6AJC02RXsJLxHNzEHdjeks= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791328584884273792 X-GMAIL-MSGID: 1791328584884273792 This reverts commit 1a373d15e283937b51eaf5debf4fc31474c31436. The WMI core now takes care of draining the event queue if asus-wmi is not loaded, so the hacky event queue handling code is not needed anymore. Signed-off-by: Armin Wolf --- drivers/platform/x86/asus-wmi.c | 71 +++------------------------------ 1 file changed, 5 insertions(+), 66 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 21dee425ea6f..2865af89e95c 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -101,13 +101,6 @@ module_param(fnlock_default, bool, 0444); #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 #define ASUS_ACPI_UID_ASUSWMI "ASUSWMI" -#define ASUS_ACPI_UID_ATK "ATK" - -#define WMI_EVENT_QUEUE_SIZE 0x10 -#define WMI_EVENT_QUEUE_END 0x1 -#define WMI_EVENT_MASK 0xFFFF -/* The WMI hotkey event value is always the same. */ -#define WMI_EVENT_VALUE_ATK 0xFF #define WMI_EVENT_MASK 0xFFFF @@ -219,7 +212,6 @@ struct asus_wmi { int dsts_id; int spec; int sfun; - bool wmi_event_queue; struct input_dev *inputdev; struct backlight_device *backlight_device; @@ -4019,50 +4011,14 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) static void asus_wmi_notify(u32 value, void *context) { struct asus_wmi *asus = context; - int code; - int i; - - for (i = 0; i < WMI_EVENT_QUEUE_SIZE + 1; i++) { - code = asus_wmi_get_event_code(value); - if (code < 0) { - pr_warn("Failed to get notify code: %d\n", code); - return; - } - - if (code == WMI_EVENT_QUEUE_END || code == WMI_EVENT_MASK) - return; - - asus_wmi_handle_event_code(code, asus); - - /* - * Double check that queue is present: - * ATK (with queue) uses 0xff, ASUSWMI (without) 0xd2. - */ - if (!asus->wmi_event_queue || value != WMI_EVENT_VALUE_ATK) - return; - } + int code = asus_wmi_get_event_code(value); - pr_warn("Failed to process event queue, last code: 0x%x\n", code); -} - -static int asus_wmi_notify_queue_flush(struct asus_wmi *asus) -{ - int code; - int i; - - for (i = 0; i < WMI_EVENT_QUEUE_SIZE + 1; i++) { - code = asus_wmi_get_event_code(WMI_EVENT_VALUE_ATK); - if (code < 0) { - pr_warn("Failed to get event during flush: %d\n", code); - return code; - } - - if (code == WMI_EVENT_QUEUE_END || code == WMI_EVENT_MASK) - return 0; + if (code < 0) { + pr_warn("Failed to get notify code: %d\n", code); + return; } - pr_warn("Failed to flush event queue\n"); - return -EIO; + asus_wmi_handle_event_code(code, asus); } /* Sysfs **********************************************************************/ @@ -4302,23 +4258,6 @@ static int asus_wmi_platform_init(struct asus_wmi *asus) asus->dsts_id = ASUS_WMI_METHODID_DSTS; } - /* - * Some devices can have multiple event codes stored in a queue before - * the module load if it was unloaded intermittently after calling - * the INIT method (enables event handling). The WMI notify handler is - * expected to retrieve all event codes until a retrieved code equals - * queue end marker (One or Ones). Old codes are flushed from the queue - * upon module load. Not enabling this when it should be has minimal - * visible impact so fall back if anything goes wrong. - */ - wmi_uid = wmi_get_acpi_device_uid(asus->driver->event_guid); - if (wmi_uid && !strcmp(wmi_uid, ASUS_ACPI_UID_ATK)) { - dev_info(dev, "Detected ATK, enable event queue\n"); - - if (!asus_wmi_notify_queue_flush(asus)) - asus->wmi_event_queue = true; - } - /* CWAP allow to define the behavior of the Fn+F2 key, * this method doesn't seems to be present on Eee PCs */ if (asus->driver->quirks->wapf >= 0)