Skip to contentSkip to conversation

ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection

PATCH In review Mark Hasemeyer 5 participants 9 messages Oct 19, 2023 – Oct 20, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection

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.

---

 sound/hda/intel-dsp-config.c | 6 ++++++
 1 file changed, 6 insertions(+)
sound/hda/intel-dsp-config.c +6 -0
index 24a948baf1bc..756fa0aa69bb 100644
@@ -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"),
+				}
+			},
 			{}
 		}
 	},
Signature · 1 line
2.42.0.655.g421f12c284-goog
#1 lore raw
Quoted 21 lines · Mark Hasemeyer

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.

---

  sound/hda/intel-dsp-config.c | 6 ++++++
  1 file changed, 6 insertions(+)
sound/hda/intel-dsp-config.c +0 -0
index 24a948baf1bc..756fa0aa69bb 100644
@@ -336,6 +336,12 @@ static const struct config_entry config_table[] = {
  					DMI_MATCH(DMI_SYS_VENDOR, "Google"),
  				}

sound/hda/intel-dsp-config.c static const struct config_entry config_table[] = { · line 347

Quoted 10 lines
sound/hda/intel-dsp-config.c +6 -0
  			},
+			{
+				.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?

#2 lore raw
Quoted 4 lines

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.

#3 lore raw
Quoted 10 lines · Mark Hasemeyer
Quoted 4 lines

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.

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

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

#4 lore raw
Quoted 2 lines

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.

Quoted 1 line

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.

#5 lore raw
Quoted 5 lines · Mark Hasemeyer
Quoted 2 lines

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

Quoted 5 lines
Quoted 1 line

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

#6 lore raw
Quoted 25 lines · Pierre-Louis Bossart
Quoted 5 lines · Mark Hasemeyer
Quoted 2 lines

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

Quoted 2 lines
Quoted 1 line

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

Quoted 9 lines
Quoted 3 lines

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

Yea it looks like JSL missed the product family field. It's like playing whack-a-mole. If that table gets much larger we might have to break it into a per platform quirk table...

#7 lore raw
In reply to Pierre-Louis Bossart
Quoted 4 lines

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.