From: Hans de Goede <hdegoede@redhat.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Jean Delvare <jdelvare@suse.com>
Cc: Hans de Goede <hdegoede@redhat.com>, Takashi Iwai <tiwai@suse.de>,
"russianneuromancer @ ya . ru" <russianneuromancer@ya.ru>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel cmdline option
Date: Sat, 25 Feb 2017 18:23:55 +0100 [thread overview]
Message-ID: <20170225172357.26294-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20170225172357.26294-1-hdegoede@redhat.com>
Unfortunately some firmware has all the DMI strings filled with:
"Default String" (or something equally useless). This makes it impossible
to apply DMI based quirks to certain machines.
This commit adds a dmi_product_name kernel cmdline option which can
be used to override the DMI_PRODUCT_NAME string, so that DMI based
quirks can still be used on such boards, there are 3 reasons for this:
1) Rather then add cmdline options for all things which can be DMI quirked
and thus may need to be specified, this only requires adding code for
a single extra cmdline option
2) Some devices can be quite quirky, e.g. the GPD win mini laptop /
clamshell x86 machine, needing several quirks in both kernel and userspace
(udev hwdb) in this case being able to fake a unique dmi product name
allows making these devices usable with a single kernel cmdline option
rather then requiring multiple kernel cmdline options + manual userspace
tweaking
3) In some case we may be able to successfully get the manufacturer to
fix the DMI strings with a firmware update, but not all users may want
to update, this will allow users to use DMI based quirks without forcing
them to update their firmware
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note the GPD win: http://www.gpd.hk/gpdwin.asp is the main reason I wrote
this patch. I've requested the manufacturer to do a BIOS update fixing the
DMI strings, but I cannot guarantee that that will happen.
---
drivers/firmware/dmi_scan.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 54be60e..c99e753 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -1047,3 +1047,17 @@ void dmi_memdev_name(u16 handle, const char **bank, const char **device)
}
}
EXPORT_SYMBOL_GPL(dmi_memdev_name);
+
+static int __init dmi_parse_dmi_product_name(char *str)
+{
+ static char prod_name[32];
+
+ if (!str)
+ return -EINVAL;
+
+ strlcpy(prod_name, str, sizeof(prod_name));
+ dmi_ident[DMI_PRODUCT_NAME] = prod_name;
+
+ return 0;
+}
+early_param("dmi_product_name", dmi_parse_dmi_product_name);
--
2.9.3
next prev parent reply other threads:[~2017-02-25 17:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-25 17:23 [PATCH 0/3] Allow setting dmi-product-name on the cmdline + dmi sdhci quirk Hans de Goede
2017-02-25 17:23 ` Hans de Goede [this message]
2017-03-03 9:24 ` [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel cmdline option Jean Delvare
2017-03-03 14:27 ` Hans de Goede
2017-03-09 9:59 ` Jean Delvare
2017-03-09 10:43 ` Hans de Goede
2017-03-20 17:35 ` Takashi Iwai
2017-04-04 10:21 ` Hans de Goede
2017-02-25 17:23 ` [PATCH 2/3] mmc: sdhci-acpi: Check device status before calling fix_up_power() Hans de Goede
2017-02-25 18:31 ` Hans de Goede
2017-03-02 11:53 ` Adrian Hunter
2017-03-03 9:09 ` Jean Delvare
2017-03-03 13:59 ` Hans de Goede
2017-02-25 17:23 ` [PATCH 3/3] mmc: sdhci-acpi: Add a quirk to not break wifi on GPD WIN I55 machines 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=20170225172357.26294-2-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=jdelvare@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=russianneuromancer@ya.ru \
--cc=tiwai@suse.de \
--cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox