mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] AMD_SFH: Add a DMI quirk entry for Chromebooks
@ 2022-07-10  8:15 Akihiko Odaki
  2022-07-14  4:41 ` Mario Limonciello
  0 siblings, 1 reply; 2+ messages in thread
From: Akihiko Odaki @ 2022-07-10  8:15 UTC (permalink / raw)
  Cc: Basavaraj Natikar, Jiri Kosina, Benjamin Tissoires, linux-input,
	linux-kernel, Akihiko Odaki

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>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] AMD_SFH: Add a DMI quirk entry for Chromebooks
  2022-07-10  8:15 [PATCH] AMD_SFH: Add a DMI quirk entry for Chromebooks Akihiko Odaki
@ 2022-07-14  4:41 ` Mario Limonciello
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello @ 2022-07-14  4:41 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Basavaraj Natikar, Jiri Kosina, Benjamin Tissoires, linux-input,
	linux-kernel

On 7/10/22 03:15, 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.
> 

You missed that I suggested this from your earlier patch, you should add:

Suggested-by: Mario Limonciello <mario.limonciello@amd.com>

> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.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,
> +	},
>   	{ }
>   };
>   

Is this enough actually?  I would think you need to also modify 
amd_sfh_hid_client_init to special case the situation of "no sensors" 
and return -ENODEV otherwise it's going to try to read discovery status 
too and that might not be safe and deterministic.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-14  4:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-10  8:15 [PATCH] AMD_SFH: Add a DMI quirk entry for Chromebooks Akihiko Odaki
2022-07-14  4:41 ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®