From patchwork Fri Jul 5 02:57:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 257034 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id A4DD32C0499 for ; Fri, 5 Jul 2013 12:58:46 +1000 (EST) Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e36.co.us.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 7F6E62C0095 for ; Fri, 5 Jul 2013 12:57:45 +1000 (EST) Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Jul 2013 20:57:42 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 4 Jul 2013 20:57:41 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id EE0F61FF001D for ; Thu, 4 Jul 2013 20:52:22 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r652vemv154476 for ; Thu, 4 Jul 2013 20:57:40 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r652vddu009818 for ; Thu, 4 Jul 2013 20:57:40 -0600 Received: from shangw ([9.125.28.142]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r652vcYu009806; Thu, 4 Jul 2013 20:57:39 -0600 Received: by shangw (Postfix, from userid 1000) id 87E9C301A55; Fri, 5 Jul 2013 10:57:37 +0800 (CST) From: Gavin Shan To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 3/8] powerpc/pci: Override pcibios_stop_dev() Date: Fri, 5 Jul 2013 10:57:29 +0800 Message-Id: <1372993054-25730-4-git-send-email-shangw@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1372993054-25730-1-git-send-email-shangw@linux.vnet.ibm.com> References: <1372993054-25730-1-git-send-email-shangw@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13070502-7606-0000-0000-00000D0F84A0 Cc: Gavin Shan X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The patch overrides the weak function pcibios_stop_dev() to destroy the EEH device and cache while stopping and removing the corresponding PCI device. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/pci-hotplug.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c index 3f60880..617d2df 100644 --- a/arch/powerpc/kernel/pci-hotplug.c +++ b/arch/powerpc/kernel/pci-hotplug.c @@ -22,6 +22,18 @@ #include /** + * pcibios_stop_dev - stop the PCI device + * @dev: the indicated PCI device + * + * Stop the PCI device. The function should be called before + * stopping the specified PCI device. + */ +void pcibios_stop_dev(struct pci_dev *dev) +{ + eeh_remove_device(dev, 1); +} + +/** * __pcibios_remove_pci_devices - remove all devices under this bus * @bus: the indicated PCI bus * @purge_pe: destroy the PE on removal of PCI devices @@ -45,7 +57,6 @@ void __pcibios_remove_pci_devices(struct pci_bus *bus, int purge_pe) pci_domain_nr(bus), bus->number); list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { pr_debug(" * Removing %s...\n", pci_name(dev)); - eeh_remove_bus_device(dev, purge_pe); pci_stop_and_remove_bus_device(dev); } }