Release 4.14 arch/powerpc/platforms/pseries/pci_dlpar.c
/*
* PCI Dynamic LPAR, PCI Hot Plug and PCI EEH recovery code
* for RPA-compliant PPC64 platform.
* Copyright (C) 2003 Linda Xie <lxie@us.ibm.com>
* Copyright (C) 2005 International Business Machines
*
* Updates, 2005, John Rose <johnrose@austin.ibm.com>
* Updates, 2005, Linas Vepstas <linas@austin.ibm.com>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/pci.h>
#include <linux/export.h>
#include <asm/pci-bridge.h>
#include <asm/ppc-pci.h>
#include <asm/firmware.h>
#include <asm/eeh.h>
#include "pseries.h"
struct pci_controller *init_phb_dynamic(struct device_node *dn)
{
struct pci_controller *phb;
pr_debug("PCI: Initializing new hotplug PHB %pOF\n", dn);
phb = pcibios_alloc_controller(dn);
if (!phb)
return NULL;
rtas_setup_phb(phb);
pci_process_bridge_OF_ranges(phb, dn, 0);
phb->controller_ops = pseries_pci_controller_ops;
pci_devs_phb_init_dynamic(phb);
/* Create EEH devices for the PHB */
eeh_dev_phb_init_dynamic(phb);
if (dn->child)
eeh_add_device_tree_early(PCI_DN(dn));
pcibios_scan_phb(phb);
pcibios_finish_adding_to_bus(phb->bus);
return phb;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Rose | 64 | 64.65% | 1 | 11.11% |
Benjamin Herrenschmidt | 12 | 12.12% | 2 | 22.22% |
Gavin Shan | 9 | 9.09% | 2 | 22.22% |
Nathan Fontenot | 6 | 6.06% | 1 | 11.11% |
Daniel Axtens | 6 | 6.06% | 1 | 11.11% |
Grant C. Likely | 1 | 1.01% | 1 | 11.11% |
Rob Herring | 1 | 1.01% | 1 | 11.11% |
Total | 99 | 100.00% | 9 | 100.00% |
EXPORT_SYMBOL_GPL(init_phb_dynamic);
/* RPA-specific bits for removing PHBs */
int remove_phb_dynamic(struct pci_controller *phb)
{
struct pci_bus *b = phb->bus;
struct resource *res;
int rc, i;
pr_debug("PCI: Removing PHB %04x:%02x...\n",
pci_domain_nr(b), b->number);
/* We cannot to remove a root bus that has children */
if (!(list_empty(&b->children) && list_empty(&b->devices)))
return -EBUSY;
/* We -know- there aren't any child devices anymore at this stage
* and thus, we can safely unmap the IO space as it's not in use
*/
res = &phb->io_resource;
if (res->flags & IORESOURCE_IO) {
rc = pcibios_unmap_io_space(b);
if (rc) {
printk(KERN_ERR "%s: failed to unmap IO on bus %s\n",
__func__, b->name);
return 1;
}
}
/* Remove the PCI bus and unregister the bridge device from sysfs */
phb->bus = NULL;
pci_remove_bus(b);
device_unregister(b->bridge);
/* Now release the IO resource */
if (res->flags & IORESOURCE_IO)
release_resource(res);
/* Release memory resources */
for (i = 0; i < 3; ++i) {
res = &phb->mem_resources[i];
if (!(res->flags & IORESOURCE_MEM))
continue;
release_resource(res);
}
/*
* The pci_controller data structure is freed by
* the pcibios_free_controller_deferred() callback;
* see pseries_root_bridge_prepare().
*/
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Benjamin Herrenschmidt | 168 | 86.15% | 1 | 16.67% |
John Rose | 12 | 6.15% | 1 | 16.67% |
Tyrel Datwyler | 8 | 4.10% | 1 | 16.67% |
Linas Vepstas | 5 | 2.56% | 1 | 16.67% |
Mauricio Faria de Oliveira | 1 | 0.51% | 1 | 16.67% |
Frans Pop | 1 | 0.51% | 1 | 16.67% |
Total | 195 | 100.00% | 6 | 100.00% |
EXPORT_SYMBOL_GPL(remove_phb_dynamic);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Benjamin Herrenschmidt | 189 | 57.80% | 3 | 17.65% |
John Rose | 84 | 25.69% | 1 | 5.88% |
Linas Vepstas | 12 | 3.67% | 2 | 11.76% |
Gavin Shan | 9 | 2.75% | 2 | 11.76% |
Daniel Axtens | 9 | 2.75% | 1 | 5.88% |
Tyrel Datwyler | 8 | 2.45% | 1 | 5.88% |
Nathan Fontenot | 6 | 1.83% | 1 | 5.88% |
Paul Gortmaker | 3 | 0.92% | 1 | 5.88% |
Olaf Hering | 3 | 0.92% | 1 | 5.88% |
Mauricio Faria de Oliveira | 1 | 0.31% | 1 | 5.88% |
Grant C. Likely | 1 | 0.31% | 1 | 5.88% |
Frans Pop | 1 | 0.31% | 1 | 5.88% |
Rob Herring | 1 | 0.31% | 1 | 5.88% |
Total | 327 | 100.00% | 17 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.