All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling
@ 2024-03-27 10:46 Vijendar Mukunda
  2024-03-27 10:46 ` [PATCH 2/2] ASoC: amd: acp: fix for acp pdm configuration check Vijendar Mukunda
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Vijendar Mukunda @ 2024-03-27 10:46 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, venkataprasad.potturu, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, Vijendar Mukunda, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Syed Saba Kareem, Jarkko Nikula,
	Claudiu Beznea,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

If acp_init() fails, acp pci driver probe should return error.
Add acp_init() function return value check logic.

Fixes: e61b415515d3 ("ASoC: amd: acp: refactor the acp init and de-init sequence")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/acp/acp-pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
index 8c8b1dcac628..c1d4140f0746 100644
--- a/sound/soc/amd/acp/acp-pci.c
+++ b/sound/soc/amd/acp/acp-pci.c
@@ -115,7 +115,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
 		goto unregister_dmic_dev;
 	}
 
-	acp_init(chip);
+	ret = acp_init(chip);
+	if (ret)
+		return ret;
+
 	res = devm_kcalloc(&pci->dev, num_res, sizeof(struct resource), GFP_KERNEL);
 	if (!res) {
 		ret = -ENOMEM;
-- 
2.34.1


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

* [PATCH 2/2] ASoC: amd: acp: fix for acp pdm configuration check
  2024-03-27 10:46 [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Vijendar Mukunda
@ 2024-03-27 10:46 ` Vijendar Mukunda
  2024-03-27 14:58 ` [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Mark Brown
  2024-03-28 22:01 ` (subset) " Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Vijendar Mukunda @ 2024-03-27 10:46 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, venkataprasad.potturu, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, Vijendar Mukunda, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Syed Saba Kareem, Claudiu Beznea,
	Jarkko Nikula,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

ACP PDM configuration has to be verified for all combinations.
Remove FLAG_AMD_LEGACY_ONLY_DMIC check.

Fixes: 3a94c8ad0aae ("ASoC: amd: acp: add code for scanning acp pdm controller")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/acp/acp-pci.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
index c1d4140f0746..21574cfaa136 100644
--- a/sound/soc/amd/acp/acp-pci.c
+++ b/sound/soc/amd/acp/acp-pci.c
@@ -136,11 +136,9 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
 		}
 	}
 
-	if (flag == FLAG_AMD_LEGACY_ONLY_DMIC) {
-		ret = check_acp_pdm(pci, chip);
-		if (ret < 0)
-			goto skip_pdev_creation;
-	}
+	ret = check_acp_pdm(pci, chip);
+	if (ret < 0)
+		goto skip_pdev_creation;
 
 	chip->flag = flag;
 	memset(&pdevinfo, 0, sizeof(pdevinfo));
-- 
2.34.1


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

* Re: [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling
  2024-03-27 10:46 [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Vijendar Mukunda
  2024-03-27 10:46 ` [PATCH 2/2] ASoC: amd: acp: fix for acp pdm configuration check Vijendar Mukunda
@ 2024-03-27 14:58 ` Mark Brown
  2024-03-27 17:38   ` Mukunda,Vijendar
  2024-03-28 22:01 ` (subset) " Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2024-03-27 14:58 UTC (permalink / raw)
  To: Vijendar Mukunda
  Cc: alsa-devel, venkataprasad.potturu, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Syed Saba Kareem, Jarkko Nikula, Claudiu Beznea,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

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

On Wed, Mar 27, 2024 at 04:16:52PM +0530, Vijendar Mukunda wrote:

> @@ -115,7 +115,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
>  		goto unregister_dmic_dev;
>  	}
>  
> -	acp_init(chip);
> +	ret = acp_init(chip);
> +	if (ret)
> +		return ret;
> +

The return check is good but shouldn't this be a 'goto
unregister_dmic_dev' like the above case so we do cleanup?

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

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

* Re: [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling
  2024-03-27 14:58 ` [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Mark Brown
@ 2024-03-27 17:38   ` Mukunda,Vijendar
  0 siblings, 0 replies; 5+ messages in thread
From: Mukunda,Vijendar @ 2024-03-27 17:38 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, venkataprasad.potturu, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Syed Saba Kareem, Jarkko Nikula, Claudiu Beznea,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

On 27/03/24 20:28, Mark Brown wrote:
> On Wed, Mar 27, 2024 at 04:16:52PM +0530, Vijendar Mukunda wrote:
>
>> @@ -115,7 +115,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
>>  		goto unregister_dmic_dev;
>>  	}
>>  
>> -	acp_init(chip);
>> +	ret = acp_init(chip);
>> +	if (ret)
>> +		return ret;
>> +
> The return check is good but shouldn't this be a 'goto
> unregister_dmic_dev' like the above case so we do cleanup?
I do agree. Will modify the code and respin the patch series.


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

* Re: (subset) [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling
  2024-03-27 10:46 [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Vijendar Mukunda
  2024-03-27 10:46 ` [PATCH 2/2] ASoC: amd: acp: fix for acp pdm configuration check Vijendar Mukunda
  2024-03-27 14:58 ` [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Mark Brown
@ 2024-03-28 22:01 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2024-03-28 22:01 UTC (permalink / raw)
  To: Vijendar Mukunda
  Cc: alsa-devel, venkataprasad.potturu, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Syed Saba Kareem, Jarkko Nikula, Claudiu Beznea,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

On Wed, 27 Mar 2024 16:16:52 +0530, Vijendar Mukunda wrote:
> If acp_init() fails, acp pci driver probe should return error.
> Add acp_init() function return value check logic.
> 
> Fixes: e61b415515d3 ("ASoC: amd: acp: refactor the acp init and de-init sequence")
> 
> 

Applied to

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

Thanks!

[2/2] ASoC: amd: acp: fix for acp pdm configuration check
      commit: 4af565de9f8c74b9f6035924ce0d40adec211246

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

end of thread, other threads:[~2024-03-28 22:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-27 10:46 [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Vijendar Mukunda
2024-03-27 10:46 ` [PATCH 2/2] ASoC: amd: acp: fix for acp pdm configuration check Vijendar Mukunda
2024-03-27 14:58 ` [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling Mark Brown
2024-03-27 17:38   ` Mukunda,Vijendar
2024-03-28 22:01 ` (subset) " Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.