Skip to content

Conversation

@plbossart
Copy link
Member

We have quite a backlog of patches since December 4, this first upstream merge should help check for regression and organize the next kernel cycle (we are at -rc8 so in theory the merge window closes in 20 days).

sof-dev-rebase-20240103 pushed as well.

alexVinarskis and others added 30 commits December 4, 2023 15:23
XPS 9530 has 2 tweeters and 2 subwoofers powered by CS35L41 amplifier, SPI
connected. For subwoofers to work, it requires both to enable amplifier
support, and to enable output to subwoofers via 0x17 quirk (similalry to
XPS 9510/9520).

Signed-off-by: Aleksandrs Vinarskis <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Lenovo M90 Gen5 is equipped with ALC897, and it needs
ALC897_FIXUP_HEADSET_MIC_PIN quirk to make its headset mic work.

Signed-off-by: Bin Li <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Volume can have ranges that start with negative values, ex: -84dB to
+40dB. Apply correct range check in snd_soc_limit_volume before setting
the platform_max. Without this patch, for example setting a 0dB limit on
a volume range of -84dB to +40dB would fail.

Signed-off-by: Srinivas Kandagatla <[email protected]>
Tested-by: Johan Hovold <[email protected]>
Reviewed-by: Johan Hovold <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Limit the speaker digital gains to 0dB so that the users will not damage them.
Currently there is a limit in UCM, but this does not stop the user form
changing the digital gains from command line. So limit this in driver
which makes the speakers more safer without active speaker protection in
place.

Signed-off-by: Srinivas Kandagatla <[email protected]>
Reviewed-by: Johan Hovold <[email protected]>
Tested-by: Johan Hovold <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Most of the ES83xx codec configuration is exposed in the DSDT table
and accessible via a _DSM method. Start adding basic definitions and
helpers to dump the information.

Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Co-developed-by: David Yang <[email protected]>
Signed-off-by: David Yang <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Instead of adding DMI quirks for each new tablet model which uses
the ESS8316 codec, the plan is to switch to querying the same ACPI
Device-Specific-Method (DSM) as Windows uses to determine things
like speaker and mic routing.

Call the new es83xx_dsm_dump() helper which logs various basic settings
which can be queried through the ACPI DSM method on the codec ACPI device,
this is intended to help with developing a DSM based solution to replace
most DMI quirks.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
[[email protected]: improve commit message]
Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Add a is_bytcr helper variable to probe().

This is a preparation patch for determining the quirks through querying
the ACPI Device-Specific-Method (DSM) on the codec-device.

Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
…CPI DSM

Add support for querying the same ACPI Device-Specific-Method (DSM) as
Windows uses to determine things like speaker and mic routing.

This avoids the need to add DMI quirks for each new ESS8316 tablet model.

This has been tested on the following devices:

1. Chuwi Hi12 CHT with stereo speakers and IN2-mic-map,
   this avoids the need to add a DMI quirk for this model.

2. Nanote UMPC-01 CHT with stereo speakers and IN1-mic-map,
   the existing DMI quirk is still necessary because of a bug
   in the DSM return values for the speakers (it returns mono).

3. Onda V80 plus CHT with mono speaker and IN1-mic-map,
   DSM set quirks match the previously used defaults.

4. GP-electronic T701 BYT with mono speaker and IN2-mic-map,
   DSM set quirks match the previously used defaults.

Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Merge series from Hans de Goede <[email protected]>:

This takes some of the work done to auto-configure quirks/routing
for ESS83xx codecs by getting the info from ACPI from:
thesofproject#4112

And then builds on top of this to add auto-configuration to
the bytcht_es8316 board driver.

Note compared to the pull-request, which deals with the ES8336, this
series deals with the ES8316 (for which I have several devices to test
on) and this moves handling of the _DSM from the codec driver to
the board driver since with the ES8316 the board driver takes
care of setting up various routes for things like the mic and
speakers.

After this series audio now works properly on a CHT Chuwi Hi12
tablet without needing to add an extra quirk for that model.

This has also been tested on the following devices, where things
are unchanged from before (the ACPI autoconfiguration gives the
same results as the old defaults) :

Onda V80 plus (CHT)
GP-electronic T701 (BYT)

I also tested this on a Nanote UMPC-01, here the _DSM result
for PLATFORM_SPK_TYPE_ARG wrongly returns 1 (mono) while
the device actually has 2 speakers, so this model needs to keep
its DMI quirk.

I don't have an IRBIS NB41 nor a TECLAST X98 Plus II,
so the DMI quirks for those are left in place too on
a better safe then sorry basis.
This is a test configuration for UpExtreme with Cirrus Logic
CS35L56-EIGHT-C board.

The codec layout is configured as:
    - Link3: CS42L43 Jack
    - Link0: 2x CS35L56 Speaker (amps 1 and 2)
    - Link1: 2x CS35L56 Speaker (amps 7 and 8)

Signed-off-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Merge series from [email protected]:

Limit the speaker digital gains to 0dB so that the users will not damage them.
Currently there is a limit in UCM, but this does not stop the user form
changing the digital gains from command line. So limit this in driver
which makes the speakers more safer without active speaker protection in
place.

Apart from this there is also a range check fix in snd_soc_limit_volume
to allow setting this limit correctly.

Tested on Lenovo X13s.
Many board configs are duplicated since codec and amplifier type are
removed from board quirk. Introduce "adl_nau8825_def" board to reduce
the number of adl board configs.

Reviewed-by: Bard Liao <[email protected]>
Signed-off-by: Brent Lu <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Many board configs are duplicated since codec and amplifier type are
removed from board quirk. Introduce "rpl_nau8825_def" board to reduce
the number of rpl board configs.

Reviewed-by: Bard Liao <[email protected]>
Signed-off-by: Brent Lu <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
The drv_name in enumeration table for ALC5682I-VS codec does not match
the board id string in machine driver. Modify the entry of "10EC5682"
to enumerate "RTL5682" as well and remove invalid entry.

Fixes: 88b4d77 ("ASoC: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec")
Reported-by: Curtis Malainey <[email protected]>
Reviewed-by: Curtis Malainey <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Signed-off-by: Brent Lu <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
sof_sdw_rt_sdca_jack_exit() are used by different codecs, and some of
them use the same dai name.
For example, rt712 and rt713 both use "rt712-sdca-aif1" and
sof_sdw_rt_sdca_jack_exit().
As a result, sof_sdw_rt_sdca_jack_exit() will be called twice by
mc_dailink_exit_loop(). Set ctx->headset_codec_dev = NULL; after
put_device(ctx->headset_codec_dev); to avoid ctx->headset_codec_dev
being put twice.

Fixes: 5360c67 ("ASoC: Intel: sof_sdw: add rt712 support")
Reviewed-by: Péter Ujfalusi <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
…v instead of playback

'if (!playback)' will not work if the dai is only on capture dai link
or is on more than one playback dai links. Check 'if
(ctx->headset_codec_dev)' instead.

Reviewed-by: Péter Ujfalusi <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
… DAI widget

We use partial match for connecting DAI link and DAI widget. We need to
use partial match for disconnecting, too.

Fixes: fe88788 ("ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget")
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Add missed definition and align variable names with sof topology
header file.

Signed-off-by: Baofeng Tian <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
sof header file requires these struct with 4 byte aligned, so
add same alignment in sof driver definition.

Signed-off-by: Baofeng Tian <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Buffer flags have been in firmware for ages but were never fully
implemented in the topology/kernel system. This commit finishes off the
implementation.

Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Curtis Malainey <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
The RT722 SDCA codec supports 3 data lanes,
lane_control_support property has to be
set to use additional two lanes.

Reviewed-by: Jack Yu <[email protected]>
Reviewed-by: Rander Wang <[email protected]>
Signed-off-by: Chao Song <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
There is a spelling mistake in a dev_err_probe error message. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Acked-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Driver uses get and set ops to change the power state of dsp core.

Closes: thesofproject/sof#8478
Signed-off-by: Rander Wang <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Hookup the CS35L56 DAPM_OUTPUT widgets to a DAPM_SPK widget so
that there is a complete logical path to a speaker.

There is no particular reason to use multiple speaker widgets.
The CS35L56 are designed to work together as a set so they have
all been connected to a single speaker widget.

Instead of a hardcoded list of codec widget names, the code walks
through all the codecs on the dailink and for every cs35l56 it uses
its name prefix to construct the source end of the route. This adds
a small amount of overhead during probe but has the benefit that it
isn't dependent on every system using the same prefixes.

Signed-off-by: Richard Fitzgerald <[email protected]>
Acked-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
The pcm state can be SNDRV_PCM_STATE_DISCONNECTED at disconnect
callback, and there is not an entry of SNDRV_PCM_STATE_DISCONNECTED
in snd_pcm_state_names.

This patch adds the missing entry to resolve this issue.

cat /proc/asound/card2/pcm0p/sub0/status
That results in stack traces like the following:

[   99.702732][ T5171] Unexpected kernel BRK exception at EL1
[   99.702774][ T5171] Internal error: BRK handler: f2005512 [#1] PREEMPT SMP
[   99.703858][ T5171] Modules linked in: bcmdhd(E) (...)
[   99.747425][ T5171] CPU: 3 PID: 5171 Comm: cat Tainted: G         C OE     5.10.189-android13-4-00003-g4a17384380d8-ab11086999 #1
[   99.748447][ T5171] Hardware name: Rockchip RK3588 CVTE V10 Board (DT)
[   99.749024][ T5171] pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[   99.749616][ T5171] pc : snd_pcm_substream_proc_status_read+0x264/0x2bc
[   99.750204][ T5171] lr : snd_pcm_substream_proc_status_read+0xa4/0x2bc
[   99.750778][ T5171] sp : ffffffc0175abae0
[   99.751132][ T5171] x29: ffffffc0175abb80 x28: ffffffc009a2c498
[   99.751665][ T5171] x27: 0000000000000001 x26: ffffff810cbae6e8
[   99.752199][ T5171] x25: 0000000000400cc0 x24: ffffffc0175abc60
[   99.752729][ T5171] x23: 0000000000000000 x22: ffffff802f558400
[   99.753263][ T5171] x21: ffffff81d8d8ff00 x20: ffffff81020cdc00
[   99.753795][ T5171] x19: ffffff802d110000 x18: ffffffc014fbd058
[   99.754326][ T5171] x17: 0000000000000000 x16: 0000000000000000
[   99.754861][ T5171] x15: 000000000000c276 x14: ffffffff9a976fda
[   99.755392][ T5171] x13: 0000000065689089 x12: 000000000000d72e
[   99.755923][ T5171] x11: ffffff802d110000 x10: 00000000000000e0
[   99.756457][ T5171] x9 : 9c431600c8385d00 x8 : 0000000000000008
[   99.756990][ T5171] x7 : 0000000000000000 x6 : 000000000000003f
[   99.757522][ T5171] x5 : 0000000000000040 x4 : ffffffc0175abb70
[   99.758056][ T5171] x3 : 0000000000000001 x2 : 0000000000000001
[   99.758588][ T5171] x1 : 0000000000000000 x0 : 0000000000000000
[   99.759123][ T5171] Call trace:
[   99.759404][ T5171]  snd_pcm_substream_proc_status_read+0x264/0x2bc
[   99.759958][ T5171]  snd_info_seq_show+0x54/0xa4
[   99.760370][ T5171]  seq_read_iter+0x19c/0x7d4
[   99.760770][ T5171]  seq_read+0xf0/0x128
[   99.761117][ T5171]  proc_reg_read+0x100/0x1f8
[   99.761515][ T5171]  vfs_read+0xf4/0x354
[   99.761869][ T5171]  ksys_read+0x7c/0x148
[   99.762226][ T5171]  __arm64_sys_read+0x20/0x30
[   99.762625][ T5171]  el0_svc_common+0xd0/0x1e4
[   99.763023][ T5171]  el0_svc+0x28/0x98
[   99.763358][ T5171]  el0_sync_handler+0x8c/0xf0
[   99.763759][ T5171]  el0_sync+0x1b8/0x1c0
[   99.764118][ T5171] Code: d65f03c0 b9406102 17ffffae 94191565 (d42aa240)
[   99.764715][ T5171] ---[ end trace 1eeffa3e17c58e10 ]---
[   99.780720][ T5171] Kernel panic - not syncing: BRK handler: Fatal exception

Signed-off-by: Jason Zhang <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Merge series from Pierre-Louis Bossart <[email protected]>:

Minor cleanups for machine drivers.
Merge series from Pierre-Louis Bossart <[email protected]>:

Header alignment with firmware, addition of new token and partial
match filters.
…/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.7

A crop of fixes for v6.7, one core fix for a merge issue and a bunch of
driver specific fixes and new IDs, mostly for x86 platforms.
The Framework Laptop 13 (AMD Ryzen 7040Series) has an ALC295 with
a disconnected or faulty headset mic presence detect similar to the
previous models.  It works with the same quirk chain as
309d736.  This model has a VID:PID
of f111:0006.

Signed-off-by: Tim Bosse <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Unlike i.MX8MP, i.MX93 has two XCVR interrupts.

Describe the two interrupts for the i.MX93 to fix the following
dt-schema warning:

imx93-11x11-evk.dtb: xcvr@42680000: interrupts: [[0, 203, 4], [0, 204, 4]] is too long
	from schema $id: http://devicetree.org/schemas/sound/fsl,xcvr.yaml#

Signed-off-by: Fabio Estevam <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
@plbossart
Copy link
Member Author

wow, that's indeed a major regression, thanks @bardliao

I don't see any machine driver changes, but there are da7219 changes since the last update

5f44de6 ASoC: da7219: Support low DC impedance headset
ab5201e ASoC: da7219: Improve system suspend and resume handling

I am probably missing something but nothing else comes to my mind atm

@ujfalusi
Copy link
Collaborator

ujfalusi commented Jan 5, 2024

My hunch is around this: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
with combination of these: strcmp(broxton_dais[i].codecs->dai_name, SOMETHING);, it might be lethal...

@bardliao, this might work?

diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c
index 816fad8c1ff0..9aa86ed6b22b 100644
--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c
+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c
@@ -797,6 +797,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
 		broxton_audio_card.name = "glkda7219max";
 		/* Fixup the SSP entries for geminilake */
 		for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+			if (!broxton_dais[i].codecs)
+				continue;
+
 			/* MAXIM_CODEC is connected to SSP1. */
 			if (!strcmp(broxton_dais[i].codecs->dai_name,
 				    BXT_MAXIM_CODEC_DAI)) {
@@ -822,6 +825,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
 			broxton_audio_card.name = "cmlda7219max";
 
 		for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+			if (!broxton_dais[i].codecs)
+				continue;
+
 			/* MAXIM_CODEC is connected to SSP1. */
 			if (!strcmp(broxton_dais[i].codecs->dai_name,
 					BXT_MAXIM_CODEC_DAI)) {

plbossart pushed a commit to plbossart/sound that referenced this pull request Jan 5, 2024
The change to avoid dummy components seems to be problematic

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
ujfalusi added a commit to ujfalusi/sof-linux that referenced this pull request Jan 5, 2024
The change to avoid dummy components seems to be problematic

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
@bardliao
Copy link
Collaborator

bardliao commented Jan 8, 2024

My hunch is around this: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()") with combination of these: strcmp(broxton_dais[i].codecs->dai_name, SOMETHING);, it might be lethal...

@bardliao, this might work?

diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c
index 816fad8c1ff0..9aa86ed6b22b 100644
--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c
+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c
@@ -797,6 +797,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
 		broxton_audio_card.name = "glkda7219max";
 		/* Fixup the SSP entries for geminilake */
 		for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+			if (!broxton_dais[i].codecs)
+				continue;
+
 			/* MAXIM_CODEC is connected to SSP1. */
 			if (!strcmp(broxton_dais[i].codecs->dai_name,
 				    BXT_MAXIM_CODEC_DAI)) {
@@ -822,6 +825,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
 			broxton_audio_card.name = "cmlda7219max";
 
 		for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+			if (!broxton_dais[i].codecs)
+				continue;
+
 			/* MAXIM_CODEC is connected to SSP1. */
 			if (!strcmp(broxton_dais[i].codecs->dai_name,
 					BXT_MAXIM_CODEC_DAI)) {

Unfortunately, no. I tested the change, but it didn't fix the issue.

@bardliao
Copy link
Collaborator

bardliao commented Jan 8, 2024

@ujfalusi @plbossart Below change can fix the issue,

diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c
index 816fad8c1ff0..975ee5c91d9b 100644
--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c
+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c
@@ -797,6 +797,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
                broxton_audio_card.name = "glkda7219max";
                /* Fixup the SSP entries for geminilake */
                for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+                       if (!broxton_dais[i].codecs || !broxton_dais[i].codecs->dai_name)
+                               continue;
+
                        /* MAXIM_CODEC is connected to SSP1. */
                        if (!strcmp(broxton_dais[i].codecs->dai_name,
                                    BXT_MAXIM_CODEC_DAI)) {
@@ -822,6 +825,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
                        broxton_audio_card.name = "cmlda7219max";

                for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+                       if (!broxton_dais[i].codecs || !broxton_dais[i].codecs->dai_name)
+                               continue;
+
                        /* MAXIM_CODEC is connected to SSP1. */
                        if (!strcmp(broxton_dais[i].codecs->dai_name,
                                        BXT_MAXIM_CODEC_DAI)) {

@bardliao
Copy link
Collaborator

bardliao commented Jan 8, 2024

wow, that's indeed a major regression, thanks @bardliao

I don't see any machine driver changes, but there are da7219 changes since the last update

5f44de6 ASoC: da7219: Support low DC impedance headset ab5201e ASoC: da7219: Improve system suspend and resume handling

I am probably missing something but nothing else comes to my mind atm

@plbossart This is related to 13f5826. COMP_DUMMY() has been changed and no longer assign .dai_name. We may need to check all existing machine drivers.

git grep COMP_DUMMY sound/soc/intel/boards/
sound/soc/intel/boards/bdw-rt5650.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bdw-rt5677.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bdw_rt286.c:SND_SOC_DAILINK_DEF(dummy, DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bxt_da7219_max98357a.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bxt_rt298.c:     DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_cx2072x.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_da7213.c: DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_es8316.c: DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_nocodec.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcr_rt5640.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcr_rt5651.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcr_wm5102.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_max98090_ti.c:   DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_nau8824.c:       DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_rt5645.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_rt5672.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/glk_rt5682_max98357a.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/hsw_rt5640.c:SND_SOC_DAILINK_DEF(dummy, DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_da7219_max98357a.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_da7219_max98927.c:   DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_rt5660.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_rt5663_max98927.c:   DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/skl_nau88l25_max98357a.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/skl_nau88l25_ssm4567.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/skl_rt286.c:     DAILINK_COMP_ARRAY(COMP_DUMMY()));

@ujfalusi
Copy link
Collaborator

ujfalusi commented Jan 8, 2024

@ujfalusi @plbossart Below change can fix the issue,

Yes, see my test PR from Friday: #4765

diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c
index 816fad8c1ff0..975ee5c91d9b 100644
--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c
+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c
@@ -797,6 +797,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
                broxton_audio_card.name = "glkda7219max";
                /* Fixup the SSP entries for geminilake */
                for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+                       if (!broxton_dais[i].codecs || !broxton_dais[i].codecs->dai_name)
+                               continue;
+
                        /* MAXIM_CODEC is connected to SSP1. */
                        if (!strcmp(broxton_dais[i].codecs->dai_name,
                                    BXT_MAXIM_CODEC_DAI)) {
@@ -822,6 +825,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
                        broxton_audio_card.name = "cmlda7219max";

                for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+                       if (!broxton_dais[i].codecs || !broxton_dais[i].codecs->dai_name)
+                               continue;
+
                        /* MAXIM_CODEC is connected to SSP1. */
                        if (!strcmp(broxton_dais[i].codecs->dai_name,
                                        BXT_MAXIM_CODEC_DAI)) {

However we only need to check for if (!broxton_dais[i].codecs->dai_name))

@bardliao
Copy link
Collaborator

bardliao commented Jan 8, 2024

@plbossart @ujfalusi I checked all machine drivers above. In addition to bxt_da7219_max98357a.c, only bxt_rt298.c uses codecs->dai_name. Hope I didn't miss any machine driver.

@ujfalusi
Copy link
Collaborator

ujfalusi commented Jan 8, 2024

wow, that's indeed a major regression, thanks @bardliao
I don't see any machine driver changes, but there are da7219 changes since the last update
5f44de6 ASoC: da7219: Support low DC impedance headset ab5201e ASoC: da7219: Improve system suspend and resume handling
I am probably missing something but nothing else comes to my mind atm

@plbossart This is related to 13f5826. COMP_DUMMY() has been changed and no longer assign .dai_name. We may need to check all existing machine drivers.

git grep COMP_DUMMY sound/soc/intel/boards/
sound/soc/intel/boards/bdw-rt5650.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bdw-rt5677.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bdw_rt286.c:SND_SOC_DAILINK_DEF(dummy, DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bxt_da7219_max98357a.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bxt_rt298.c:     DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_cx2072x.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_da7213.c: DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_es8316.c: DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcht_nocodec.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcr_rt5640.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcr_rt5651.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/bytcr_wm5102.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_max98090_ti.c:   DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_nau8824.c:       DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_rt5645.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/cht_bsw_rt5672.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/glk_rt5682_max98357a.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/hsw_rt5640.c:SND_SOC_DAILINK_DEF(dummy, DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_da7219_max98357a.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_da7219_max98927.c:   DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_rt5660.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_rt5663_max98927.c:   DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:    DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/skl_nau88l25_max98357a.c:        DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/skl_nau88l25_ssm4567.c:  DAILINK_COMP_ARRAY(COMP_DUMMY()));
sound/soc/intel/boards/skl_rt286.c:     DAILINK_COMP_ARRAY(COMP_DUMMY()));

sound/soc/intel/boards/bxt_rt298.c is affected as well for sure because of

607		if (!strncmp(card->dai_link[i].codecs->name, "i2c-INT343A:00",

ujfalusi added a commit to ujfalusi/sof-linux that referenced this pull request Jan 8, 2024
…hange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
ujfalusi added a commit to ujfalusi/sof-linux that referenced this pull request Jan 8, 2024
The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
…hange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Jan 8, 2024
…hange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Jan 8, 2024
The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
@plbossart
Copy link
Member Author

tests are mostly good except for ONE timeout. Let's merge.

Thanks @ujfalusi and @bardliao for your help in root-causing the GLK regression.

@plbossart plbossart merged commit 35a9358 into thesofproject:topic/sof-dev Jan 9, 2024
ujfalusi added a commit that referenced this pull request Feb 8, 2024
…hange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: #4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
ujfalusi added a commit that referenced this pull request Feb 8, 2024
The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: #4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
fadlyas07 pushed a commit to greenforce-project/chromeos-kernel-mirror that referenced this pull request May 11, 2024
…MP_DUMMY change

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 59b946ea30806064c4ac78f0ac93642655dd4f2e)

BUG=b:329165311
TEST=Success to build kernel

Change-Id: I8715736c8db9e4774683ad83351c38b848e8dc94
Signed-off-by: Brent Lu <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5524495
Reviewed-by: Sean Paul <[email protected]>
Reviewed-by: Terry Cheong <[email protected]>
fadlyas07 pushed a commit to greenforce-project/chromeos-kernel-mirror that referenced this pull request May 11, 2024
…MP_DUMMY change

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 59b946ea30806064c4ac78f0ac93642655dd4f2e)

BUG=b:337749464
TEST=Build success

Change-Id: I6f47f1990b280606823866fe917b1079e710f37d
Signed-off-by: Brent Lu <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5508879
Reviewed-by: Terry Cheong <[email protected]>
Tested-by: Lalith Rajendran <[email protected]>
Commit-Queue: Lalith Rajendran <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
fadlyas07 pushed a commit to greenforce-project/chromeos-kernel-mirror that referenced this pull request Jun 15, 2024
…MP_DUMMY change

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 59b946ea30806064c4ac78f0ac93642655dd4f2e)

BUG=b:315885644
TEST=Success to build kernel

Change-Id: Ifcfebd8c3e5719e579471cca679af74ad53f4352
Signed-off-by: Brent Lu <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5513919
Reviewed-by: Terry Cheong <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Commit-Queue: Terry Cheong <[email protected]>
fadlyas07 pushed a commit to greenforce-project/chromeos-kernel-mirror that referenced this pull request Aug 24, 2024
…ange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 3ec71290db4de298b67659ef2bc2a8f84cf9537b
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:326869955
TEST=Test Audio use cases.

Change-Id: Ibac01535b1bec404b1ba5b08b422160fe179cf50
Signed-off-by: Debi sahoo <[email protected]>
hubot pushed a commit to aosp-mirror/kernel_common that referenced this pull request Oct 1, 2024
…ange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 3ec7129
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:326869955
TEST=Test Audio use cases.

Change-Id: Ibac01535b1bec404b1ba5b08b422160fe179cf50
Signed-off-by: Debi sahoo <[email protected]>
Signed-off-by: Hubert Mazur <[email protected]>
akku1139 pushed a commit to external-mirrors/chromiumos-third_party-kernel that referenced this pull request Dec 9, 2025
…ange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 3ec7129
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:326869955
TEST=Test Audio use cases.

Change-Id: Ibac01535b1bec404b1ba5b08b422160fe179cf50
Signed-off-by: Debi sahoo <[email protected]>
akku1139 pushed a commit to external-mirrors/chromiumos-third_party-kernel that referenced this pull request Dec 9, 2025
…ange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 3ec7129
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:326869955
TEST=Test Audio use cases.

Change-Id: Ibac01535b1bec404b1ba5b08b422160fe179cf50
Signed-off-by: Debi sahoo <[email protected]>
akku1139 pushed a commit to external-mirrors/chromiumos-third_party-kernel that referenced this pull request Dec 9, 2025
…ange

The change to avoid dummy components will leave the component name and
dai_name NULL which will cause NULL dereference when trying to access to
it in the machine driver when applying fixups.

Link: thesofproject/linux#4759 (comment)
Fixes: 13f5826 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 3ec7129
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:326869955
TEST=Test Audio use cases.

Change-Id: Ibac01535b1bec404b1ba5b08b422160fe179cf50
Signed-off-by: Debi sahoo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.