[PATCH 1/3] ASoC: apple: mca: Trigger, not deassert, the peripheral reset
Replace the deassertion of the peripheral's shared reset with the triggering of a pulse on it. This is what we should have been using all along as the platform's custom is not leaving the reset asserted on unused peripherals.
Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer povik+lin@cutebit.org ---
Cc: Philipp Zabel p.zabel@pengutronix.de
sound/soc/apple/mca.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 69643524796e..75925bfcf754 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -995,7 +995,7 @@ static void apple_mca_release(struct mca_data *mca) if (!IS_ERR_OR_NULL(mca->pd_dev)) dev_pm_domain_detach(mca->pd_dev, true);
- reset_control_assert(mca->rstc); + reset_control_rearm(mca->rstc); }
static int apple_mca_probe(struct platform_device *pdev) @@ -1049,12 +1049,12 @@ static int apple_mca_probe(struct platform_device *pdev) DL_FLAG_RPM_ACTIVE); if (!mca->pd_link) { ret = -EINVAL; - /* Prevent an unbalanced reset assert */ + /* Prevent an unbalanced reset rearm */ mca->rstc = NULL; goto err_release; }
- reset_control_deassert(mca->rstc); + reset_control_reset(mca->rstc);
for (i = 0; i < nclusters; i++) { struct mca_cluster *cl = &clusters[i];
The commit 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels") shuffled around with the requesting and releasing of DMA channels. It left behind stale release calls from within apple_mca_release, remove those now.
Fixes: 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels") Signed-off-by: Martin Povišer povik+lin@cutebit.org --- sound/soc/apple/mca.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 75925bfcf754..7ca653987b78 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -970,18 +970,11 @@ static const struct snd_soc_component_driver mca_component = {
static void apple_mca_release(struct mca_data *mca) { - int i, stream; + int i;
for (i = 0; i < mca->nclusters; i++) { struct mca_cluster *cl = &mca->clusters[i];
- for_each_pcm_streams(stream) { - if (IS_ERR_OR_NULL(cl->dma_chans[stream])) - continue; - - dma_release_channel(cl->dma_chans[stream]); - } - if (!IS_ERR_OR_NULL(cl->clk_parent)) clk_put(cl->clk_parent);
On removal of the driver, the ASoC component should be unregistered first, before we start releasing any of the other resources.
Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer povik+lin@cutebit.org --- sound/soc/apple/mca.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 7ca653987b78..24381c42eb54 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -1129,8 +1129,8 @@ static int apple_mca_probe(struct platform_device *pdev) } }
- ret = devm_snd_soc_register_component(&pdev->dev, &mca_component, - dai_drivers, nclusters * 2); + ret = snd_soc_register_component(&pdev->dev, &mca_component, + dai_drivers, nclusters * 2); if (ret) { dev_err(&pdev->dev, "unable to register ASoC component: %d\n", ret); @@ -1148,6 +1148,7 @@ static int apple_mca_remove(struct platform_device *pdev) { struct mca_data *mca = platform_get_drvdata(pdev);
+ snd_soc_unregister_component(&pdev->dev); apple_mca_release(mca); return 0; }
On Tue, 27 Sep 2022 13:34:24 +0200, Martin Povišer wrote:
Replace the deassertion of the peripheral's shared reset with the triggering of a pulse on it. This is what we should have been using all along as the platform's custom is not leaving the reset asserted on unused peripherals.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: apple: mca: Trigger, not deassert, the peripheral reset commit: d584e73e7310971cc226ef0e2a1bc0526da0d582 [2/3] ASoC: apple: mca: Remove stale release of DMA channels commit: e92e50e4263f5cf9c731ef5593c31f94dc3b7b8c [3/3] ASoC: apple: mca: Adjust timing of component unregister commit: db6ae79a7e4f729457ec42db5d6d0fbe0e35784c
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
participants (2)
-
Mark Brown
-
Martin Povišer