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


Groups > linux.kernel > #1615872 > unrolled thread

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

Started byHans de Goede <hdegoede@redhat.com>
First post2017-04-04 12:30 +0200
Last post2017-04-04 12:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

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

FromHans de Goede <hdegoede@redhat.com>
Date2017-04-04 12:30 +0200
SubjectRe: [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel cmdline option
Message-ID<tstSO-3z3-27@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web