From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: Re: [PATCH v2 0/2] Add snd_card_disconnect_sync() helper Date: Mon, 16 Oct 2017 02:26:42 +0000 Message-ID: <87k1zvn8ci.wl%kuninori.morimoto.gx@renesas.com> 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-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from relmlie4.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa0.perex.cz (Postfix) with ESMTP id 085D7266D90 for ; Mon, 16 Oct 2017 04:26:48 +0200 (CEST) In-Reply-To: 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: Takashi Iwai Cc: alsa-devel@alsa-project.org, Mark Brown List-Id: alsa-devel@alsa-project.org Hi Takashi > > 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. Current my dirver used delayed_work, but we can control it by snd_soc_runtime_ignore_pmdown_time(); I think my driver now doesn't use delayed_work. But there is still issue. I don't know detail, but it seems snd_pcm_dev_disconnect() and snd_pcm_relase() are called it the same time, both are calling snd_pcm_stop(). Then, snd_pcm_relase() side will calls snd_pcm_detach_substream() and snd_pcm_dev_disconnect() side will die. Mark's suggestion (= hiding BE) can solve this ? Best regards --- Kuninori Morimoto