[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d0aeae4e-0766-4879-9b06-46c78ffdb165@linux.intel.com>
Date: Thu, 31 Aug 2023 12:44:12 +0200
From: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
alsa-devel@...a-project.org
Cc: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Cezary Rojewski <cezary.rojewski@...el.com>,
Liam Girdwood <liam.r.girdwood@...ux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Mark Brown <broonie@...nel.org>,
Daniel Baluta <daniel.baluta@....com>,
linux-kernel@...r.kernel.org, sound-open-firmware@...a-project.org
Subject: Re: [PATCH v4 01/11] ASoC: SOF: core: add 'no_wq' probe and remove
callbacks
Hey,
Den 2023-08-30 kl. 19:13, skrev Pierre-Louis Bossart:
>> +static inline int snd_sof_remove_no_wq(struct snd_sof_dev *sdev)
>> +{
>> + if (sof_ops(sdev)->remove_no_wq)
>> + return sof_ops(sdev)->remove_no_wq(sdev);
>> +
>> + return 0;
>> +}
>> /* probe/remove/shutdown */
>> + int (*probe_no_wq)(struct snd_sof_dev *sof_dev); /* optional */
>> + int (*remove_no_wq)(struct snd_sof_dev *sof_dev); /* optional */
> My initial PR didn't have this remove_no_wq() callback.
>
> For symmetry it could be useful if it is meant to undo what the
> probe_no_wq() did, but conceptually the first thing we do in the remove
> is make sure that workqueue is either not scheduled or we wait until it
> completes.
>
> 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;
>
> if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
> cancel_work_sync(&sdev->probe_work);
That is exactly what I was using it for later on.
I had to have a counter to hda_init() in patch 10/11.
Cheers,
Maarten
Powered by blists - more mailing lists