linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v3] SoC: qcom: Distinguish headset codec by codec_dai->name
@ 2021-12-14  2:25 Judy Hsiao
  2021-12-14 13:47 ` Mark Brown
  2021-12-15  2:03 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Judy Hsiao @ 2021-12-14  2:25 UTC (permalink / raw)
  To: broonie
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, dianders, cychiang, yuhsuan,
	judyhsiao, swboyd, linux-arm-msm, alsa-devel, Judy Hsiao

Distinguish which headset codec is on the board by codec_dai->name
instead of card->name.

It fixes the crash of being unable to handle kernel paging requests
at virtual address ADDR by initializing the correct audio codec on
the board.

Call stack of the crash:
```
 Unable to handle kernel paging request at virtual address ...
 ...
 Call trace:
  rt5682_set_component_pll+0xcc/0xb78 [snd_soc_rt5682]
  snd_soc_component_set_pll+0x90/0x154
  snd_soc_dai_set_pll+0xf4/0x1ac
  sc7180_snd_startup+0x268/0x3c0 [snd_soc_sc7180]
  snd_soc_link_startup+0xa4/0x180
  soc_pcm_open+0x35c/0x15c8
  snd_pcm_open_substream+0xa90/0x13b0
  snd_pcm_open+0x1a4/0x55c
  snd_pcm_capture_open+0x7c/0xe8
  snd_open+0x2b8/0x2e4
  chrdev_open+0x364/0x3d4
  do_dentry_open+0x66c/0xc58
  vfs_open+0x7c/0x8c
  path_openat+0x108c/0x2bbc
  do_filp_open+0x15c/0x258
  do_sys_open+0x278/0x62c
  __arm64_compat_sys_openat+0x9c/0xb0
  ...
```

Fixes: 425c5fce8a03 ("ASoC: qcom: Add support for ALC5682I-VS codec")
Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
---
 sound/soc/qcom/sc7180.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/qcom/sc7180.c b/sound/soc/qcom/sc7180.c
index 2fff764a00a7..37225ef2563a 100644
--- a/sound/soc/qcom/sc7180.c
+++ b/sound/soc/qcom/sc7180.c
@@ -131,13 +131,13 @@ static int sc7180_snd_startup(struct snd_pcm_substream *substream)
 	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
 	int pll_id, pll_source, pll_in, pll_out, clk_id, ret;
 
-	if (!(strcmp(card->name, "sc7180-rt5682-max98357a-1mic"))) {
+	if (!strcmp(codec_dai->name, "rt5682-aif1")) {
 		pll_source = RT5682_PLL1_S_MCLK;
 		pll_id = 0;
 		clk_id = RT5682_SCLK_S_PLL1;
 		pll_out = RT5682_PLL1_FREQ;
 		pll_in = DEFAULT_MCLK_RATE;
-	} else if (!(strcmp(card->name, "sc7180-rt5682s-max98357a-1mic"))) {
+	} else if (!strcmp(codec_dai->name, "rt5682s-aif1")) {
 		pll_source = RT5682S_PLL_S_MCLK;
 		pll_id = RT5682S_PLL2;
 		clk_id = RT5682S_SCLK_S_PLL2;
-- 
2.31.0


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

* Re: [v3] SoC: qcom: Distinguish headset codec by codec_dai->name
  2021-12-14  2:25 [v3] SoC: qcom: Distinguish headset codec by codec_dai->name Judy Hsiao
@ 2021-12-14 13:47 ` Mark Brown
  2021-12-15  2:03 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-12-14 13:47 UTC (permalink / raw)
  To: Judy Hsiao
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, dianders, cychiang, yuhsuan,
	judyhsiao, swboyd, linux-arm-msm, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

On Tue, Dec 14, 2021 at 10:25:09AM +0800, Judy Hsiao wrote:
> Distinguish which headset codec is on the board by codec_dai->name
> instead of card->name.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [v3] SoC: qcom: Distinguish headset codec by codec_dai->name
  2021-12-14  2:25 [v3] SoC: qcom: Distinguish headset codec by codec_dai->name Judy Hsiao
  2021-12-14 13:47 ` Mark Brown
@ 2021-12-15  2:03 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-12-15  2:03 UTC (permalink / raw)
  To: Judy Hsiao
  Cc: alsa-devel, Liam Girdwood, Srinivas Kandagatla, judyhsiao,
	swboyd, linux-arm-msm, Takashi Iwai, yuhsuan, dianders,
	Jaroslav Kysela, cychiang, Banajit Goswami

On Tue, 14 Dec 2021 10:25:09 +0800, Judy Hsiao wrote:
> Distinguish which headset codec is on the board by codec_dai->name
> instead of card->name.
> 
> It fixes the crash of being unable to handle kernel paging requests
> at virtual address ADDR by initializing the correct audio codec on
> the board.
> 
> [...]

Applied to

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

Thanks!

[1/1] SoC: qcom: Distinguish headset codec by codec_dai->name
      commit: 833a94aac572d7f0fe3f51329e0eb9f2884cf665

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

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

end of thread, other threads:[~2021-12-15  2:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14  2:25 [v3] SoC: qcom: Distinguish headset codec by codec_dai->name Judy Hsiao
2021-12-14 13:47 ` Mark Brown
2021-12-15  2:03 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).