Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149650
b: refs/heads/master
c: 2eb4afb
h: refs/heads/master
v: v3
  • Loading branch information
Kumar Gala authored and Benjamin Herrenschmidt committed May 21, 2009
1 parent 2129397 commit 6342bcf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 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: 58513dc40d8e01f0c0ccea4cdcbc32e9dcee62fd
refs/heads/master: 2eb4afb69ff3cdd357d5e68ed82cd131916bd8a7
1 change: 1 addition & 0 deletions trunk/arch/powerpc/include/asm/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ struct pci_dn {
#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)

extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
extern void * update_dn_pci_info(struct device_node *dn, void *data);

/* Get a device_node from a pci_dev. This code must be fast except
* in the case where the sysdata is incorrect and needs to be fixed
Expand Down
28 changes: 1 addition & 27 deletions trunk/arch/powerpc/kernel/pci_dn.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/pci-bridge.h>
#include <asm/pSeries_reconfig.h>
#include <asm/ppc-pci.h>
#include <asm/firmware.h>

/*
* Traverse_func that inits the PCI fields of the device node.
* NOTE: this *must* be done before read/write config to the device.
*/
static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
{
struct pci_controller *phb = data;
const int *type =
Expand Down Expand Up @@ -184,29 +183,6 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev)
}
EXPORT_SYMBOL(fetch_dev_dn);

static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
{
struct device_node *np = node;
struct pci_dn *pci = NULL;
int err = NOTIFY_OK;

switch (action) {
case PSERIES_RECONFIG_ADD:
pci = np->parent->data;
if (pci)
update_dn_pci_info(np, pci->phb);
break;
default:
err = NOTIFY_DONE;
break;
}
return err;
}

static struct notifier_block pci_dn_reconfig_nb = {
.notifier_call = pci_dn_reconfig_notifier,
};

/**
* pci_devs_phb_init - Initialize phbs and pci devs under them.
*
Expand All @@ -223,6 +199,4 @@ void __init pci_devs_phb_init(void)
/* This must be done first so the device nodes have valid pci info! */
list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
pci_devs_phb_init_dynamic(phb);

pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
}
25 changes: 25 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include <asm/smp.h>
#include <asm/firmware.h>
#include <asm/eeh.h>
#include <asm/pSeries_reconfig.h>

#include "plpar_wrappers.h"
#include "pseries.h"
Expand Down Expand Up @@ -254,6 +255,29 @@ static void __init pseries_discover_pic(void)
" interrupt-controller\n");
}

static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
{
struct device_node *np = node;
struct pci_dn *pci = NULL;
int err = NOTIFY_OK;

switch (action) {
case PSERIES_RECONFIG_ADD:
pci = np->parent->data;
if (pci)
update_dn_pci_info(np, pci->phb);
break;
default:
err = NOTIFY_DONE;
break;
}
return err;
}

static struct notifier_block pci_dn_reconfig_nb = {
.notifier_call = pci_dn_reconfig_notifier,
};

static void __init pSeries_setup_arch(void)
{
/* Discover PIC type and setup ppc_md accordingly */
Expand All @@ -271,6 +295,7 @@ static void __init pSeries_setup_arch(void)
/* Find and initialize PCI host bridges */
init_pci_config_tokens();
find_and_init_phbs();
pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
eeh_init();

pSeries_nvram_init();
Expand Down

0 comments on commit 6342bcf

Please sign in to comment.