[PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks

Akihiko Odaki posted 1 patch 3 years, 9 months ago
There is a newer version of this series
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
[PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks
Posted by Akihiko Odaki 3 years, 9 months ago
Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
functionalities, even including the registers necessary for feature
detections.

The behavior was observed with Lenovo ThinkPad C13 Yoga.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index dadc491bbf6b..b91e1c95e543 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -197,6 +197,18 @@ static const struct dmi_system_id dmi_sensor_mask_overrides[] = {
 		},
 		.driver_data = (void *)(ACEL_EN | MAGNO_EN),
 	},
+	{
+		/*
+		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
+		 * Hub instead of Sensor Hub Fusion and leaves MP2
+		 * uninitialized, which disables all functionalities, even
+		 * including the registers necessary for feature detections.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+		},
+		.driver_data = (void *)0,
+	},
 	{ }
 };
 
-- 
2.36.1
Re: [PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks
Posted by Basavaraj Natikar 3 years, 9 months ago

On 7/14/2022 11:07 AM, Akihiko Odaki wrote:
> Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
> of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
> functionalities, even including the registers necessary for feature
> detections.
>
> The behavior was observed with Lenovo ThinkPad C13 Yoga.
>
>
This driver should not get loaded in chrome OS by default.
Could you please provide details of Chrome OS Version and Kernel version to confirm the behavior.

Are you enabling manually CONFIG_AMD_SFH_HID config? 

Thanks,
Basavaraj
Re: [PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks
Posted by Akihiko Odaki 3 years, 9 months ago
On 2022/07/15 13:41, Basavaraj Natikar wrote:
> 
> 
> On 7/14/2022 11:07 AM, Akihiko Odaki wrote:
>> Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
>> of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
>> functionalities, even including the registers necessary for feature
>> detections.
>>
>> The behavior was observed with Lenovo ThinkPad C13 Yoga.
>>
>>
> This driver should not get loaded in chrome OS by default.
> Could you please provide details of Chrome OS Version and Kernel version to confirm the behavior.
> 
> Are you enabling manually CONFIG_AMD_SFH_HID config?
> 
> Thanks,
> Basavaraj
> 

I use Fedora 36, not Chrome OS. The config is enabled on Fedora's 
generic kernel. The kernel is built from commit 
78ca55889a549a9a194c6ec666836329b774ab6d from the upstream.

Regards,
Akihiko Odaki
RE: [PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks
Posted by Limonciello, Mario 3 years, 8 months ago
[Public]

> -----Original Message-----
> From: Akihiko Odaki <akihiko.odaki@gmail.com>
> Sent: Thursday, July 14, 2022 23:46
> To: Natikar, Basavaraj <Basavaraj.Natikar@amd.com>
> Cc: Natikar, Basavaraj <Basavaraj.Natikar@amd.com>; Jiri Kosina
> <jikos@kernel.org>; Benjamin Tissoires <benjamin.tissoires@redhat.com>;
> linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; Limonciello,
> Mario <Mario.Limonciello@amd.com>
> Subject: Re: [PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks
> 
> On 2022/07/15 13:41, Basavaraj Natikar wrote:
> >
> >
> > On 7/14/2022 11:07 AM, Akihiko Odaki wrote:
> >> Google Chromebooks use Chrome OS Embedded Controller Sensor Hub
> instead
> >> of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
> >> functionalities, even including the registers necessary for feature
> >> detections.
> >>
> >> The behavior was observed with Lenovo ThinkPad C13 Yoga.
> >>
> >>
> > This driver should not get loaded in chrome OS by default.
> > Could you please provide details of Chrome OS Version and Kernel version
> to confirm the behavior.
> >
> > Are you enabling manually CONFIG_AMD_SFH_HID config?
> >
> > Thanks,
> > Basavaraj
> >
> 
> I use Fedora 36, not Chrome OS. The config is enabled on Fedora's
> generic kernel. The kernel is built from commit
> 78ca55889a549a9a194c6ec666836329b774ab6d from the upstream.
> 
> Regards,
> Akihiko Odaki

Akihiko,

FWIW - I think your patch is the correct direction for your situation (trying to load
Fedora onto a system that previously shipped with ChromeOS).

I think you just need to check the question that I had about discovery registers and
if that probing is still a problem or not.

Thanks,
Re: [PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks
Posted by Basavaraj Natikar 3 years, 9 months ago
On 7/14/2022 11:07 AM, Akihiko Odaki wrote:
> Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
> of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
> functionalities, even including the registers necessary for feature
> detections.
>
> The behavior was observed with Lenovo ThinkPad C13 Yoga.

We are checking for few things with respect to this issue
internally.

Please hold on this patch. we will get back soon.

Thanks,
Basavaraj
Re: [PATCH v2] AMD_SFH: Add a DMI quirk entry for Chromebooks
Posted by Mario Limonciello 3 years, 9 months ago
On 7/14/22 00:37, Akihiko Odaki wrote:
> Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
> of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
> functionalities, even including the registers necessary for feature
> detections.
> 
> The behavior was observed with Lenovo ThinkPad C13 Yoga.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> index dadc491bbf6b..b91e1c95e543 100644
> --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> @@ -197,6 +197,18 @@ static const struct dmi_system_id dmi_sensor_mask_overrides[] = {
>   		},
>   		.driver_data = (void *)(ACEL_EN | MAGNO_EN),
>   	},
> +	{
> +		/*
> +		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
> +		 * Hub instead of Sensor Hub Fusion and leaves MP2
> +		 * uninitialized, which disables all functionalities, even
> +		 * including the registers necessary for feature detections.
> +		 */
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
> +		},
> +		.driver_data = (void *)0,
> +	},
>   	{ }
>   };
>   

Did you miss my other comment on v1 on discovery sensor probing or is it 
not a problem?