From patchwork Fri Dec 7 23:23:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leann Ogasawara X-Patchwork-Id: 204620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 2B4782C0180 for ; Sat, 8 Dec 2012 10:23:49 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Th7Gb-0003rf-Cq; Fri, 07 Dec 2012 23:23:37 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Th7GZ-0003rV-B5 for kernel-team@lists.ubuntu.com; Fri, 07 Dec 2012 23:23:35 +0000 Received: from c-67-171-179-115.hsd1.or.comcast.net ([67.171.179.115] helo=adamo) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Th7GZ-0003J8-2E; Fri, 07 Dec 2012 23:23:35 +0000 Received: by adamo (Postfix, from userid 1000) id A4E14205FC; Fri, 7 Dec 2012 15:23:28 -0800 (PST) From: leann.ogasawara@canonical.com To: kernel-team@lists.ubuntu.com Subject: [Precise][Quantal][SRU][PATCH 1/1] MISC: hpilo, remove pci_disable_device Date: Fri, 7 Dec 2012 15:23:28 -0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Jiri Slaby BugLink: http://bugs.launchpad.net/bugs/1087860 pci_disable_device(pdev) used to be in pci remove function. But this PCI device has two functions with interrupt lines connected to a single pin. The other one is a USB host controller. So when we disable the PIN there e.g. by rmmod hpilo, the controller stops working. It is because the interrupt link is disabled in ACPI since it is not refcounted yet. See acpi_pci_link_free_irq called from acpi_pci_irq_disable. It is not the best solution whatsoever, but as a workaround until the ACPI irq link refcounting is sorted out this should fix the reported errors. References: https://lkml.org/lkml/2008/11/4/535 Signed-off-by: Jiri Slaby Cc: Grant Grundler Cc: Nobin Mathew Cc: Robert Hancock Cc: Arnd Bergmann Cc: David Altobelli Signed-off-by: Greg Kroah-Hartman (cherry picked from commit bcdee04ea7ae0406ae69094f6df1aacb66a69a0b) Signed-off-by: Leann Ogasawara --- drivers/misc/hpilo.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index fffc227..9c99680 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -735,7 +735,14 @@ static void ilo_remove(struct pci_dev *pdev) free_irq(pdev->irq, ilo_hw); ilo_unmap_device(pdev, ilo_hw); pci_release_regions(pdev); - pci_disable_device(pdev); + /* + * pci_disable_device(pdev) used to be here. But this PCI device has + * two functions with interrupt lines connected to a single pin. The + * other one is a USB host controller. So when we disable the PIN here + * e.g. by rmmod hpilo, the controller stops working. It is because + * the interrupt link is disabled in ACPI since it is not refcounted + * yet. See acpi_pci_link_free_irq called from acpi_pci_irq_disable. + */ kfree(ilo_hw); ilo_hwdev[(minor / MAX_CCB)] = 0; } @@ -820,7 +827,7 @@ unmap: free_regions: pci_release_regions(pdev); disable: - pci_disable_device(pdev); +/* pci_disable_device(pdev); see comment in ilo_remove */ free: kfree(ilo_hw); out: