From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:35064 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757475AbcG0SLx (ORCPT ); Wed, 27 Jul 2016 14:11:53 -0400 Date: Wed, 27 Jul 2016 20:11:49 +0200 Message-ID: From: Takashi Iwai To: Mark Brown Cc: Vinod Koul , Kuninori Morimoto , linux-renesas-soc@vger.kernel.org, Linux-ALSA , Liam Girdwood , Simon Subject: Re: [alsa-devel] Question about struct snd_soc_dai() :: cpu_dai->codec In-Reply-To: <20160727180456.GQ11806@sirena.org.uk> References: <878twpj739.wl%kuninori.morimoto.gx@renesas.com> <20160727032111.GY9681@localhost> <20160727172125.GF9681@localhost> <20160727180456.GQ11806@sirena.org.uk> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-renesas-soc-owner@vger.kernel.org List-ID: On Wed, 27 Jul 2016 20:04:56 +0200, Mark Brown wrote: > > On Wed, Jul 27, 2016 at 10:51:26PM +0530, Vinod Koul wrote: > > On Wed, Jul 27, 2016 at 07:57:05AM +0200, Takashi Iwai wrote: > > > > For unloading the module, yes, it should have been prevented by > > > managing the module refcount. However, unbinding can't be stopped by > > > that. It's a known problem. > > > Oh yes, unload is an issue. Are these any solutions to prevent this? > > > In core, should we de-register the card if one of the components exits. The > > .remove should be called for the driver, thus triggering unregister? > > That's the theory but it's full of holes at the minute. Someone needs > to sit down and fix all the holes in there. Yeah, and it's not so trivial. The unbind can be called at any time, even during a stream is running. This is a kind of hot unplug. The whole nightmare we've faced with usb-audio and co will strike again. I'm wondering whether it's a better option to block the unbind behavior, either in driver base (allowing to return an error) or in the sound side (waiting in remove() until the sane point). Takashi