2023-10-09 11:55:38

by Maarten Lankhorst

[permalink] [raw]
Subject: [PATCH v7 01/13] ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran.

In an effort to not call sof_ops_free twice, we stopped running it when
probe was aborted.

Check the result of cancel_work_sync to see if this was the case.

Fixes: 31bb7bd9ffee ("ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful")
Cc: Peter Ujfalusi <[email protected]>
Acked-by: Mark Brown <[email protected]>
---
sound/soc/sof/core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 2d1616b81485c..0938b259f7034 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -459,9 +459,10 @@ int snd_sof_device_remove(struct device *dev)
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
struct snd_sof_pdata *pdata = sdev->pdata;
int ret;
+ bool aborted = false;

if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
- cancel_work_sync(&sdev->probe_work);
+ aborted = cancel_work_sync(&sdev->probe_work);

/*
* Unregister any registered client device first before IPC and debugfs
@@ -487,6 +488,9 @@ int snd_sof_device_remove(struct device *dev)
snd_sof_free_debug(sdev);
snd_sof_remove(sdev);
sof_ops_free(sdev);
+ } else if (aborted) {
+ /* probe_work never ran */
+ sof_ops_free(sdev);
}

/* release firmware */
--
2.39.2


2023-10-13 09:16:04

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH v7 01/13] ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran.

On Mon, 09 Oct 2023 13:54:25 +0200,
Maarten Lankhorst wrote:
>
> In an effort to not call sof_ops_free twice, we stopped running it when
> probe was aborted.
>
> Check the result of cancel_work_sync to see if this was the case.
>
> Fixes: 31bb7bd9ffee ("ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful")
> Cc: Peter Ujfalusi <[email protected]>
> Acked-by: Mark Brown <[email protected]>

Your Signed-off-by tag is missing.

Could you resubmit?


thanks,

Takashi

> ---
> sound/soc/sof/core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
> index 2d1616b81485c..0938b259f7034 100644
> --- a/sound/soc/sof/core.c
> +++ b/sound/soc/sof/core.c
> @@ -459,9 +459,10 @@ int snd_sof_device_remove(struct device *dev)
> struct snd_sof_dev *sdev = dev_get_drvdata(dev);
> struct snd_sof_pdata *pdata = sdev->pdata;
> int ret;
> + bool aborted = false;
>
> if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
> - cancel_work_sync(&sdev->probe_work);
> + aborted = cancel_work_sync(&sdev->probe_work);
>
> /*
> * Unregister any registered client device first before IPC and debugfs
> @@ -487,6 +488,9 @@ int snd_sof_device_remove(struct device *dev)
> snd_sof_free_debug(sdev);
> snd_sof_remove(sdev);
> sof_ops_free(sdev);
> + } else if (aborted) {
> + /* probe_work never ran */
> + sof_ops_free(sdev);
> }
>
> /* release firmware */
> --
> 2.39.2
>

2023-10-19 10:03:11

by Maarten Lankhorst

[permalink] [raw]
Subject: Re: [PATCH v7 01/13] ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran.

Hey,

Den 2023-10-13 kl. 11:15, skrev Takashi Iwai:
> On Mon, 09 Oct 2023 13:54:25 +0200,
> Maarten Lankhorst wrote:
>> In an effort to not call sof_ops_free twice, we stopped running it when
>> probe was aborted.
>>
>> Check the result of cancel_work_sync to see if this was the case.
>>
>> Fixes: 31bb7bd9ffee ("ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful")
>> Cc: Peter Ujfalusi <[email protected]>
>> Acked-by: Mark Brown <[email protected]>
> Your Signed-off-by tag is missing.
>
> Could you resubmit?
>
>
> thanks,
>
> Takashi

I missed this email apparently.

Signed-off-by: Maarten Lankhorst <[email protected]>

Is this enough for the tooling, or do you need an actual resubmit?

Cheers,
~Maarten

>
>> ---
>> sound/soc/sof/core.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
>> index 2d1616b81485c..0938b259f7034 100644
>> --- a/sound/soc/sof/core.c
>> +++ b/sound/soc/sof/core.c
>> @@ -459,9 +459,10 @@ int snd_sof_device_remove(struct device *dev)
>> struct snd_sof_dev *sdev = dev_get_drvdata(dev);
>> struct snd_sof_pdata *pdata = sdev->pdata;
>> int ret;
>> + bool aborted = false;
>>
>> if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
>> - cancel_work_sync(&sdev->probe_work);
>> + aborted = cancel_work_sync(&sdev->probe_work);
>>
>> /*
>> * Unregister any registered client device first before IPC and debugfs
>> @@ -487,6 +488,9 @@ int snd_sof_device_remove(struct device *dev)
>> snd_sof_free_debug(sdev);
>> snd_sof_remove(sdev);
>> sof_ops_free(sdev);
>> + } else if (aborted) {
>> + /* probe_work never ran */
>> + sof_ops_free(sdev);
>> }
>>
>> /* release firmware */
>> --
>> 2.39.2
>>

2023-10-19 13:10:51

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH v7 01/13] ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran.

On Thu, 19 Oct 2023 12:02:55 +0200,
Maarten Lankhorst wrote:
>
> Hey,
>
> Den 2023-10-13 kl. 11:15, skrev Takashi Iwai:
> > On Mon, 09 Oct 2023 13:54:25 +0200,
> > Maarten Lankhorst wrote:
> >> In an effort to not call sof_ops_free twice, we stopped running it when
> >> probe was aborted.
> >>
> >> Check the result of cancel_work_sync to see if this was the case.
> >>
> >> Fixes: 31bb7bd9ffee ("ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful")
> >> Cc: Peter Ujfalusi <[email protected]>
> >> Acked-by: Mark Brown <[email protected]>
> > Your Signed-off-by tag is missing.
> >
> > Could you resubmit?
> >
> >
> > thanks,
> >
> > Takashi
>
> I missed this email apparently.
>
> Signed-off-by: Maarten Lankhorst <[email protected]>
>
> Is this enough for the tooling, or do you need an actual resubmit?

That's enough, and I applied the series to for-next branch now.


thanks,

Takashi