From patchwork Thu Sep 13 14:06:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 183634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6CE9F2C0089 for ; Fri, 14 Sep 2012 00:07:21 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752584Ab2IMOG4 (ORCPT ); Thu, 13 Sep 2012 10:06:56 -0400 Received: from mail.pripojeni.net ([178.22.112.14]:50438 "EHLO smtp.pripojeni.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186Ab2IMOGz (ORCPT ); Thu, 13 Sep 2012 10:06:55 -0400 Received: from localhost.localdomain ([178.22.113.142]) by smtp.pripojeni.net (Kerio Connect 7.2.2); Thu, 13 Sep 2012 16:06:50 +0200 From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com, Grant Grundler , Nobin Mathew , Robert Hancock , Arnd Bergmann , David Altobelli Subject: [RFC 1/1] MISC: hpilo, remove pci_disable_device Date: Thu, 13 Sep 2012 16:06:48 +0200 Message-Id: <1347545208-18512-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.7.11.5 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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: Greg Kroah-Hartman Cc: David Altobelli --- 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 6df0da4..12ccdf9 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -736,7 +736,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; } @@ -826,7 +833,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: