From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642AbbJOEED (ORCPT ); Thu, 15 Oct 2015 00:04:03 -0400 Received: from mga14.intel.com ([192.55.52.115]:7706 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbbJOEEA (ORCPT ); Thu, 15 Oct 2015 00:04:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,684,1437462000"; d="scan'208";a="581073222" Date: Thu, 15 Oct 2015 09:37:08 +0530 From: Vinod Koul To: "M'boumba Cedric Madianga" Cc: Daniel Thompson , Maxime Coquelin , robh+dt@kernel.org, pawel.moll@arm.com, Mark Rutland , ijc+devicetree@hellion.org.uk, Kumar Gala , linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Subject: Re: [PATCH v2 2/4] dmaengine: Add STM32 DMA driver Message-ID: <20151015040708.GC27370@localhost> References: <1444745127-1105-3-git-send-email-cedric.madianga@gmail.com> <561D1689.90703@linaro.org> <561E58AC.80207@linaro.org> <561E658D.1070900@linaro.org> <561E7497.1050105@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2015 at 05:41:26PM +0200, M'boumba Cedric Madianga wrote: > 2015-10-14 17:28 GMT+02:00 Daniel Thompson : > > On 14/10/15 16:26, M'boumba Cedric Madianga wrote: > >> > >> 2015-10-14 16:24 GMT+02:00 Daniel Thompson : > >>> > >>> > >>> Hmnnn... > >>> > >>> The dmaengine framework will WARN_ONCE() if an dmaengine is removed > >>> whilst > >>> it is active and also works hard to ensure dmaengine modules are not > >>> removed > >>> whilst there are active drivers using the framework. > >>> > >>> How do we get into this function whilst there is still an active DMA > >>> channels? > >> > >> > >> For example, when a user try "rmmod stm32-dma" in uart console. > >> It will enter in stm32_dma_remove while there is potentially still active > >> DMA. > > > > > > Check dmaengine.c for yourself but I think in this case the dmaengine > > framework will hold references to the module and prevent the remove from > > taking place. > > Yes I did it. > As far I understand, the dmaengine framework will print a warning > message but doesn't stop removing operation if there are some active > clients. we hold a ref, so removal wont work, see dma_chan_get() -- ~Vinod