2022-04-22 20:19:57

by Codrin Ciubotariu

[permalink] [raw]
Subject: [PATCH 1/2] Revert "ASoC: dmaengine: do not use a NULL prepare_slave_config() callback"

This reverts commit 9a1e13440a4f2e7566fd4c5eae6a53e6400e08a4.

As pointed out by Sascha Hauer, this patch changes:
if (pmc->config && !pcm->config->prepare_slave_config)
<do nothing>
to:
if (pmc->config && !pcm->config->prepare_slave_config)
snd_dmaengine_pcm_prepare_slave_config()

This breaks the drivers that do not need a call to
dmaengine_slave_config(). Drivers that still need to call
snd_dmaengine_pcm_prepare_slave_config(), but have a NULL
pcm->config->prepare_slave_config should use
snd_dmaengine_pcm_prepare_slave_config() as their prepare_slave_config
callback.

Fixes: 9a1e13440a4f ("ASoC: dmaengine: do not use a NULL prepare_slave_config() callback")
Reported-by: Sascha Hauer <[email protected]>
Signed-off-by: Codrin Ciubotariu <[email protected]>
---
sound/soc/soc-generic-dmaengine-pcm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 2ab2ddc1294dd..285441d6aeed4 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -86,10 +86,10 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component,

memset(&slave_config, 0, sizeof(slave_config));

- if (pcm->config && pcm->config->prepare_slave_config)
- prepare_slave_config = pcm->config->prepare_slave_config;
- else
+ if (!pcm->config)
prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
+ else
+ prepare_slave_config = pcm->config->prepare_slave_config;

if (prepare_slave_config) {
int ret = prepare_slave_config(substream, params, &slave_config);
--
2.32.0


2022-04-22 20:58:09

by Codrin Ciubotariu

[permalink] [raw]
Subject: [PATCH 2/2] ASoC: atmel: mchp-pdmc: set prepare_slave_config

Since a pointer to struct snd_dmaengine_pcm_config is passed,
snd_dmaengine_pcm_prepare_slave_config() is no longer called unless it's
explicitly set in prepare_slave_config.

Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver")
Suggested-by: Sascha Hauer <[email protected]>
Signed-off-by: Codrin Ciubotariu <[email protected]>
---
sound/soc/atmel/mchp-pdmc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
index 1a7802fbf23c1..a3856c73e2214 100644
--- a/sound/soc/atmel/mchp-pdmc.c
+++ b/sound/soc/atmel/mchp-pdmc.c
@@ -966,6 +966,7 @@ static int mchp_pdmc_process(struct snd_pcm_substream *substream,

static struct snd_dmaengine_pcm_config mchp_pdmc_config = {
.process = mchp_pdmc_process,
+ .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
};

static int mchp_pdmc_probe(struct platform_device *pdev)
--
2.32.0

2022-04-26 01:17:03

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] Revert "ASoC: dmaengine: do not use a NULL prepare_slave_config() callback"

On Thu, 21 Apr 2022 15:54:02 +0300, Codrin Ciubotariu wrote:
> This reverts commit 9a1e13440a4f2e7566fd4c5eae6a53e6400e08a4.
>
> As pointed out by Sascha Hauer, this patch changes:
> if (pmc->config && !pcm->config->prepare_slave_config)
> <do nothing>
> to:
> if (pmc->config && !pcm->config->prepare_slave_config)
> snd_dmaengine_pcm_prepare_slave_config()
>
> [...]

Applied to

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

Thanks!

[1/2] Revert "ASoC: dmaengine: do not use a NULL prepare_slave_config() callback"
commit: 660564fc9a92a893a14f255be434f7ea0b967901
[2/2] ASoC: atmel: mchp-pdmc: set prepare_slave_config
commit: 2bde1985e39173d8cb64005dad6f34e9bee4c750

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

2022-04-26 14:23:57

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] Revert "ASoC: dmaengine: do not use a NULL prepare_slave_config() callback"

On Thu, Apr 21, 2022 at 03:54:02PM +0300, Codrin Ciubotariu wrote:
> This reverts commit 9a1e13440a4f2e7566fd4c5eae6a53e6400e08a4.
>
> As pointed out by Sascha Hauer, this patch changes:
> if (pmc->config && !pcm->config->prepare_slave_config)

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.


Attachments:
(No filename) (587.00 B)
signature.asc (499.00 B)
Download all attachments

2022-04-26 18:02:32

by Codrin Ciubotariu

[permalink] [raw]
Subject: Re: [PATCH 1/2] Revert "ASoC: dmaengine: do not use a NULL prepare_slave_config() callback"

On 25.04.2022 19:00, Mark Brown wrote:
> On Thu, Apr 21, 2022 at 03:54:02PM +0300, Codrin Ciubotariu wrote:
>> This reverts commit 9a1e13440a4f2e7566fd4c5eae6a53e6400e08a4.
>>
>> As pointed out by Sascha Hauer, this patch changes:
>> if (pmc->config && !pcm->config->prepare_slave_config)
> Please submit patches using subject lines reflecting the style for the
> subsystem, this makes it easier for people to identify relevant patches.
> Look at what existing commits in the area you're changing are doing and
> make sure your subject lines visually resemble what they're doing.
> There's no need to resubmit to fix this alone.

I did not know how to do properly do a revert. I saw some patches of
Greg that were made with 'git revert'. I will remember for next time.
Thanks for taking my patch anyway!

Best regards,
Codrin