Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356386
b: refs/heads/master
c: 6a040ce
h: refs/heads/master
v: v3
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and Benjamin Herrenschmidt committed Jan 10, 2013
1 parent 31eb82c commit 400db54
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d35d1424045df0a8ce125c7de59b4e7ad3c873fb
refs/heads/master: 6a040ce72598159a74969a2d01ab0ba5ee6536b3
3 changes: 3 additions & 0 deletions trunk/arch/powerpc/include/asm/eeh.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev);
void __init eeh_addr_cache_build(void);
void eeh_add_device_tree_early(struct device_node *);
void eeh_add_device_tree_late(struct pci_bus *);
void eeh_add_sysfs_files(struct pci_bus *);
void eeh_remove_bus_device(struct pci_dev *, int);

/**
Expand Down Expand Up @@ -240,6 +241,8 @@ static inline void eeh_add_device_tree_early(struct device_node *dn) { }

static inline void eeh_add_device_tree_late(struct pci_bus *bus) { }

static inline void eeh_add_sysfs_files(struct pci_bus *bus) { }

static inline void eeh_remove_bus_device(struct pci_dev *dev, int purge_pe) { }

static inline void eeh_lock(void) { }
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/powerpc/kernel/of_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ static int of_pci_phb_probe(struct platform_device *dev)
/* Add probed PCI devices to the device model */
pci_bus_add_devices(phb->bus);

/* sysfs files should only be added after devices are added */
eeh_add_sysfs_files(phb->bus);

return 0;
}

Expand Down
7 changes: 5 additions & 2 deletions trunk/arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,11 +1477,14 @@ void pcibios_finish_adding_to_bus(struct pci_bus *bus)
pcibios_allocate_bus_resources(bus);
pcibios_claim_one_bus(bus);

/* Fixup EEH */
eeh_add_device_tree_late(bus);

/* Add new devices to global lists. Register in proc, sysfs. */
pci_bus_add_devices(bus);

/* Fixup EEH */
eeh_add_device_tree_late(bus);
/* sysfs files should only be added after devices are added */
eeh_add_sysfs_files(bus);
}
EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus);

Expand Down
24 changes: 23 additions & 1 deletion trunk/arch/powerpc/platforms/pseries/eeh.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,6 @@ static void eeh_add_device_late(struct pci_dev *dev)
dev->dev.archdata.edev = edev;

eeh_addr_cache_insert_dev(dev);
eeh_sysfs_add_device(dev);
}

/**
Expand All @@ -814,6 +813,29 @@ void eeh_add_device_tree_late(struct pci_bus *bus)
}
EXPORT_SYMBOL_GPL(eeh_add_device_tree_late);

/**
* eeh_add_sysfs_files - Add EEH sysfs files for the indicated PCI bus
* @bus: PCI bus
*
* This routine must be used to add EEH sysfs files for PCI
* devices which are attached to the indicated PCI bus. The PCI bus
* is added after system boot through hotplug or dlpar.
*/
void eeh_add_sysfs_files(struct pci_bus *bus)
{
struct pci_dev *dev;

list_for_each_entry(dev, &bus->devices, bus_list) {
eeh_sysfs_add_device(dev);
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
struct pci_bus *subbus = dev->subordinate;
if (subbus)
eeh_add_sysfs_files(subbus);
}
}
}
EXPORT_SYMBOL_GPL(eeh_add_sysfs_files);

/**
* eeh_remove_device - Undo EEH setup for the indicated pci device
* @dev: pci device to be removed
Expand Down

0 comments on commit 400db54

Please sign in to comment.