From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH v2 0/2] Add snd_card_disconnect_sync() helper Date: Fri, 13 Oct 2017 11:43:59 +0200 Message-ID: References: <20171011101618.8736-1-tiwai@suse.de> <87fuanv70u.wl%kuninori.morimoto.gx@renesas.com> <87efq7v2qf.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id C03D0266EE0 for ; Fri, 13 Oct 2017 11:44:00 +0200 (CEST) In-Reply-To: <87efq7v2qf.wl%kuninori.morimoto.gx@renesas.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Kuninori Morimoto Cc: alsa-devel@alsa-project.org, Mark Brown List-Id: alsa-devel@alsa-project.org On Fri, 13 Oct 2017 11:11:42 +0200, Kuninori Morimoto wrote: > > > Hi Takashi > > > > I tested this patch-set. > > > I noticed that it doesn't work if I used DPCM > > > (Kernel has Oops). > > > I will investigate it next week > > > > Could you show the Oops message if you have? > > My concern is whether it happens by stopping at disconnect, or it's > > just another missing piece. > > OK, but kernel log doesn't help you. > see below > > My environment now is I'm using DPCM. > FE : rsnd > FE : rsnd > BE : ak4613 > > 1st issue is that kernel need below patch. > I guess BE is using dummy driver, and it doesn't have ops(?). > If this is needed, I can post it. No, this can't be right. Every PCM implementation mandates the presence of a trigger callback. It's a must. If a fix needed, it has to be fixed in the driver side. > ----------------------- > diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c > index 2fec2fe..972408b 100644 > --- a/sound/core/pcm_native.c > +++ b/sound/core/pcm_native.c > @@ -1241,7 +1241,8 @@ static int snd_pcm_do_stop(struct snd_pcm_substream *substream, int state) > { > if (substream->runtime->trigger_master == substream && > snd_pcm_running(substream)) > - substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); > + if (substream->ops && substream->ops->trigger) > + substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); > return 0; /* unconditonally stop all substreams */ > } > ----------------------- > After this patch, my driver side clock counter mismatch Oops happen. > It seems this is because FE side wasn't called snd_pcm_stop(); > (= BE side only called snd_pcm_stop()). So the check might work around an Oops, but it's no "fix", per se. > I could confirm this by printing who's stop was called by local quick hack. > > Maybe timing reason, if kernel has Oops for some reasons, > then, both BE/FE snd_pcm_stop() are called. > If no Oops, BE snd_pcm_stop() only called. Any pending delayed work (like rtd->delayed_work)? This is flushed at soc_cleanup_card_resources(), but it's called at card removal, thus it's too late for the hot-removal of the component. thanks, Takashi