From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbbAOGVV (ORCPT ); Thu, 15 Jan 2015 01:21:21 -0500 Received: from cantor2.suse.de ([195.135.220.15]:44218 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbbAOGVU (ORCPT ); Thu, 15 Jan 2015 01:21:20 -0500 Date: Thu, 15 Jan 2015 07:21:18 +0100 Message-ID: From: Takashi Iwai To: Mark Brown Cc: Lars-Peter Clausen , "alsa-devel@alsa-project.org" , "Wang, Jiada (ESD)" , "linux-kernel@vger.kernel.org" , "lgirdwood@gmail.com" , "Frkuska, Joshua" Subject: Re: [alsa-devel] unload Audio drivers while playback stream is active case kernel crash In-Reply-To: <20150114163415.GV4160@sirena.org.uk> References: <857E9EDCA6C0904DB3357321AA9123EB0108B66919@NA-MBX-01.mgc.mentorg.com> <20150113215412.GS4160@sirena.org.uk> <54B625A8.8090406@metafoo.de> <54B63E4F.2010506@metafoo.de> <20150114120228.GT4160@sirena.org.uk> <20150114163415.GV4160@sirena.org.uk> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 14 Jan 2015 16:34:15 +0000, Mark Brown wrote: > > On Wed, Jan 14, 2015 at 02:01:33PM +0100, Takashi Iwai wrote: > > Mark Brown wrote: > > > > > Above all, disallowing the module unload while using is the common > > > > behavior of any other drivers. Why do we have to be a rebel against > > > > all civil manner? :) > > > > That's not true for everything > > > Hmm, which driver does behave so intentionally? I'm interested in the > > supposed reason behind it. > > Relatively few of the subsystems in drivers have references to > module_get(). Time flys... At the time of Linux 2.2 kernels, it was fairly common to run a regular auto-cleanup of unused modules via cron running "rmmod -a". Thus, each driver was mandated to deal with the module refcount while used, or set it to -1 to avoid the auto-unload permanently (like ipv6). > > > and for ASoC I'd tend to assume that the > > > user knows what they're doing and has a good reason for it; it's > > > certainly something that can be helpful in development. > > > The module unload is never considered to be equivalent with hot > > unplug It's more than that. > > I'm not sure that's the case from a user perspective. Unloading a module means to remove the functionality. Unbinding is to remove a device aka hotunplug. Conceptually totally different. Takashi