From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relmlor2.renesas.com ([210.160.252.172]:45871 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751342AbdDCI0K (ORCPT ); Mon, 3 Apr 2017 04:26:10 -0400 Message-ID: <87fuhpnbnu.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Takashi Iwai CC: Mark Brown , Linux-Renesas , Linux-ALSA , Lars-Peter , Simon Subject: Re: [alsa-devel] [RFC][PATCH] ASoC: soc-core: verify Sound Card normality In-Reply-To: References: <87vaqsajo0.wl%kuninori.morimoto.gx@renesas.com> <20170330215334.zwashvjerpfnkk3u@sirena.org.uk> <878tninh21.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" Date: Mon, 3 Apr 2017 08:26:05 +0000 Sender: linux-renesas-soc-owner@vger.kernel.org List-ID: Hi Takashi-san > > So, we can call snd_soc_unregister_card() whenever CPU/Codec/Platform > > were unregsiterd. > > In theory yes, but you should be careful to do so, e.g. make sure that > it won't be called again by the removal/unbind of other components / > drivers. > > I suggested snd_card_disconnect() because it doesn't release resources > by itself, but it just disconnects from the further accesses. So, > double-free won't happen in this case. It makes the hotunplug safer > as long as the drivers manage the resource releases properly. I had checked many unbind/bind pattern/order on 2nd [RFC] patch which I posted. At first, I believe Oops on unbind/bind issue was solved on it. 2nd, if my understanding was correct, it doesn't have double-free issue, or something like that. But, I'm not 100% sure about 2nd, thus it has [RFC] on patch. Best regards --- Kuninori Morimoto