Commit 7ce146fc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: add eeh_add_device_early/late

From: Anton Blanchard <anton@samba.org>

Implement eeh_add_device_early and eeh_add_device_late, required for
the ppc64 PCI hotplug code.
Signed-off-by: default avatarLinas Vepstas <linas@us.ibm.com>
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b4f4b53f
...@@ -612,33 +612,25 @@ void __init eeh_init(void) ...@@ -612,33 +612,25 @@ void __init eeh_init(void)
} }
/** /**
* eeh_add_device - perform EEH initialization for the indicated pci device * eeh_add_device_early - enable EEH for the indicated device_node
* @dev: pci device for which to set up EEH * @dn: device node for which to set up EEH
* *
* This routine can be used to perform EEH initialization for PCI * This routine must be used to perform EEH initialization for PCI
* devices that were added after system boot (e.g. hotplug, dlpar). * devices that were added after system boot (e.g. hotplug, dlpar).
* This routine must be called before any i/o is performed to the
* adapter (inluding any config-space i/o).
* Whether this actually enables EEH or not for this device depends * Whether this actually enables EEH or not for this device depends
* on the type of the device, on earlier boot command-line * on the CEC architecture, type of the device, on earlier boot
* arguments & etc. * command-line arguments & etc.
*/ */
void eeh_add_device(struct pci_dev *dev) void eeh_add_device_early(struct device_node *dn)
{ {
struct device_node *dn;
struct pci_controller *phb; struct pci_controller *phb;
struct eeh_early_enable_info info; struct eeh_early_enable_info info;
if (!dev || !eeh_subsystem_enabled) if (!dn || !eeh_subsystem_enabled)
return;
#ifdef DEBUG
printk(KERN_DEBUG "EEH: adding device %s %s\n", pci_name(dev),
pci_pretty_name(dev));
#endif
dn = pci_device_to_OF_node(dev);
if (NULL == dn)
return; return;
phb = dn->phb;
phb = PCI_GET_PHB_PTR(dev);
if (NULL == phb || 0 == phb->buid) { if (NULL == phb || 0 == phb->buid) {
printk(KERN_WARNING "EEH: Expected buid but found none\n"); printk(KERN_WARNING "EEH: Expected buid but found none\n");
return; return;
...@@ -646,11 +638,30 @@ void eeh_add_device(struct pci_dev *dev) ...@@ -646,11 +638,30 @@ void eeh_add_device(struct pci_dev *dev)
info.buid_hi = BUID_HI(phb->buid); info.buid_hi = BUID_HI(phb->buid);
info.buid_lo = BUID_LO(phb->buid); info.buid_lo = BUID_LO(phb->buid);
early_enable_eeh(dn, &info); early_enable_eeh(dn, &info);
}
EXPORT_SYMBOL(eeh_add_device_early);
/**
* eeh_add_device_late - perform EEH initialization for the indicated pci device
* @dev: pci device for which to set up EEH
*
* This routine must be used to complete EEH initialization for PCI
* devices that were added after system boot (e.g. hotplug, dlpar).
*/
void eeh_add_device_late(struct pci_dev *dev)
{
if (!dev || !eeh_subsystem_enabled)
return;
#ifdef DEBUG
printk(KERN_DEBUG "EEH: adding device %s %s\n", pci_name(dev),
pci_pretty_name(dev));
#endif
pci_addr_cache_insert_device (dev); pci_addr_cache_insert_device (dev);
} }
EXPORT_SYMBOL(eeh_add_device); EXPORT_SYMBOL(eeh_add_device_late);
/** /**
* eeh_remove_device - undo EEH setup for the indicated pci device * eeh_remove_device - undo EEH setup for the indicated pci device
......
...@@ -47,16 +47,16 @@ void *eeh_ioremap(unsigned long addr, void *vaddr); ...@@ -47,16 +47,16 @@ void *eeh_ioremap(unsigned long addr, void *vaddr);
void __init pci_addr_cache_build(void); void __init pci_addr_cache_build(void);
/** /**
* eeh_add_device - perform EEH initialization for the indicated pci device * eeh_add_device_early
* @dev: pci device for which to set up EEH * eeh_add_device_late
* *
* This routine can be used to perform EEH initialization for PCI * Perform eeh initialization for devices added after boot.
* devices that were added after system boot (e.g. hotplug, dlpar). * Call eeh_add_device_early before doing any i/o to the
* Whether this actually enables EEH or not for this device depends * device (including config space i/o). Call eeh_add_device_late
* on the type of the device, on earlier boot command-line * to finish the eeh setup for this device.
* arguments & etc.
*/ */
void eeh_add_device(struct pci_dev *); void eeh_add_device_early(struct device_node *);
void eeh_add_device_late(struct pci_dev *);
/** /**
* eeh_remove_device - undo EEH setup for the indicated pci device * eeh_remove_device - undo EEH setup for the indicated pci device
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment