From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965735AbbJ1NeW (ORCPT ); Wed, 28 Oct 2015 09:34:22 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:6425 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932528AbbJ1NeU (ORCPT ); Wed, 28 Oct 2015 09:34:20 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 28 Oct 2015 06:24:41 -0700 Subject: Re: [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal To: Vinod Koul 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> <20151028065339.GE3041@vkoul-mobl.iind.intel.com> CC: Lars-Peter Clausen , Laxman Dewangan , Stephen Warren , "Thierry Reding" , Alexandre Courbot , , , From: Jon Hunter Message-ID: <5630CECE.2000600@nvidia.com> Date: Wed, 28 Oct 2015 13:34:06 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151028065339.GE3041@vkoul-mobl.iind.intel.com> X-Originating-IP: [10.21.132.135] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To drukmail101.nvidia.com (10.25.59.19) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/10/15 06:53, Vinod Koul wrote: > 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 That's fine, I will drop the devm_ usage here then. Jon