From patchwork Fri Apr 14 17:28:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 9681507 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3D7CF601E7 for ; Fri, 14 Apr 2017 17:28:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ECE4286AD for ; Fri, 14 Apr 2017 17:28:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FE00286C7; Fri, 14 Apr 2017 17:28:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B56F1286AD for ; Fri, 14 Apr 2017 17:28:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752644AbdDNR2s (ORCPT ); Fri, 14 Apr 2017 13:28:48 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:42747 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbdDNR2r (ORCPT ); Fri, 14 Apr 2017 13:28:47 -0400 Received: from localhost ([127.0.0.1]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1cz50U-00026S-4u; Fri, 14 Apr 2017 19:27:38 +0200 Date: Fri, 14 Apr 2017 19:28:42 +0200 (CEST) From: Thomas Gleixner To: Christoph Hellwig cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] genirq: return the irq name from free_irq In-Reply-To: <20170413070643.32165-3-hch@lst.de> Message-ID: References: <20170413070643.32165-1-hch@lst.de> <20170413070643.32165-3-hch@lst.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 13 Apr 2017, Christoph Hellwig wrote: > This allows callers to get back at them instead of having to store > it in another variable. Alternatively you tell the irq code to free it for you. Patch below. Thanks, tglx 8<----------------------- --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -60,7 +60,9 @@ * IRQF_COND_SUSPEND - If the IRQ is shared with a NO_SUSPEND user, execute this * interrupt handler after suspending interrupts. For system * wakeup devices users need to implement wakeup detection in - * their interrupt handlers. + * their interrupt handlers + * IRQF_FREE_NAME - Free the memory pointed to by the @name argument of + * request_irq() in free_irq() */ #define IRQF_SHARED 0x00000080 #define IRQF_PROBE_SHARED 0x00000100 @@ -74,6 +76,7 @@ #define IRQF_NO_THREAD 0x00010000 #define IRQF_EARLY_RESUME 0x00020000 #define IRQF_COND_SUSPEND 0x00040000 +#define IRQF_FREE_NAME 0x00080000 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1542,6 +1542,8 @@ static struct irqaction *__free_irq(unsi irq_chip_pm_put(&desc->irq_data); module_put(desc->owner); kfree(action->secondary); + if (action->flags & IRQF_FREE_NAME) + kfree(action->name); return action; }