[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YhkQKfE8ErtFBmSB@zx2c4.com>
Date: Fri, 25 Feb 2022 18:21:45 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Alexander Graf <graf@...zon.com>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Len Brown <lenb@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Greg KH <gregkh@...uxfoundation.org>,
"Woodhouse, David" <dwmw@...zon.co.uk>
Subject: Re: [PATCH] ACPI: bus: Match first 9 bytes of device IDs
On Fri, Feb 25, 2022 at 6:13 PM Ard Biesheuvel <ardb@...nel.org> wrote:
>
> The device subsystem side of things already deals with this properly:
> the modalias of the QEMU vmgenid device comes up as
> 'acpi:QEMUVGID:VM_GEN_COUNTER', which means it already captures the
> entire string, and exposes it in the correct way (modulo the all caps)
Ahh, so the userspace side of this won't work right. Shucks. That's what
I was concerned about.
> I don't like this hack. If we are going to accept the fact that CIDs
> could be arbitrary length strings, we should handle them properly.
>
> So what we need is a way for a module to describe its compatibility
> with such a _CID, which shouldn't be that complicated.
Can't we do something more boring and just...
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 4bb71979a8fd..5da5d990ff58 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -210,9 +210,9 @@ struct css_device_id {
__u8 type; /* subchannel type */
kernel_ulong_t driver_data;
};
-#define ACPI_ID_LEN 9
+#define ACPI_ID_LEN 16
struct acpi_device_id {
__u8 id[ACPI_ID_LEN];
kernel_ulong_t driver_data;
As you can see from the context, those additional 7 bytes were being
wasted on padding anyway inside the acpi_device_id struct, so it's
basically free, it would seem. This seems like the least convoluted way
of solving this issue? If we ever encounter _more_ ACPI devices with
weird names, we could revisit a fancy dynamic solution, but for now, why
don't we keep it simple?
Jason
Powered by blists - more mailing lists