Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1615872

Re: [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel cmdline option

From Hans de Goede <hdegoede@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel cmdline option
Date 2017-04-04 12:30 +0200
Message-ID <tstSO-3z3-27@gated-at.bofh.it> (permalink)
References (1 earlier) <teOkp-2Fm-3@gated-at.bofh.it> <tgRHc-7yR-11@gated-at.bofh.it> <tgWxd-2tg-39@gated-at.bofh.it> <tj31v-3pp-9@gated-at.bofh.it> <tj3NT-3XL-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On 09-03-17 11:43, Hans de Goede wrote:
> Hi,
>
> On 09-03-17 10:59, Jean Delvare wrote:

<snip>

>>> So I would really like to see support for this kernel cmdline option merged.
>>> Takashi Iwai has been working on some quirks for headphone detection for
>>> the GPDwin machine, which also rely on being able to use a fake dmi_id to
>>> identify the machine.
>>
>> I'll discuss that with Takashi when he returns from vacation.
>
> Ok, lets wait for that then.

So Takashi is back (and has responded) but in the mean time
I've been thinking about this and tried to find a better solution
as I really want the kernel to do the right thing automatically.

So I've been dumping all the /sys/class/dmi/id strings on all
Bay Trail and Cherry Trail devices I've (7 different models)
and seeing if anything stands out.

The GPDwin for which I mainly wrote this patch is the only
one to set board_vendor to "AMI Corporation", which is a
string one would usually expect in bios_vendor. So I decided
that we can use normal DMI matching for this after all,
to play things safe I've also added a check for the bios_date
(which should be reasonable unique) + 2 other strings,
resulting in:

+static const struct dmi_system_id fix_up_power_blacklist[] = {
+	{
+		/*
+		 * Match for the GPDwin which unfortunately uses somewhat
+		 * generic dmi strings, which is why the bios-date match is
+		 * included and we need multiple entries :| These strings have
+		 * been checked against 6 other byt/cht boards and board_vendor
+		 * and board_name are unique to the GPDwin (in the test set)
+		 * where as only one other board has the same board_version.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "Default string"),
+			DMI_MATCH(DMI_BOARD_VERSION, "Default string"),
+			DMI_MATCH(DMI_BIOS_DATE, "10/25/2016"),
+		},
+	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "Default string"),
+			DMI_MATCH(DMI_BOARD_VERSION, "Default string"),
+			DMI_MATCH(DMI_BIOS_DATE, "11/18/2016"),
+		},
+	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "Default string"),
+			DMI_MATCH(DMI_BOARD_VERSION, "Default string"),
+			DMI_MATCH(DMI_BIOS_DATE, "02/21/2017"),
+		},
+	},
+	{ }
+};

Which is not the prettiest but gets the job done and has the big
advantage over my dmi_product_name kernel cmdline option proposal
that it will just work. So you can consider this patch dropped
from my pov.

Regards,

Hans

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel  cmdline option Hans de Goede <hdegoede@redhat.com> - 2017-04-04 12:30 +0200

csiph-web