From: Takashi Iwai <tiwai@suse.de>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
Mark Brown <broonie@kernel.org>, Simon <horms@verge.net.au>
Subject: Re: [PATCH] ASoC: rsnd: stop all working stream when .remove
Date: Tue, 05 Sep 2017 11:33:42 +0200 [thread overview]
Message-ID: <s5hy3pto5ft.wl-tiwai@suse.de> (raw)
In-Reply-To: <PS1PR0601MB188127AD25441AE8543A0EE1D4960@PS1PR0601MB1881.apcprd06.prod.outlook.com>
On Tue, 05 Sep 2017 10:58:37 +0200,
Kuninori Morimoto wrote:
>
> Hi Takashi-san
>
> Thank you for your feedback
>
> > Right, you can't cancel or return an error at that point.
> > That is, you'd need to sync (wait) until the all top-level operations are canceled at remove callback.
> >
> > For example, snd_card_free() processes the disconnection procedure at first,
> > then waits for the completion. That's how the hot-unplug works safely.
> > It's implemented, at least, in the top-level driver removal.
> >
> > Now for the lower level driver, you'd need a similar strategy; notify to the toplevel for
> > hot-unplug (disconnect in ALSA), and sync with the stop operation, then continue the rest of its own remove procedure.
>
> OK, it needs ALSA SoC framework side new feature.
Not only ASoC but also in all ALSA component generally.
The component-level hot unplug isn't implemented yet properly.
> But can I confirm current situation ?
>
> In ALSA SoC, it has Card/CPU/Codec/Platform drivers, and we can unbind these randomly.
> Now, if I unbind CPU first, it checks connected Card, and will disconnect it if needed (Then, other drivers are as-is).
> Because of this, Card will be disconnected automatically, and we can't use it again if user didn't remove all other
> remaining drivers and re-bind all drivers again. This is current ALSA SoC I think.
>
> If my understanding was correct, your idea is that we want to call remove function for all connected drivers somehow.
> And then, Card want to wait all drivers are removed. Correct ?
Right. Unless we really want to support the hog-plug/unplug of each
component, it'd be more straightforward to do the full hot-unplug upon
every component unbind action.
> I'm happy to work for it.
> But adding new unplug feature is for sync with all "drivers", and this patch is sync for "clk" for my CPU driver.
> Can we separate these ?
It belongs with the same thing. Basically you're tweaking clk per PCM
stream status. By handling the full hot-plug properly, the PCM stream
is assured to be stopped, thus you don't have to fiddle with clk in
the remove callback at all.
Takashi
next prev parent reply other threads:[~2017-09-05 9:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 4:34 [PATCH] ASoC: rsnd: stop all working stream when .remove Kuninori Morimoto
2017-09-01 7:29 ` Takashi Iwai
2017-09-01 7:48 ` Kuninori Morimoto
2017-09-01 8:17 ` Takashi Iwai
2017-09-04 17:44 ` Kuninori Morimoto
2017-09-04 18:43 ` Takashi Iwai
2017-09-04 18:46 ` Takashi Iwai
2017-09-05 7:40 ` Kuninori Morimoto
2017-09-05 8:09 ` Takashi Iwai
2017-09-05 8:58 ` Kuninori Morimoto
2017-09-05 9:33 ` Takashi Iwai [this message]
2017-09-05 10:07 ` Kuninori Morimoto
2017-09-05 10:12 ` Mark Brown
2017-09-05 11:35 ` Takashi Iwai
2017-09-05 12:58 ` Takashi Iwai
2017-09-26 8:21 ` Kuninori Morimoto
2017-09-27 5:14 ` Kuninori Morimoto
2017-10-06 13:19 ` Takashi Iwai
2017-10-10 8:00 ` Kuninori Morimoto
2017-10-11 6:52 ` Kuninori Morimoto
2017-09-05 14:04 ` Mark Brown
2017-09-05 14:08 ` Takashi Iwai
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=s5hy3pto5ft.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.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