Skip to contentSkip to conversation

ASoC: amd: acp: fix for acp_init function error handling

PATCH Superseded Vijendar Mukunda 2 participants 5 messages Mar 27, 2024 – Mar 28, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Vijendar Mukunda

author maintainer
#0 lore raw

PATCH 1/2 ASoC: amd: acp: fix for acp_init function error handling

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")
---
 sound/soc/amd/acp/acp-pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/amd/acp/acp-pci.c +4 -1
index 8c8b1dcac628..c1d4140f0746 100644
@@ -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;
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 2/2 ASoC: amd: acp: fix for acp pdm configuration check

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")
---
 sound/soc/amd/acp/acp-pci.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
sound/soc/amd/acp/acp-pci.c +3 -5
index c1d4140f0746..21574cfaa136 100644
@@ -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));
Signature · 1 line
2.34.1
maintainer
#2 lore raw
In reply to Vijendar Mukunda

sound/soc/amd/acp/acp-pci.c static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id · line 121

Quoted 9 lines · Vijendar Mukunda
sound/soc/amd/acp/acp-pci.c +4 -1
@@ -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?

author maintainer
#3 lore raw
Quoted 6 lines · Mark Brown
Quoted 4 lines · Vijendar Mukunda
sound/soc/amd/acp/acp-pci.c +0 -0
@@ -115,7 +115,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
 		goto unregister_dmic_dev;
 	}
 
Quoted 7 lines

sound/soc/amd/acp/acp-pci.c static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id · line 121

Quoted 5 lines
sound/soc/amd/acp/acp-pci.c +4 -1
-	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.

maintainer
#4 lore raw

Re: (subset) [PATCH 1/2] ASoC: amd: acp: fix for acp_init function error handling

In reply to Vijendar Mukunda
Quoted 6 lines · Vijendar Mukunda

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