From: Hans de Goede <hdegoede@redhat.com>
To: Mikalai Ramanovich <nikolay.romanovich.00@gmail.com>,
Mark Gross <markgross@kernel.org>
Cc: platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] platform/x86: wmi: change notification handler type
Date: Tue, 19 Oct 2021 17:11:51 +0200 [thread overview]
Message-ID: <2deb56e0-24a6-6615-d95e-e0efb7f86db2@redhat.com> (raw)
In-Reply-To: <20211015191322.73388-1-nikolay.romanovich.00@gmail.com>
Hi,
On 10/15/21 21:13, Mikalai Ramanovich wrote:
> Since AML code on some Xiaomi laptops notifies the WMI hotkey with
> 0x20 event, we need ACPI_ALL_NOTIFY here to be able to handle it.
>
> Signed-off-by: Mikalai Ramanovich <nikolay.romanovich.00@gmail.com>
Hmm, this is a rather unusual change and I'm worried that it may have
some bad side-effects.
Can you provide the model-number and an acpidump for the laptop where
you need this ? And maybe also point out which bit (which lines after
disassembling) of the DSDT needs this ?
ATM I'm thinking that it might be best to do something like this:
static u32 acpi_wmi_get_handler_type(void)
{
if (dmi_name_in_vendors("XIAOMI"))
return ACPI_ALL_NOTIFY;
else
return ACPI_DEVICE_NOTIFY;
}
status = acpi_install_notify_handler(acpi_device->handle,
acpi_wmi_get_handler_type(),
acpi_wmi_notify_handler,
NULL);
(and the same for the remove)
So that we limit this behavior to the Xiaomi case.
Note you may need to change the capitalization of XIAOMI to match
the value used in /sys/class/dmi/id/sys_vendor
Regards,
Hans
> ---
> drivers/platform/x86/wmi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index e6997be206f1..c34341f4da76 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -1352,7 +1352,7 @@ static int acpi_wmi_remove(struct platform_device *device)
> {
> struct acpi_device *acpi_device = ACPI_COMPANION(&device->dev);
>
> - acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY,
> + acpi_remove_notify_handler(acpi_device->handle, ACPI_ALL_NOTIFY,
> acpi_wmi_notify_handler);
> acpi_remove_address_space_handler(acpi_device->handle,
> ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler);
> @@ -1385,7 +1385,7 @@ static int acpi_wmi_probe(struct platform_device *device)
> }
>
> status = acpi_install_notify_handler(acpi_device->handle,
> - ACPI_DEVICE_NOTIFY,
> + ACPI_ALL_NOTIFY,
> acpi_wmi_notify_handler,
> NULL);
> if (ACPI_FAILURE(status)) {
> @@ -1414,7 +1414,7 @@ static int acpi_wmi_probe(struct platform_device *device)
> device_unregister(wmi_bus_dev);
>
> err_remove_notify_handler:
> - acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY,
> + acpi_remove_notify_handler(acpi_device->handle, ACPI_ALL_NOTIFY,
> acpi_wmi_notify_handler);
>
> err_remove_ec_handler:
>
next prev parent reply other threads:[~2021-10-19 15:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 19:13 [PATCH] platform/x86: wmi: change notification handler type Mikalai Ramanovich
2021-10-19 15:11 ` Hans de Goede [this message]
2021-10-21 17:25 ` Mikalai Ramanovich
2021-10-21 18:35 ` Hans de Goede
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=2deb56e0-24a6-6615-d95e-e0efb7f86db2@redhat.com \
--to=hdegoede@redhat.com \
--cc=markgross@kernel.org \
--cc=nikolay.romanovich.00@gmail.com \
--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.