Skip to contentSkip to conversation

ASoC: Intel: fix kernel oops in machine drivers

PATCH In review Pierre-Louis Bossart 2 participants 9 messages Jun 4, 2019 – Jun 6, 2019

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

cover ASoC: Intel: fix kernel oops in machine drivers

The changes made for v5.1 to override the default platform_name assumed the card device was properly initialized so that devm_strdup() could be used. This is true for the majority of the machine drivers, but unfortunately this isn't valid for four of the Cherrytrail-based ones which don't follow the same programming flow and initialize the card device last. After hitting a kernel oops on cht-bsw-max98090 (Cyan Chromebook) I found 3 other cases where the same fix is required.

These fixes should be applied for 5.1 and 5.2. While it's not an excuse for this miss, the impact is limited in that the kernel oops will only happen when SOF is used.

Pierre-Louis Bossart (4):
ASoC: Intel: cht_bsw_max98090: fix kernel oops with platform_name
override
ASoC: Intel: bytcht_es8316: fix kernel oops with platform_name
override
ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name
override
ASoC: Intel: cht_bsw_rt5672: fix kernel oops with platform_name
override

 sound/soc/intel/boards/bytcht_es8316.c       | 2 +-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 2 +-
 sound/soc/intel/boards/cht_bsw_nau8824.c     | 2 +-
 sound/soc/intel/boards/cht_bsw_rt5672.c      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/4 ASoC: Intel: cht_bsw_max98090: fix kernel oops with platform_name override

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes 7e7e24d7c7ff0 ("ASoC: Intel: cht_bsw_max98090_ti: platform name fixup support")
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_max98090_ti.c +1 -1
index c0e0844f75b9..572e336ae0f9 100644
@@ -454,6 +454,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	}
 
 	/* override plaform name, if required */
+	snd_soc_card_cht.dev = &pdev->dev;
 	mach = (&pdev->dev)->platform_data;
 	platform_name = mach->mach_params.platform;
 
@@ -463,7 +464,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 		return ret_val;
 
 	/* register the soc card */
-	snd_soc_card_cht.dev = &pdev->dev;
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
 
 	if (drv->quirks & QUIRK_PMC_PLT_CLK_0)
Signature · 1 line
2.20.1
maintainer
#2 lore raw

Applied "ASoC: Intel: cht_bsw_max98090: fix kernel oops with platform_name override" to the asoc tree

The patch

ASoC: Intel: cht_bsw_max98090: fix kernel oops with platform_name override

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From fb54555134b9b17835545e4d096b5550c27eed64 Mon Sep 17 00:00:00 2001

From: Pierre-Louis Bossart <[email protected]>
Date: Tue, 4 Jun 2019 15:08:55 -0500
Subject: [PATCH] ASoC: Intel: cht_bsw_max98090: fix kernel oops with
platform_name override

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes 7e7e24d7c7ff0 ("ASoC: Intel: cht_bsw_max98090_ti: platform name fixup support")
---
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_max98090_ti.c +1 -1
index c0e0844f75b9..572e336ae0f9 100644
@@ -454,6 +454,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	}
 
 	/* override plaform name, if required */
+	snd_soc_card_cht.dev = &pdev->dev;
 	mach = (&pdev->dev)->platform_data;
 	platform_name = mach->mach_params.platform;
 
@@ -463,7 +464,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 		return ret_val;
 
 	/* register the soc card */
-	snd_soc_card_cht.dev = &pdev->dev;
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
 
 	if (drv->quirks & QUIRK_PMC_PLT_CLK_0)
Signature · 1 line
2.20.1
#3 lore raw

PATCH 2/4 ASoC: Intel: bytcht_es8316: fix kernel oops with platform_name override

In reply to Pierre-Louis Bossart

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes e4bc6b1195f64 ("ASoC: Intel: bytcht_es8316: platform name fixup support")
---
 sound/soc/intel/boards/bytcht_es8316.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/bytcht_es8316.c +1 -1
index 1f319b2a835f..ba4830b7a161 100644
@@ -488,6 +488,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 	}
 
 	/* override plaform name, if required */
+	byt_cht_es8316_card.dev = dev;
 	platform_name = mach->mach_params.platform;
 
 	ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_es8316_card,
@@ -568,7 +569,6 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 		 (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
 		 mic_name[BYT_CHT_ES8316_MAP(quirk)]);
 	byt_cht_es8316_card.long_name = long_name;
-	byt_cht_es8316_card.dev = dev;
 	snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);
 
 	ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card);
Signature · 1 line
2.20.1
maintainer
#4 lore raw

Applied "ASoC: Intel: bytcht_es8316: fix kernel oops with platform_name override" to the asoc tree

The patch

ASoC: Intel: bytcht_es8316: fix kernel oops with platform_name override

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 79136a016add1acb690fe8d96be50dd22a143d26 Mon Sep 17 00:00:00 2001

From: Pierre-Louis Bossart <[email protected]>
Date: Tue, 4 Jun 2019 15:08:56 -0500
Subject: [PATCH] ASoC: Intel: bytcht_es8316: fix kernel oops with
platform_name override

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes e4bc6b1195f64 ("ASoC: Intel: bytcht_es8316: platform name fixup support")
---
 sound/soc/intel/boards/bytcht_es8316.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/bytcht_es8316.c +1 -1
index e8c585ffd04d..128b57932a92 100644
@@ -495,6 +495,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 	}
 
 	/* override plaform name, if required */
+	byt_cht_es8316_card.dev = dev;
 	platform_name = mach->mach_params.platform;
 
 	ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_es8316_card,
@@ -575,7 +576,6 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 		 (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo",
 		 mic_name[BYT_CHT_ES8316_MAP(quirk)]);
 	byt_cht_es8316_card.long_name = long_name;
-	byt_cht_es8316_card.dev = dev;
 	snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv);
 
 	ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card);
Signature · 1 line
2.20.1
#5 lore raw

PATCH 3/4 ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name override

In reply to Pierre-Louis Bossart

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes 4506db8043341 ("ASoC: Intel: cht_bsw_nau8824: platform name fixup support")
---
 sound/soc/intel/boards/cht_bsw_nau8824.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_nau8824.c +1 -1
index 02c2fa239331..20fae391c75a 100644
@@ -257,6 +257,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
 
 	/* override plaform name, if required */
+	snd_soc_card_cht.dev = &pdev->dev;
 	mach = (&pdev->dev)->platform_data;
 	platform_name = mach->mach_params.platform;
 
@@ -266,7 +267,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 		return ret_val;
 
 	/* register the soc card */
-	snd_soc_card_cht.dev = &pdev->dev;
 	ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
 	if (ret_val) {
 		dev_err(&pdev->dev,
Signature · 1 line
2.20.1
maintainer
#6 lore raw

Applied "ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name override" to the asoc tree

The patch

ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name override

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 096701e8131425044d2054a0c210d6ea24ee7386 Mon Sep 17 00:00:00 2001

From: Pierre-Louis Bossart <[email protected]>
Date: Tue, 4 Jun 2019 15:08:57 -0500
Subject: [PATCH] ASoC: Intel: cht_bsw_nau8824: fix kernel oops with
platform_name override

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes 4506db8043341 ("ASoC: Intel: cht_bsw_nau8824: platform name fixup support")
---
 sound/soc/intel/boards/cht_bsw_nau8824.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_nau8824.c +1 -1
index 02c2fa239331..20fae391c75a 100644
@@ -257,6 +257,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
 
 	/* override plaform name, if required */
+	snd_soc_card_cht.dev = &pdev->dev;
 	mach = (&pdev->dev)->platform_data;
 	platform_name = mach->mach_params.platform;
 
@@ -266,7 +267,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 		return ret_val;
 
 	/* register the soc card */
-	snd_soc_card_cht.dev = &pdev->dev;
 	ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
 	if (ret_val) {
 		dev_err(&pdev->dev,
Signature · 1 line
2.20.1
#7 lore raw

PATCH 4/4 ASoC: Intel: cht_bsw_rt5672: fix kernel oops with platform_name override

In reply to Pierre-Louis Bossart

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes f403906da05cd ("ASoC: Intel: cht_bsw_rt5672: platform name fixup support")
---
 sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_rt5672.c +1 -1
index 0f7770822388..1455e19d3768 100644
@@ -426,6 +426,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	}
 
 	/* override plaform name, if required */
+	snd_soc_card_cht.dev = &pdev->dev;
 	platform_name = mach->mach_params.platform;
 
 	ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht,
@@ -443,7 +444,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
 
 	/* register the soc card */
-	snd_soc_card_cht.dev = &pdev->dev;
 	ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
 	if (ret_val) {
 		dev_err(&pdev->dev,
Signature · 1 line
2.20.1
maintainer
#8 lore raw

Applied "ASoC: Intel: cht_bsw_rt5672: fix kernel oops with platform_name override" to the asoc tree

The patch

ASoC: Intel: cht_bsw_rt5672: fix kernel oops with platform_name override

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 9bbc799318a34061703f2a980e2b6df7fc6760f0 Mon Sep 17 00:00:00 2001

From: Pierre-Louis Bossart <[email protected]>
Date: Tue, 4 Jun 2019 15:08:58 -0500
Subject: [PATCH] ASoC: Intel: cht_bsw_rt5672: fix kernel oops with
platform_name override

The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier.

Fixes f403906da05cd ("ASoC: Intel: cht_bsw_rt5672: platform name fixup support")
---
 sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_rt5672.c +1 -1
index 0f7770822388..1455e19d3768 100644
@@ -426,6 +426,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	}
 
 	/* override plaform name, if required */
+	snd_soc_card_cht.dev = &pdev->dev;
 	platform_name = mach->mach_params.platform;
 
 	ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht,
@@ -443,7 +444,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
 
 	/* register the soc card */
-	snd_soc_card_cht.dev = &pdev->dev;
 	ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
 	if (ret_val) {
 		dev_err(&pdev->dev,
Signature · 1 line
2.20.1