public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
@ 2023-10-18 23:59 Mark Hasemeyer
  2023-10-19 14:22 ` Amadeusz Sławiński
  2023-10-20 15:40 ` Takashi Iwai
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Hasemeyer @ 2023-10-18 23:59 UTC (permalink / raw)
  To: LKML
  Cc: Dmitry Torokhov, Guenter Roeck, stable, Mark Hasemeyer,
	Amadeusz Sławiński, Andy Shevchenko, Bard Liao,
	Brady Norander, Jaroslav Kysela, Mark Brown, Pierre-Louis Bossart,
	Takashi Iwai, alsa-devel

Some Jasperlake Chromebooks overwrite the system vendor DMI value to the
name of the OEM that manufactured the device. This breaks Chromebook
quirk detection as it expects the system vendor to be "Google".

Add another quirk detection entry that looks for "Google" in the BIOS
version.

Cc: stable@vger.kernel.org
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---

 sound/hda/intel-dsp-config.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
index 24a948baf1bc..756fa0aa69bb 100644
--- a/sound/hda/intel-dsp-config.c
+++ b/sound/hda/intel-dsp-config.c
@@ -336,6 +336,12 @@ static const struct config_entry config_table[] = {
 					DMI_MATCH(DMI_SYS_VENDOR, "Google"),
 				}
 			},
+			{
+				.ident = "Google firmware",
+				.matches = {
+					DMI_MATCH(DMI_BIOS_VERSION, "Google"),
+				}
+			},
 			{}
 		}
 	},
-- 
2.42.0.655.g421f12c284-goog


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

* Re: [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
  2023-10-18 23:59 [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection Mark Hasemeyer
@ 2023-10-19 14:22 ` Amadeusz Sławiński
  2023-10-19 16:43   ` Mark Hasemeyer
  2023-10-20 15:40 ` Takashi Iwai
  1 sibling, 1 reply; 8+ messages in thread
From: Amadeusz Sławiński @ 2023-10-19 14:22 UTC (permalink / raw)
  To: Mark Hasemeyer, LKML
  Cc: Dmitry Torokhov, Guenter Roeck, stable, Andy Shevchenko,
	Bard Liao, Brady Norander, Jaroslav Kysela, Mark Brown,
	Pierre-Louis Bossart, Takashi Iwai, alsa-devel

On 10/19/2023 1:59 AM, Mark Hasemeyer wrote:
> Some Jasperlake Chromebooks overwrite the system vendor DMI value to the
> name of the OEM that manufactured the device. This breaks Chromebook
> quirk detection as it expects the system vendor to be "Google".
> 
> Add another quirk detection entry that looks for "Google" in the BIOS
> version.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
> 
>   sound/hda/intel-dsp-config.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
> index 24a948baf1bc..756fa0aa69bb 100644
> --- a/sound/hda/intel-dsp-config.c
> +++ b/sound/hda/intel-dsp-config.c
> @@ -336,6 +336,12 @@ static const struct config_entry config_table[] = {
>   					DMI_MATCH(DMI_SYS_VENDOR, "Google"),
>   				}
>   			},
> +			{
> +				.ident = "Google firmware",
> +				.matches = {
> +					DMI_MATCH(DMI_BIOS_VERSION, "Google"),
> +				}
> +			},
>   			{}
>   		}
>   	},

I would assume that platform that has DMI_SYS_VENDOR set to "Google", 
also has DMI_BIOS_VERSION set to "Google", so perhaps just replace 
DMI_SYS_VENDOR match with DMI_BIOS_VERSION, to keep table small? Or is 
that not a case?

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

* Re: [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
  2023-10-19 14:22 ` Amadeusz Sławiński
@ 2023-10-19 16:43   ` Mark Hasemeyer
  2023-10-19 17:00     ` Pierre-Louis Bossart
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Hasemeyer @ 2023-10-19 16:43 UTC (permalink / raw)
  To: Amadeusz Sławiński
  Cc: LKML, Dmitry Torokhov, Guenter Roeck, stable, Andy Shevchenko,
	Bard Liao, Brady Norander, Jaroslav Kysela, Mark Brown,
	Pierre-Louis Bossart, Takashi Iwai, alsa-devel

> I would assume that platform that has DMI_SYS_VENDOR set to "Google",
> also has DMI_BIOS_VERSION set to "Google", so perhaps just replace
> DMI_SYS_VENDOR match with DMI_BIOS_VERSION, to keep table small? Or is
> that not a case?

That is the case. But I'm inclined to keep it for two reasons:
1. There is precedent in the kernel to use DMI_SYS_VENDOR=="Google"
for Chromebook detection.
2. If the coreboot version schema for Chromebooks were to change, this
check would fail for all JSL Chromebooks instead of just a few models.

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

* Re: [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
  2023-10-19 16:43   ` Mark Hasemeyer
@ 2023-10-19 17:00     ` Pierre-Louis Bossart
  2023-10-20 15:36       ` Mark Hasemeyer
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre-Louis Bossart @ 2023-10-19 17:00 UTC (permalink / raw)
  To: Mark Hasemeyer, Amadeusz Sławiński
  Cc: LKML, Dmitry Torokhov, Guenter Roeck, stable, Andy Shevchenko,
	Bard Liao, Brady Norander, Jaroslav Kysela, Mark Brown,
	Takashi Iwai, alsa-devel



On 10/19/23 11:43, Mark Hasemeyer wrote:
>> I would assume that platform that has DMI_SYS_VENDOR set to "Google",
>> also has DMI_BIOS_VERSION set to "Google", so perhaps just replace
>> DMI_SYS_VENDOR match with DMI_BIOS_VERSION, to keep table small? Or is
>> that not a case?
> 
> That is the case. But I'm inclined to keep it for two reasons:
> 1. There is precedent in the kernel to use DMI_SYS_VENDOR=="Google"
> for Chromebook detection.
> 2. If the coreboot version schema for Chromebooks were to change, this
> check would fail for all JSL Chromebooks instead of just a few models.

I also prefer a low-risk addition to a higher-risk change. It's not like
we really care about the size of the table at this point.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

FWIW we use this other quirk:
DMI_MATCH(DMI_PRODUCT_FAMILY, "Google"),

How many engineers does it take to identify a Chromebook, eh?

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

* Re: [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
  2023-10-19 17:00     ` Pierre-Louis Bossart
@ 2023-10-20 15:36       ` Mark Hasemeyer
  2023-10-20 16:59         ` Pierre-Louis Bossart
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Hasemeyer @ 2023-10-20 15:36 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Amadeusz Sławiński, LKML, Dmitry Torokhov,
	Guenter Roeck, stable, Andy Shevchenko, Bard Liao, Brady Norander,
	Jaroslav Kysela, Mark Brown, Takashi Iwai, alsa-devel

> FWIW we use this other quirk:
> DMI_MATCH(DMI_PRODUCT_FAMILY, "Google"),

Unfortunately DMI_PRODUCT_FAMILY is empty on these particular devices.
The coreboot version field is the only entry that has "Google" in it.

> How many engineers does it take to identify a Chromebook, eh?

Ha! There has been some discussion about this: to come up with a
canonical way for Chromebook identification throughout the kernel. But
nothing has been settled on AFAIK.

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

* Re: [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
  2023-10-18 23:59 [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection Mark Hasemeyer
  2023-10-19 14:22 ` Amadeusz Sławiński
@ 2023-10-20 15:40 ` Takashi Iwai
  1 sibling, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2023-10-20 15:40 UTC (permalink / raw)
  To: Mark Hasemeyer
  Cc: LKML, Dmitry Torokhov, Guenter Roeck, stable,
	Amadeusz Sławiński, Andy Shevchenko, Bard Liao,
	Brady Norander, Jaroslav Kysela, Mark Brown, Pierre-Louis Bossart,
	Takashi Iwai, alsa-devel

On Thu, 19 Oct 2023 01:59:31 +0200,
Mark Hasemeyer wrote:
> 
> Some Jasperlake Chromebooks overwrite the system vendor DMI value to the
> name of the OEM that manufactured the device. This breaks Chromebook
> quirk detection as it expects the system vendor to be "Google".
> 
> Add another quirk detection entry that looks for "Google" in the BIOS
> version.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>

Applied now.  Thanks.


Takashi

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

* Re: [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
  2023-10-20 15:36       ` Mark Hasemeyer
@ 2023-10-20 16:59         ` Pierre-Louis Bossart
  2023-10-20 19:35           ` Mark Hasemeyer
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre-Louis Bossart @ 2023-10-20 16:59 UTC (permalink / raw)
  To: Mark Hasemeyer
  Cc: Amadeusz Sławiński, LKML, Dmitry Torokhov,
	Guenter Roeck, stable, Andy Shevchenko, Bard Liao, Brady Norander,
	Jaroslav Kysela, Mark Brown, Takashi Iwai, alsa-devel,
	Curtis Malainey



On 10/20/23 10:36, Mark Hasemeyer wrote:
>> FWIW we use this other quirk:
>> DMI_MATCH(DMI_PRODUCT_FAMILY, "Google"),
> 
> Unfortunately DMI_PRODUCT_FAMILY is empty on these particular devices.
> The coreboot version field is the only entry that has "Google" in it.

well then you have additional issues with the DMI quirk for the firmware
selection in sound/soc/sof/sof-pci-dev.c,

      {
		.ident = "Google Chromebooks",
		.callback = chromebook_use_community_key,
		.matches = {
			DMI_MATCH(DMI_PRODUCT_FAMILY, "Google"),
		}
	},

which means you need additional kernel parameters to provide the
location of the firmware....

>> How many engineers does it take to identify a Chromebook, eh?
> 
> Ha! There has been some discussion about this: to come up with a
> canonical way for Chromebook identification throughout the kernel. But
> nothing has been settled on AFAIK.

There's been multiple rounds of discussions with Curtis, we introduced
DMI_OEM_STRING but it's still not good enough, and now the previous
conventions are not being followed on what is a relatively old platform
already...

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

* Re: [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection
  2023-10-20 16:59         ` Pierre-Louis Bossart
@ 2023-10-20 19:35           ` Mark Hasemeyer
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Hasemeyer @ 2023-10-20 19:35 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Amadeusz Sławiński, LKML, Dmitry Torokhov,
	Guenter Roeck, stable, Andy Shevchenko, Bard Liao, Brady Norander,
	Jaroslav Kysela, Mark Brown, Takashi Iwai, alsa-devel,
	Curtis Malainey

> There's been multiple rounds of discussions with Curtis, we introduced
> DMI_OEM_STRING but it's still not good enough, and now the previous
> conventions are not being followed on what is a relatively old platform
> already...

Thanks for pointing that out. ChromeOS uses the fw_path module
parameter for JSL boards so I missed this. The DMI_BIOS_VERSION should
be consistent across all Chromebooks assuming 3rd party firmware
wasn't installed. I'll throw up another patch addressing this.

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

end of thread, other threads:[~2023-10-20 19:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18 23:59 [PATCH v1] ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection Mark Hasemeyer
2023-10-19 14:22 ` Amadeusz Sławiński
2023-10-19 16:43   ` Mark Hasemeyer
2023-10-19 17:00     ` Pierre-Louis Bossart
2023-10-20 15:36       ` Mark Hasemeyer
2023-10-20 16:59         ` Pierre-Louis Bossart
2023-10-20 19:35           ` Mark Hasemeyer
2023-10-20 15:40 ` Takashi Iwai

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