From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964786AbbJ1Gxz (ORCPT ); Wed, 28 Oct 2015 02:53:55 -0400 Received: from mga14.intel.com ([192.55.52.115]:16565 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754774AbbJ1Gxv (ORCPT ); Wed, 28 Oct 2015 02:53:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,208,1444719600"; d="scan'208";a="805203365" Date: Wed, 28 Oct 2015 15:53:41 +0900 From: Vinod Koul To: Jon Hunter Cc: Lars-Peter Clausen , Laxman Dewangan , Stephen Warren , Thierry Reding , Alexandre Courbot , dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal Message-ID: <20151028065339.GE3041@vkoul-mobl.iind.intel.com> References: <1444983957-18691-1-git-send-email-jonathanh@nvidia.com> <1444983957-18691-7-git-send-email-jonathanh@nvidia.com> <5620BB0E.9040400@metafoo.de> <5620C383.3060104@nvidia.com> <5620D42A.8060007@metafoo.de> <5620D7FE.2010205@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5620D7FE.2010205@nvidia.com> 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 On Fri, Oct 16, 2015 at 11:57:02AM +0100, Jon Hunter wrote: > >>> How about just calling free_irq()? That's how you'd typically handle this. > >> > >> Yes, however, the interrupt is requested by devm_request_irq(). I guess > >> I could call devm_free_irq() here? > > > > Just use request_irq() instead of devm_request_irq(). You have the same > > issue on the error path in the probe function anyway and also need to add > > the free_irq() before the tasklet_kill() there as well. > > I was wondering about that but the tasklets should never be scheduled if > the probe does not succeed, so I think it is ok. This is actually very racy, if probe fails but due to devm_ calls your irq is alive till it freed by core And a faulty device triggering irq can complicate matters, so for irq IMHO we don't get much benefit with devm_ variant -- ~Vinod