From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbeACDrB (ORCPT + 1 other); Tue, 2 Jan 2018 22:47:01 -0500 Received: from mga09.intel.com ([134.134.136.24]:39623 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbeACDrA (ORCPT ); Tue, 2 Jan 2018 22:47:00 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,500,1508828400"; d="scan'208";a="7005317" Date: Wed, 3 Jan 2018 09:21:06 +0530 From: Vinod Koul To: Rayagonda Kokatanur Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: dma_async_device_unregister called while 2 clients hold a reference Message-ID: <20180103035106.GD18649@localhost> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Dec 26, 2017 at 10:37:13AM +0530, Rayagonda Kokatanur wrote: > Hi All, > > I am getting following error when I unload one of my dma client driver. > When I looked further into dmaengine.c file I found that the error is > because of WARN_ONCE in dma_async_device_unregister() api. > > Is this error expected ? > Why do we need that WARN_ONCE macro ? If I comment that, errors will vanish. > Do I need to set anything in client driver before calling > dma_async_device_unregister() api ? > > > root@bcm958802a8021:~# rmmod bcm_sba_raid > [ 357.891751] dma_async_device_unregister called while 2 clients hold a > reference that means you are trying to remove the module while two clients hold the ref. You should first ensure the clients are unloaded and then your driver IMO this is a valid warn. -- ~Vinod