Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: amd: yc: Fix the wrong return value
@ 2024-12-09 10:13 Venkata Prasad Potturu
  2024-12-09 13:46 ` Markus Elfring
  2024-12-10 14:51 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Venkata Prasad Potturu @ 2024-12-09 10:13 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Vijendar.Mukunda, mario.limonciello, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, syed.sabakareem, Venkata Prasad Potturu,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, end.to.start,
	Jiawei Wang,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

With the current implementation, when ACP driver fails to read
ACPI _WOV entry then the DMI overrides code won't invoke,
may cause regressions for some BIOS versions.

Add a condition check to jump to check the DMI entries
incase of ACP driver fail to read ACPI _WOV method.

Fixes: 4095cf872084 (ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry)

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
---
 sound/soc/amd/yc/acp6x-mach.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index e38c5885dadf..13af1d485eb0 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -578,14 +578,19 @@ static int acp6x_probe(struct platform_device *pdev)
 
 	handle = ACPI_HANDLE(pdev->dev.parent);
 	ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
-	if (!ACPI_FAILURE(ret))
+	if (!ACPI_FAILURE(ret)) {
 		wov_en = dmic_status;
+		if (!wov_en)
+			return -ENODEV;
+	} else {
+		/* Incase of ACPI method read failure then jump to check_dmi_entry */
+		goto check_dmi_entry;
+	}
 
 	if (is_dmic_enable && wov_en)
 		platform_set_drvdata(pdev, &acp6x_card);
-	else
-		return 0;
 
+check_dmi_entry:
 	/* check for any DMI overrides */
 	dmi_id = dmi_first_match(yc_acp_quirk_table);
 	if (dmi_id)
-- 
2.25.1


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

* Re: [PATCH] ASoC: amd: yc: Fix the wrong return value
  2024-12-09 10:13 [PATCH] ASoC: amd: yc: Fix the wrong return value Venkata Prasad Potturu
@ 2024-12-09 13:46 ` Markus Elfring
  2024-12-10  6:24   ` potturu venkata prasad
  2024-12-10 14:51 ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2024-12-09 13:46 UTC (permalink / raw)
  To: Venkata Prasad Potturu, alsa-devel, linux-sound, Mark Brown
  Cc: LKML, Basavaraj Hiregoudar, Jaroslav Kysela, Jiawei Wang,
	Liam Girdwood, Mario Limonciello, Sunil-kumar Dommati,
	Syed Saba Kareem, Takashi Iwai, Vijendar Mukunda, end.to.start

…
> Add a condition check to jump to check the DMI entries
> incase of ACP driver fail to read ACPI _WOV method.

  in case?             failure?


…
> +++ b/sound/soc/amd/yc/acp6x-mach.c
> @@ -578,14 +578,19 @@ static int acp6x_probe(struct platform_device *pdev)
>
>  	handle = ACPI_HANDLE(pdev->dev.parent);
>  	ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
> -	if (!ACPI_FAILURE(ret))
> +	if (!ACPI_FAILURE(ret)) {
>  		wov_en = dmic_status;
> +		if (!wov_en)
> +			return -ENODEV;
> +	} else {
> +		/* Incase of ACPI method read failure then jump to check_dmi_entry */
> +		goto check_dmi_entry;
> +	}
>
>  	if (is_dmic_enable && wov_en)
>  		platform_set_drvdata(pdev, &acp6x_card);
…

Is there a need to adjust another condition check accordingly?

Regards,
Markus

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

* Re: [PATCH] ASoC: amd: yc: Fix the wrong return value
  2024-12-09 13:46 ` Markus Elfring
@ 2024-12-10  6:24   ` potturu venkata prasad
  2024-12-10  7:28     ` Markus Elfring
  0 siblings, 1 reply; 6+ messages in thread
From: potturu venkata prasad @ 2024-12-10  6:24 UTC (permalink / raw)
  To: Markus Elfring, alsa-devel, linux-sound, Mark Brown
  Cc: LKML, Basavaraj Hiregoudar, Jaroslav Kysela, Jiawei Wang,
	Liam Girdwood, Mario Limonciello, Sunil-kumar Dommati,
	Syed Saba Kareem, Takashi Iwai, Vijendar Mukunda, end.to.start


On 12/9/24 19:16, Markus Elfring wrote:
Hi Markus,
> …
>> Add a condition check to jump to check the DMI entries
>> incase of ACP driver fail to read ACPI _WOV method.
>    in case?             failure?
It's a continuous statement.
"Added a condition check to jump into check_dmi_entry when ACP driver 
fail to read ACPI _WOV method".
>
>
> …
>> +++ b/sound/soc/amd/yc/acp6x-mach.c
>> @@ -578,14 +578,19 @@ static int acp6x_probe(struct platform_device *pdev)
>>
>>   	handle = ACPI_HANDLE(pdev->dev.parent);
>>   	ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
>> -	if (!ACPI_FAILURE(ret))
>> +	if (!ACPI_FAILURE(ret)) {
>>   		wov_en = dmic_status;
>> +		if (!wov_en)
>> +			return -ENODEV;
>> +	} else {
>> +		/* Incase of ACPI method read failure then jump to check_dmi_entry */
>> +		goto check_dmi_entry;
>> +	}
>>
>>   	if (is_dmic_enable && wov_en)
>>   		platform_set_drvdata(pdev, &acp6x_card);
> …
>
> Is there a need to adjust another condition check accordingly?
No Markus, not required.
>
> Regards,
> Markus

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

* Re: [PATCH] ASoC: amd: yc: Fix the wrong return value
  2024-12-10  6:24   ` potturu venkata prasad
@ 2024-12-10  7:28     ` Markus Elfring
  2024-12-10  8:37       ` potturu venkata prasad
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2024-12-10  7:28 UTC (permalink / raw)
  To: Venkata Prasad Potturu, alsa-devel, linux-sound, Mark Brown
  Cc: LKML, Basavaraj Hiregoudar, Jaroslav Kysela, Jiawei Wang,
	Liam Girdwood, Mario Limonciello, Sunil-kumar Dommati,
	Syed Saba Kareem, Takashi Iwai, Vijendar Mukunda, end.to.start

>> …
>>> +++ b/sound/soc/amd/yc/acp6x-mach.c
>>> @@ -578,14 +578,19 @@ static int acp6x_probe(struct platform_device *pdev)
>>>
>>>       handle = ACPI_HANDLE(pdev->dev.parent);
>>>       ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
>>> -    if (!ACPI_FAILURE(ret))
>>> +    if (!ACPI_FAILURE(ret)) {
>>>           wov_en = dmic_status;
>>> +        if (!wov_en)
>>> +            return -ENODEV;
>>> +    } else {
>>> +        /* Incase of ACPI method read failure then jump to check_dmi_entry */
>>> +        goto check_dmi_entry;
>>> +    }
>>>
>>>       if (is_dmic_enable && wov_en)
>>>           platform_set_drvdata(pdev, &acp6x_card);
>> …
>>
>> Is there a need to adjust another condition check accordingly?
> No Markus, not required.

Can it be that the expression part “&& wov_en” became redundant with the proposed
source code adjustment?

Regards,
Markus

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

* Re: [PATCH] ASoC: amd: yc: Fix the wrong return value
  2024-12-10  7:28     ` Markus Elfring
@ 2024-12-10  8:37       ` potturu venkata prasad
  0 siblings, 0 replies; 6+ messages in thread
From: potturu venkata prasad @ 2024-12-10  8:37 UTC (permalink / raw)
  To: Markus Elfring, alsa-devel, linux-sound, Mark Brown
  Cc: LKML, Basavaraj Hiregoudar, Jaroslav Kysela, Jiawei Wang,
	Liam Girdwood, Mario Limonciello, Sunil-kumar Dommati,
	Syed Saba Kareem, Takashi Iwai, Vijendar Mukunda, end.to.start


On 12/10/24 12:58, Markus Elfring wrote:
>>> …
>>>> +++ b/sound/soc/amd/yc/acp6x-mach.c
>>>> @@ -578,14 +578,19 @@ static int acp6x_probe(struct platform_device *pdev)
>>>>
>>>>        handle = ACPI_HANDLE(pdev->dev.parent);
>>>>        ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
>>>> -    if (!ACPI_FAILURE(ret))
>>>> +    if (!ACPI_FAILURE(ret)) {
>>>>            wov_en = dmic_status;
>>>> +        if (!wov_en)
>>>> +            return -ENODEV;
>>>> +    } else {
>>>> +        /* Incase of ACPI method read failure then jump to check_dmi_entry */
>>>> +        goto check_dmi_entry;
>>>> +    }
>>>>
>>>>        if (is_dmic_enable && wov_en)
>>>>            platform_set_drvdata(pdev, &acp6x_card);
>>> …
>>>
>>> Is there a need to adjust another condition check accordingly?
>> No Markus, not required.
> Can it be that the expression part “&& wov_en” became redundant with the proposed
> source code adjustment?
Agreed, will remove && wov_en  and then send v2 patch.
>
> Regards,
> Markus

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

* Re: [PATCH] ASoC: amd: yc: Fix the wrong return value
  2024-12-09 10:13 [PATCH] ASoC: amd: yc: Fix the wrong return value Venkata Prasad Potturu
  2024-12-09 13:46 ` Markus Elfring
@ 2024-12-10 14:51 ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-12-10 14:51 UTC (permalink / raw)
  To: alsa-devel, Venkata Prasad Potturu
  Cc: Vijendar.Mukunda, mario.limonciello, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, syed.sabakareem, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, end.to.start, Jiawei Wang,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

On Mon, 09 Dec 2024 15:43:17 +0530, Venkata Prasad Potturu wrote:
> With the current implementation, when ACP driver fails to read
> ACPI _WOV entry then the DMI overrides code won't invoke,
> may cause regressions for some BIOS versions.
> 
> Add a condition check to jump to check the DMI entries
> incase of ACP driver fail to read ACPI _WOV method.
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: amd: yc: Fix the wrong return value
      commit: 984795e76def5c903724b8d6a8228e356bbdf2af

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] 6+ messages in thread

end of thread, other threads:[~2024-12-10 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09 10:13 [PATCH] ASoC: amd: yc: Fix the wrong return value Venkata Prasad Potturu
2024-12-09 13:46 ` Markus Elfring
2024-12-10  6:24   ` potturu venkata prasad
2024-12-10  7:28     ` Markus Elfring
2024-12-10  8:37       ` potturu venkata prasad
2024-12-10 14:51 ` Mark Brown

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