alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>
Cc: alsa-devel@alsa-project.org, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	linux-kernel@vger.kernel.org,
	sound-open-firmware@alsa-project.org
Subject: Re: [PATCH v4 01/11] ASoC: SOF: core: add 'no_wq' probe and remove callbacks
Date: Thu, 7 Sep 2023 13:29:49 -0400	[thread overview]
Message-ID: <6d39eac7-06c7-45f0-0318-72be1753641f@linux.intel.com> (raw)
In-Reply-To: <4d84a799-c07e-e917-7c82-2f24456e3ac2@linux.intel.com>



On 9/5/23 08:37, Pierre-Louis Bossart wrote:
> 
> 
> On 9/1/23 08:44, Péter Ujfalusi wrote:
>>
>>
>> On 01/09/2023 15:15, Kai Vehmanen wrote:
>>> Hi,
>>>
>>> On Wed, 30 Aug 2023, Maarten Lankhorst wrote:
>>>
>>>> With the upcoming changes for i915/Xe driver relying on the
>>>> -EPROBE_DEFER mechanism, we need to have a first pass of the probe
>>>> which cannot be pushed to a workqueue. Introduce 2 new optional
>>>> callbacks.
>>> [...]
>>>> diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
>>>> index 30db685cc5f4b..54c384a5d6140 100644
>>>> --- a/sound/soc/sof/core.c
>>>> +++ b/sound/soc/sof/core.c
>>>> @@ -327,8 +327,6 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
>>>>  dsp_err:
>>>>  	snd_sof_remove(sdev);
>>>>  probe_err:
>>>> -	sof_ops_free(sdev);
>>>> -
>>>
>>> this seems a bit out-of-place in this patch. It seems a valid change,
>>> but not really related to this patch, right?
>>
>> The ops needs to be preserved even if the wq fails since the patch wants
>> to call snd_sof_remove_no_wq() unconditionally on remove.
>>
>>> We seem to have a related fix waiting to be sent to alsa-devel, by
>>> Peter:
>>> "ASoC: SOF: core: Only call sof_ops_free() on remove if the probe wa"
>>> https://github.com/thesofproject/linux/pull/4515
>>
>> I guess we can revert that in sof-dev, if this is the preferred way?
>>
>>> ... not yet in Mark's tree.
>>>
>>> Otherwise patch looks good to me.
>>
>> I would have not created the snd_sof_remove_no_wq() as it makes not much
>> functional sense.
>> It might be even better if the remove in the wq would do the
>> hda_codec_i915_exit() as the module will remain in there until the user
>> removes it.
> 
> I think find all this very confusing, because there is no workqueue used
> in the remove steps. The workqueue is only used ONCE during the probe.

Maybe we should just remove any references to workqueues, and have

probe_start (cannot run in a wq)
probe (may run in a wq)
remove (cannot run in a wq, needs to call cancel_work_sync() if the
probe runs in a wq)
remove_last (cannot run in a wq, releases all resources acquired in
probe_start)

Or something similar that shows the symmetry between steps and when the
wq is allowed.

  reply	other threads:[~2023-09-07 17:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 15:36 [PATCH v4 00/11] sound: Use -EPROBE_DEFER instead of i915 module loading Maarten Lankhorst
2023-08-30 15:36 ` [PATCH v4 01/11] ASoC: SOF: core: add 'no_wq' probe and remove callbacks Maarten Lankhorst
2023-08-30 17:13   ` Pierre-Louis Bossart
2023-08-31 10:44     ` Maarten Lankhorst
2023-09-01 12:22     ` Kai Vehmanen
2023-09-01 12:15   ` Kai Vehmanen
2023-09-01 12:44     ` Péter Ujfalusi
2023-09-05 12:37       ` Pierre-Louis Bossart
2023-09-07 17:29         ` Pierre-Louis Bossart [this message]
2023-09-11  6:51           ` Péter Ujfalusi
2023-09-12  0:25             ` Pierre-Louis Bossart
2023-09-12  6:10               ` Péter Ujfalusi
2023-09-12 14:02                 ` Pierre-Louis Bossart
2023-08-30 15:36 ` [PATCH v4 02/11] ASoC: SOF: Intel: hda: start splitting the probe Maarten Lankhorst
2023-08-30 15:36 ` [PATCH v4 03/11] ALSA: hda/intel: Fix error handling in azx_probe() Maarten Lankhorst
2023-08-30 15:36 ` [PATCH v4 04/11] ALSA: hda/i915: Allow override of gpu binding Maarten Lankhorst
2023-08-30 15:36 ` [PATCH v4 05/11] ALSA: hda/i915: Add an allow_modprobe argument to snd_hdac_i915_init Maarten Lankhorst
2023-08-30 15:36 ` [PATCH v4 06/11] ALSA: hda/i915: Allow xe as match for i915_component_master_match Maarten Lankhorst
2023-08-30 15:36 ` [PATCH v4 07/11] ASoC: Intel: avs: Move snd_hdac_i915_init to before probe_work Maarten Lankhorst
2023-08-31 10:14   ` Amadeusz Sławiński
2023-08-30 15:36 ` [PATCH v4 08/11] ASoC: Intel: Skylake: " Maarten Lankhorst
2023-08-31 10:15   ` Amadeusz Sławiński
2023-08-30 15:36 ` [PATCH v4 09/11] ALSA: hda/intel: " Maarten Lankhorst
2023-08-30 15:36 ` [PATCH v4 10/11] ASoC: SOF: Intel: Move binding to display driver outside of deferred probe Maarten Lankhorst
2023-08-30 23:06   ` kernel test robot
2023-08-30 23:59   ` kernel test robot
2023-09-01 12:33   ` Kai Vehmanen
2023-08-30 15:36 ` [PATCH v4 11/11] ALSA: hda/i915: Remove extra argument from snd_hdac_i915_init Maarten Lankhorst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d39eac7-06c7-45f0-0318-72be1753641f@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).