* [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
@ 2016-08-29 9:55 Lee, Chun-Yi
2016-08-29 10:11 ` Bjørn Mork
0 siblings, 1 reply; 8+ messages in thread
From: Lee, Chun-Yi @ 2016-08-29 9:55 UTC (permalink / raw)
To: Darren Hart
Cc: platform-driver-x86, linux-kernel, Lee, Chun-Yi, Bjørn Mork
The AMW0_GUID1 wmi is not only found on Acer family but also other
machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
driver handled those non-Acer machines by quirks list.
But actually acer-wmi driver was loaded on any machines that have
AMW0_GUID1. This behavior is strange because those machines should
be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
ideapad-laptop.
So, This patch adds the logic to check the machine that has AMW0_GUID1
should be in Acer/Packard Bell/Gateway white list. But, it still keeps
the quirk list of those supported non-acer machines for backward
compatible.
Cc: Bjørn Mork <bjorn@mork.no>
Cc: Darren Hart <dvhart@infradead.org>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
drivers/platform/x86/acer-wmi.c | 56 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 3bb3162..734f0da 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -355,6 +355,32 @@ static const struct dmi_system_id acer_blacklist[] __initconst = {
{}
};
+static const struct dmi_system_id amw0_whitelist[] __initconst = {
+ {
+ .ident = "Acer",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ },
+ },
+ {
+ .ident = "Gateway",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Gateway"),
+ },
+ },
+ {
+ .ident = "Packard Bell",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Packard Bell"),
+ },
+ },
+ {}
+};
+
+/*
+ * This quirk table is only for Acer/Gateway/Packard Bell family
+ * that those machines are supported by acer-wmi driver.
+ */
static const struct dmi_system_id acer_quirks[] __initconst = {
{
.callback = dmi_matched,
@@ -464,6 +490,17 @@ static const struct dmi_system_id acer_quirks[] __initconst = {
},
.driver_data = &quirk_acer_travelmate_2490,
},
+ {}
+};
+
+/*
+ * This quirk list is for those non-acer machines that have AMW0_GUID1
+ * but supported by acer-wmi in past days. Keeping this quirk list here
+ * is only for backward compatible. Please do not add new machine to
+ * here anymore. Those non-acer machines should be supported by
+ * appropriate wmi drivers.
+ */
+static const struct dmi_system_id non_acer_quirks[] __initconst = {
{
.callback = dmi_matched,
.ident = "Fujitsu Siemens Amilo Li 1718",
@@ -598,6 +635,7 @@ static void __init find_quirks(void)
{
if (!force_series) {
dmi_check_system(acer_quirks);
+ dmi_check_system(non_acer_quirks);
} else if (force_series == 2490) {
quirks = &quirk_acer_travelmate_2490;
}
@@ -2121,6 +2159,24 @@ static int __init acer_wmi_init(void)
find_quirks();
/*
+ * The AMW0_GUID1 wmi is not only found on Acer family but also other
+ * machines like Lenovo, Fujitsu and Medion. In the past days,
+ * acer-wmi driver handled those non-Acer machines by quirks list.
+ * But actually acer-wmi driver was loaded on any machines that have
+ * AMW0_GUID1. This behavior is strange because those machines should
+ * be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
+ * ideapad-laptop. So, here checks the machine that has AMW0_GUID1
+ * should be in Acer/Gateway/Packard Bell white list, or it's already
+ * in the past quirk list.
+ */
+ if (wmi_has_guid(AMW0_GUID1) &&
+ !dmi_check_system(amw0_whitelist) &&
+ quirks == &quirk_unknown) {
+ pr_err("Unsupported machine has AMW0_GUID1, unable to load\n");
+ return -ENODEV;
+ }
+
+ /*
* Detect which ACPI-WMI interface we're using.
*/
if (wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1))
--
2.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
2016-08-29 9:55 Lee, Chun-Yi
@ 2016-08-29 10:11 ` Bjørn Mork
2016-08-29 12:55 ` joeyli
0 siblings, 1 reply; 8+ messages in thread
From: Bjørn Mork @ 2016-08-29 10:11 UTC (permalink / raw)
To: Lee, Chun-Yi; +Cc: Darren Hart, platform-driver-x86, linux-kernel, Lee, Chun-Yi
"Lee, Chun-Yi" <joeyli.kernel@gmail.com> writes:
> The AMW0_GUID1 wmi is not only found on Acer family but also other
> machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
> driver handled those non-Acer machines by quirks list.
>
> But actually acer-wmi driver was loaded on any machines that have
> AMW0_GUID1. This behavior is strange because those machines should
> be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
> ideapad-laptop.
>
> So, This patch adds the logic to check the machine that has AMW0_GUID1
> should be in Acer/Packard Bell/Gateway white list. But, it still keeps
> the quirk list of those supported non-acer machines for backward
> compatible.
Works fine for me on a Lenovo Thinkpad X1 Carbon 4th gen. Thanks.
Bogus accelerometer device without patch:
acer_wmi: Acer Laptop ACPI-WMI Extras
input: Acer BMA150 accelerometer as /devices/virtual/input/input16
With patch:
acer_wmi: Acer Laptop ACPI-WMI Extras
acer_wmi: Unsupported machine has AMW0_GUID1, unable to load
So if you want it:
Tested-by: Bjørn Mork <bjorn@mork.no>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
2016-08-29 10:11 ` Bjørn Mork
@ 2016-08-29 12:55 ` joeyli
0 siblings, 0 replies; 8+ messages in thread
From: joeyli @ 2016-08-29 12:55 UTC (permalink / raw)
To: Bjørn Mork
Cc: Lee, Chun-Yi, Darren Hart, platform-driver-x86, linux-kernel
Hi Bjørn,
On Mon, Aug 29, 2016 at 12:11:59PM +0200, Bjørn Mork wrote:
> "Lee, Chun-Yi" <joeyli.kernel@gmail.com> writes:
>
> > The AMW0_GUID1 wmi is not only found on Acer family but also other
> > machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
> > driver handled those non-Acer machines by quirks list.
> >
> > But actually acer-wmi driver was loaded on any machines that have
> > AMW0_GUID1. This behavior is strange because those machines should
> > be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
> > ideapad-laptop.
> >
> > So, This patch adds the logic to check the machine that has AMW0_GUID1
> > should be in Acer/Packard Bell/Gateway white list. But, it still keeps
> > the quirk list of those supported non-acer machines for backward
> > compatible.
>
> Works fine for me on a Lenovo Thinkpad X1 Carbon 4th gen. Thanks.
>
> Bogus accelerometer device without patch:
>
> acer_wmi: Acer Laptop ACPI-WMI Extras
> input: Acer BMA150 accelerometer as /devices/virtual/input/input16
>
> With patch:
>
> acer_wmi: Acer Laptop ACPI-WMI Extras
> acer_wmi: Unsupported machine has AMW0_GUID1, unable to load
>
>
> So if you want it:
>
> Tested-by: Bjørn Mork <bjorn@mork.no>
>
Thanks for your help for issue report and testing!
Joey Lee
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
@ 2016-10-12 23:32 Lee, Chun-Yi
0 siblings, 0 replies; 8+ messages in thread
From: Lee, Chun-Yi @ 2016-10-12 23:32 UTC (permalink / raw)
To: Darren Hart; +Cc: platform-driver-x86, linux-kernel, Lee, Chun-Yi
The AMW0_GUID1 wmi is not only found on Acer family but also other
machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
driver handled those non-Acer machines by quirks list.
But actually acer-wmi driver was loaded on any machines that have
AMW0_GUID1. This behavior is strange because those machines should
be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
ideapad-laptop.
So, This patch adds the logic to check the machine that has AMW0_GUID1
should be in Acer/Packard Bell/Gateway white list. But, it still keeps
the quirk list of those supported non-acer machines for backward
compatible.
Tested-by: Bjørn Mork <bjorn@mork.no>
Cc: Darren Hart <dvhart@infradead.org>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
drivers/platform/x86/acer-wmi.c | 56 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 3bb3162..734f0da 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -355,6 +355,32 @@ static const struct dmi_system_id acer_blacklist[] __initconst = {
{}
};
+static const struct dmi_system_id amw0_whitelist[] __initconst = {
+ {
+ .ident = "Acer",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ },
+ },
+ {
+ .ident = "Gateway",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Gateway"),
+ },
+ },
+ {
+ .ident = "Packard Bell",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Packard Bell"),
+ },
+ },
+ {}
+};
+
+/*
+ * This quirk table is only for Acer/Gateway/Packard Bell family
+ * that those machines are supported by acer-wmi driver.
+ */
static const struct dmi_system_id acer_quirks[] __initconst = {
{
.callback = dmi_matched,
@@ -464,6 +490,17 @@ static const struct dmi_system_id acer_quirks[] __initconst = {
},
.driver_data = &quirk_acer_travelmate_2490,
},
+ {}
+};
+
+/*
+ * This quirk list is for those non-acer machines that have AMW0_GUID1
+ * but supported by acer-wmi in past days. Keeping this quirk list here
+ * is only for backward compatible. Please do not add new machine to
+ * here anymore. Those non-acer machines should be supported by
+ * appropriate wmi drivers.
+ */
+static const struct dmi_system_id non_acer_quirks[] __initconst = {
{
.callback = dmi_matched,
.ident = "Fujitsu Siemens Amilo Li 1718",
@@ -598,6 +635,7 @@ static void __init find_quirks(void)
{
if (!force_series) {
dmi_check_system(acer_quirks);
+ dmi_check_system(non_acer_quirks);
} else if (force_series == 2490) {
quirks = &quirk_acer_travelmate_2490;
}
@@ -2121,6 +2159,24 @@ static int __init acer_wmi_init(void)
find_quirks();
/*
+ * The AMW0_GUID1 wmi is not only found on Acer family but also other
+ * machines like Lenovo, Fujitsu and Medion. In the past days,
+ * acer-wmi driver handled those non-Acer machines by quirks list.
+ * But actually acer-wmi driver was loaded on any machines that have
+ * AMW0_GUID1. This behavior is strange because those machines should
+ * be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
+ * ideapad-laptop. So, here checks the machine that has AMW0_GUID1
+ * should be in Acer/Gateway/Packard Bell white list, or it's already
+ * in the past quirk list.
+ */
+ if (wmi_has_guid(AMW0_GUID1) &&
+ !dmi_check_system(amw0_whitelist) &&
+ quirks == &quirk_unknown) {
+ pr_err("Unsupported machine has AMW0_GUID1, unable to load\n");
+ return -ENODEV;
+ }
+
+ /*
* Detect which ACPI-WMI interface we're using.
*/
if (wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1))
--
2.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
@ 2016-11-01 4:30 Lee, Chun-Yi
2016-11-03 3:40 ` Anthony Wong
0 siblings, 1 reply; 8+ messages in thread
From: Lee, Chun-Yi @ 2016-11-01 4:30 UTC (permalink / raw)
To: Darren Hart; +Cc: platform-driver-x86, linux-kernel, Lee, Chun-Yi
The AMW0_GUID1 wmi is not only found on Acer family but also other
machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
driver handled those non-Acer machines by quirks list.
But actually acer-wmi driver was loaded on any machines that have
AMW0_GUID1. This behavior is strange because those machines should
be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
ideapad-laptop.
So, This patch adds the logic to check the machine that has AMW0_GUID1
should be in Acer/Packard Bell/Gateway white list. But, it still keeps
the quirk list of those supported non-acer machines for backward
compatible.
Tested-by: Bjørn Mork <bjorn@mork.no>
Cc: Darren Hart <dvhart@infradead.org>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
drivers/platform/x86/acer-wmi.c | 56 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 3bb3162..734f0da 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -355,6 +355,32 @@ static const struct dmi_system_id acer_blacklist[] __initconst = {
{}
};
+static const struct dmi_system_id amw0_whitelist[] __initconst = {
+ {
+ .ident = "Acer",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ },
+ },
+ {
+ .ident = "Gateway",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Gateway"),
+ },
+ },
+ {
+ .ident = "Packard Bell",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Packard Bell"),
+ },
+ },
+ {}
+};
+
+/*
+ * This quirk table is only for Acer/Gateway/Packard Bell family
+ * that those machines are supported by acer-wmi driver.
+ */
static const struct dmi_system_id acer_quirks[] __initconst = {
{
.callback = dmi_matched,
@@ -464,6 +490,17 @@ static const struct dmi_system_id acer_quirks[] __initconst = {
},
.driver_data = &quirk_acer_travelmate_2490,
},
+ {}
+};
+
+/*
+ * This quirk list is for those non-acer machines that have AMW0_GUID1
+ * but supported by acer-wmi in past days. Keeping this quirk list here
+ * is only for backward compatible. Please do not add new machine to
+ * here anymore. Those non-acer machines should be supported by
+ * appropriate wmi drivers.
+ */
+static const struct dmi_system_id non_acer_quirks[] __initconst = {
{
.callback = dmi_matched,
.ident = "Fujitsu Siemens Amilo Li 1718",
@@ -598,6 +635,7 @@ static void __init find_quirks(void)
{
if (!force_series) {
dmi_check_system(acer_quirks);
+ dmi_check_system(non_acer_quirks);
} else if (force_series == 2490) {
quirks = &quirk_acer_travelmate_2490;
}
@@ -2121,6 +2159,24 @@ static int __init acer_wmi_init(void)
find_quirks();
/*
+ * The AMW0_GUID1 wmi is not only found on Acer family but also other
+ * machines like Lenovo, Fujitsu and Medion. In the past days,
+ * acer-wmi driver handled those non-Acer machines by quirks list.
+ * But actually acer-wmi driver was loaded on any machines that have
+ * AMW0_GUID1. This behavior is strange because those machines should
+ * be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
+ * ideapad-laptop. So, here checks the machine that has AMW0_GUID1
+ * should be in Acer/Gateway/Packard Bell white list, or it's already
+ * in the past quirk list.
+ */
+ if (wmi_has_guid(AMW0_GUID1) &&
+ !dmi_check_system(amw0_whitelist) &&
+ quirks == &quirk_unknown) {
+ pr_err("Unsupported machine has AMW0_GUID1, unable to load\n");
+ return -ENODEV;
+ }
+
+ /*
* Detect which ACPI-WMI interface we're using.
*/
if (wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1))
--
2.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
2016-11-01 4:30 [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family Lee, Chun-Yi
@ 2016-11-03 3:40 ` Anthony Wong
2016-11-03 4:14 ` joeyli
2016-11-05 18:27 ` Darren Hart
0 siblings, 2 replies; 8+ messages in thread
From: Anthony Wong @ 2016-11-03 3:40 UTC (permalink / raw)
To: Lee, Chun-Yi; +Cc: Darren Hart, platform-driver-x86, linux-kernel, Lee, Chun-Yi
On 1 November 2016 at 12:30, Lee, Chun-Yi <joeyli.kernel@gmail.com> wrote:
>
> The AMW0_GUID1 wmi is not only found on Acer family but also other
> machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
> driver handled those non-Acer machines by quirks list.
>
> But actually acer-wmi driver was loaded on any machines that have
> AMW0_GUID1. This behavior is strange because those machines should
> be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
> ideapad-laptop.
>
> So, This patch adds the logic to check the machine that has AMW0_GUID1
> should be in Acer/Packard Bell/Gateway white list. But, it still keeps
> the quirk list of those supported non-acer machines for backward
> compatible.
>
> Tested-by: Bjørn Mork <bjorn@mork.no>
> Cc: Darren Hart <dvhart@infradead.org>
> Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Xiaomi Air 13.3 notebook suffers from the same issue, acer-wmi
basically has no use on this machine. With your patch, acer-wmi no
longer loads.
Tested-by: Anthony Wong <anthony@ypwong.org>
Thanks,
Anthony
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
2016-11-03 3:40 ` Anthony Wong
@ 2016-11-03 4:14 ` joeyli
2016-11-05 18:27 ` Darren Hart
1 sibling, 0 replies; 8+ messages in thread
From: joeyli @ 2016-11-03 4:14 UTC (permalink / raw)
To: Anthony Wong; +Cc: Lee, Chun-Yi, Darren Hart, platform-driver-x86, linux-kernel
On Thu, Nov 03, 2016 at 11:40:15AM +0800, Anthony Wong wrote:
> On 1 November 2016 at 12:30, Lee, Chun-Yi <joeyli.kernel@gmail.com> wrote:
> >
> > The AMW0_GUID1 wmi is not only found on Acer family but also other
> > machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
> > driver handled those non-Acer machines by quirks list.
> >
> > But actually acer-wmi driver was loaded on any machines that have
> > AMW0_GUID1. This behavior is strange because those machines should
> > be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
> > ideapad-laptop.
> >
> > So, This patch adds the logic to check the machine that has AMW0_GUID1
> > should be in Acer/Packard Bell/Gateway white list. But, it still keeps
> > the quirk list of those supported non-acer machines for backward
> > compatible.
> >
> > Tested-by: Bjørn Mork <bjorn@mork.no>
> > Cc: Darren Hart <dvhart@infradead.org>
> > Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
>
> Xiaomi Air 13.3 notebook suffers from the same issue, acer-wmi
> basically has no use on this machine. With your patch, acer-wmi no
> longer loads.
>
> Tested-by: Anthony Wong <anthony@ypwong.org>
>
> Thanks,
> Anthony
Thanks for your testing!
Joey Lee
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family
2016-11-03 3:40 ` Anthony Wong
2016-11-03 4:14 ` joeyli
@ 2016-11-05 18:27 ` Darren Hart
1 sibling, 0 replies; 8+ messages in thread
From: Darren Hart @ 2016-11-05 18:27 UTC (permalink / raw)
To: Anthony Wong
Cc: Lee, Chun-Yi, platform-driver-x86, linux-kernel, Lee, Chun-Yi
On Thu, Nov 03, 2016 at 11:40:15AM +0800, Anthony Wong wrote:
> On 1 November 2016 at 12:30, Lee, Chun-Yi <joeyli.kernel@gmail.com> wrote:
> >
> > The AMW0_GUID1 wmi is not only found on Acer family but also other
> > machines like Lenovo, Fujitsu and Medion. In the past days, acer-wmi
> > driver handled those non-Acer machines by quirks list.
> >
> > But actually acer-wmi driver was loaded on any machines that have
> > AMW0_GUID1. This behavior is strange because those machines should
> > be supported by appropriate wmi drivers. e.g. fujitsu-laptop,
> > ideapad-laptop.
> >
> > So, This patch adds the logic to check the machine that has AMW0_GUID1
> > should be in Acer/Packard Bell/Gateway white list. But, it still keeps
> > the quirk list of those supported non-acer machines for backward
> > compatible.
> >
> > Tested-by: Bjørn Mork <bjorn@mork.no>
> > Cc: Darren Hart <dvhart@infradead.org>
> > Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
>
> Xiaomi Air 13.3 notebook suffers from the same issue, acer-wmi
> basically has no use on this machine. With your patch, acer-wmi no
> longer loads.
>
> Tested-by: Anthony Wong <anthony@ypwong.org>
I've already pushed this to -next, but thank you for the confirmation.
--
Darren Hart
Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-11-05 18:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-01 4:30 [PATCH] acer-wmi: only supports AMW0_GUID1 on acer family Lee, Chun-Yi
2016-11-03 3:40 ` Anthony Wong
2016-11-03 4:14 ` joeyli
2016-11-05 18:27 ` Darren Hart
-- strict thread matches above, loose matches on Subject: below --
2016-10-12 23:32 Lee, Chun-Yi
2016-08-29 9:55 Lee, Chun-Yi
2016-08-29 10:11 ` Bjørn Mork
2016-08-29 12:55 ` joeyli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).