All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Armin Wolf <W_Armin@gmx.de>,
	ilpo.jarvinen@linux.intel.com, hdegoede@redhat.com,
	chumuzero@gmail.com, corbet@lwn.net, cs@tuxedo.de,
	wse@tuxedocomputers.com, ggo@tuxedocomputers.com
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] platform/x86: Add Uniwill WMI driver
Date: Wed, 18 Jun 2025 09:23:30 +0200	[thread overview]
Message-ID: <834849c2-2793-4f3a-b686-5e5ded713379@kernel.org> (raw)
In-Reply-To: <8126f0b8-c12e-4917-8f3e-f7b4a620aea2@gmx.de>

Hi,

On 17-Jun-25 11:10 PM, Armin Wolf wrote:
> Am 16.06.25 um 11:21 schrieb Hans de Goede:
> 
>> On 15-Jun-25 19:59, Armin Wolf wrote:
>>> Add a new driver for handling WMI events on Uniwill laptops.
>>> The driver sadly cannot use the WMI GUID for autoloading since Uniwill
>>> just copied it from the Windows driver example.
>>>
>>> The driver is reverse-engineered based on the following information:
>>> - https://github.com/pobrn/qc71_laptop
>>> - https://github.com/tuxedocomputers/tuxedo-drivers
>>> - various OEM software
>>>
>>> Reported-by: cyear <chumuzero@gmail.com>
>>> Closes: https://github.com/lm-sensors/lm-sensors/issues/508
>>> Closes: https://github.com/Wer-Wolf/uniwill-laptop/issues/3
>>> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
>>> ---

...

>>> +static void uniwill_wmi_notify(struct wmi_device *wdev, union acpi_object *obj)
>>> +{
>>> +    struct uniwill_wmi_data *data = dev_get_drvdata(&wdev->dev);
>>> +    u32 value;
>>> +    int ret;
>>> +
>>> +    if (obj->type != ACPI_TYPE_INTEGER)
>>> +        return;
>>> +
>>> +    value = obj->integer.value;
>>> +
>>> +    dev_dbg(&wdev->dev, "Received WMI event %u\n", value);
>>> +
>>> +    ret = blocking_notifier_call_chain(&uniwill_wmi_chain_head, value, NULL);
>>> +    if (ret == NOTIFY_BAD)
>>> +        return;
>>> +
>>> +    mutex_lock(&data->input_lock);
>>> +    sparse_keymap_report_event(data->input_device, value, 1, true);
>>> +    mutex_unlock(&data->input_lock);
>>> +}
>>> +
>>> +static int uniwill_wmi_probe(struct wmi_device *wdev, const void *context)
>>> +{
>>> +    struct uniwill_wmi_data *data;
>>> +    int ret;
>> Hmm, if someone manually modprobe-s this because they think it will
>> help it will still load despite the generic GUID thing.
>>
>> I think this should the same DMI allow-list as the -laptop driver?
>>
>> Or maybe just export the driver as a symbol and have -laptop do
>> the actual registering of the driver ? Then if e.g. a force module
>> option gets added to the -laptop driver that will not need to
>> be duplicated here ...
>>
>> Regards,
>>
>> Hans
> 
> I do not think that a allow-list is necessary here, because the driver
> cannot cause any hardware damage. The driver only listens to firmware
> events, it does not access the underlying hardware in any way.
> 
> If someone really does load this driver manually on an unsupported device
> then the worst things that will happen are random hotkey presses. In most
> cases nothing will happen.

That is true. Still it feels a bit wrong to have this potentially
bind to a completely different WMI device which happens to share
the GUID.

Anyways I'll it up to you if you want to do something about this.

Regards,

Hans




  reply	other threads:[~2025-06-18  7:23 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-15 17:59 [RFC PATCH 0/3] platform/x86: Add support for Uniwill laptop features Armin Wolf
2025-06-15 17:59 ` [RFC PATCH 1/3] platform/x86: Add Uniwill WMI driver Armin Wolf
2025-06-15 18:46   ` Randy Dunlap
2025-06-15 19:05   ` ALOK TIWARI
2025-06-17 20:58     ` Armin Wolf
2025-06-15 20:32   ` Randy Dunlap
2025-06-16  9:21   ` Hans de Goede
2025-06-17 21:10     ` Armin Wolf
2025-06-18  7:23       ` Hans de Goede [this message]
2025-06-16 11:14   ` Werner Sembach
2025-06-15 17:59 ` [RFC PATCH 2/3] platform/x86: Add Uniwill laptop driver Armin Wolf
2025-06-15 19:00   ` Randy Dunlap
2025-06-17 21:40     ` Armin Wolf
2025-06-15 20:39   ` Randy Dunlap
2025-06-16  8:10   ` Ilpo Järvinen
2025-06-17 21:47     ` Armin Wolf
2025-06-16 12:32   ` Werner Sembach
2025-06-17 21:50     ` Armin Wolf
2025-06-18 11:15       ` Werner Sembach
2025-06-22 18:58         ` Armin Wolf
2025-06-16 12:46   ` Werner Sembach
2025-06-17 21:52     ` Armin Wolf
2025-06-19  9:47       ` Lee Jones
2025-06-19 12:30         ` Hans de Goede
2025-06-19 15:17           ` Lee Jones
2025-06-19 20:03             ` Hans de Goede
2025-06-22 19:19               ` Armin Wolf
2025-06-22 21:37   ` Pőcze Barnabás
2025-06-22 22:36     ` Armin Wolf
2025-06-25 15:59       ` Pőcze Barnabás
2025-06-27 23:09         ` Armin Wolf
2025-06-30 12:32           ` Werner Sembach
2025-06-30 12:40             ` Armin Wolf
2025-06-30 12:55               ` Werner Sembach
2025-06-30 13:21                 ` Armin Wolf
2025-06-15 17:59 ` [RFC PATCH 3/3] Documentation: laptops: Add documentation for uniwill laptops Armin Wolf
2025-06-18  6:23   ` Randy Dunlap
2025-06-18 20:06     ` Armin Wolf
2025-06-16 12:59 ` [RFC PATCH 0/3] platform/x86: Add support for Uniwill laptop features Werner Sembach
2025-06-17 22:02   ` Armin Wolf

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=834849c2-2793-4f3a-b686-5e5ded713379@kernel.org \
    --to=hansg@kernel.org \
    --cc=W_Armin@gmx.de \
    --cc=chumuzero@gmail.com \
    --cc=corbet@lwn.net \
    --cc=cs@tuxedo.de \
    --cc=ggo@tuxedocomputers.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=wse@tuxedocomputers.com \
    /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.