From patchwork Tue Jan 2 20:45:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10141347 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 6B3C8601A1 for ; Tue, 2 Jan 2018 20:45:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D6E328E60 for ; Tue, 2 Jan 2018 20:45:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50C2528E62; Tue, 2 Jan 2018 20:45:20 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 C43EB28E60 for ; Tue, 2 Jan 2018 20:45:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750970AbeABUpS (ORCPT ); Tue, 2 Jan 2018 15:45:18 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:46826 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbeABUpR (ORCPT ); Tue, 2 Jan 2018 15:45:17 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5BD9460B1B; Tue, 2 Jan 2018 20:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1514925917; bh=K3TYgGJNGIZ643I+TeXkXSqz0VHakAvyEmbGtoRnOdY=; h=From:To:Cc:Subject:Date:From; b=H+JdX2Mridf3eqXVK0+YIBNMkvZB8VzXmFJjfOCiYwGF5gCb4NbGknl3qqMbMcn3a SrMifT8ikI4hPkyo+Jqv+dgMhzPaa2Ve6mjFTSHd24m9YnYjC/D0/rDNnJ9R28iZ4j wVleh8gLWnycIPwB0JCI6hKPPOVXiMZbLu6fx35M= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B466460285; Tue, 2 Jan 2018 20:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1514925916; bh=K3TYgGJNGIZ643I+TeXkXSqz0VHakAvyEmbGtoRnOdY=; h=From:To:Cc:Subject:Date:From; b=IJPlWa1W/jb6eCZZF0cw7JonCaMM0BCJtwM45HBiUegHWAwLqzmhAm2588dzVPuiw 8lRfAlf1p9ZgELX8GEWeFXoZHMfnZKfFTp8KnbZqsu4YJ+WQ8cBE2I2tjSrlLNIWnb fP8f7GHhmNpd/ek46FzUWe9H2bE/Iai2L4ikYq3k= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B466460285 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: lee.jones@linaro.org, timur@codeaurora.org Cc: chris2553@googlemail.com, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, bhelgaas@google.com, rjw@rjwysocki.net, Sinan Kaya , linux-kernel@vger.kernel.org Subject: [PATCH] misc: rtsx: release IRQ during shutdown Date: Tue, 2 Jan 2018 15:45:04 -0500 Message-Id: <1514925904-24001-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 'Commit cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")' revealed a resource leak in rtsx_pci driver during shutdown. Issue shows up as a warning during the shutdown step as follows: remove_proc_entry: removing non-empty directory 'irq/17', leaking at least 'rtsx_pci' WARNING: CPU: 0 PID: 1578 at fs/proc/generic.c:572 remove_proc_entry+0x11d/0x130 Modules linked in ... Call Trace: unregister_irq_proc free_desc irq_free_descs mp_unmap_irq acpi_unregister_gsi_apic acpi_pci_irq_disable do_pci_disable_device pci_disable_device device_shutdown kernel_restart Sys_reboot Even though rtsx_pci driver implements a shutdown callback, it is not releasing the interrupt that it registered during probe. This is causing the ACPI layer to complain that the shared IRQ is in use while freeing IRQ. This code releases the IRQ to prevent resource leak and eliminate the warning. Link: https://bugzilla.kernel.org/show_bug.cgi?id=198141 Reported-by: Chris Clayton Fixes: cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown") Tested-by: Chris Clayton Signed-off-by: Sinan Kaya --- drivers/mfd/rtsx_pcr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c index 590fb9a..bd504b6 100644 --- a/drivers/mfd/rtsx_pcr.c +++ b/drivers/mfd/rtsx_pcr.c @@ -1543,6 +1543,7 @@ static void rtsx_pci_shutdown(struct pci_dev *pcidev) rtsx_pci_power_off(pcr, HOST_ENTER_S1); pci_disable_device(pcidev); + free_irq(pcr->irq, (void *)pcr); } #else /* CONFIG_PM */