diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2012-09-08 02:44:14 +0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-10 03:35:41 +0400 |
commit | 371a395d2f1fe296c89735547672d70f4dcc2949 (patch) | |
tree | 91bd90e0045a97526b9e7e145c11233f378735fb /arch/powerpc/platforms/pseries/eeh.c | |
parent | 66523d9f2d799de901a5ae7bbed6c3f663fb0b00 (diff) | |
download | linux-371a395d2f1fe296c89735547672d70f4dcc2949.tar.xz |
powerpc/eeh: Make EEH operations based on PE
Originally, all the EEH operations were implemented based on OF node.
Actually, it explicitly breaks the rules that the operation target
is PE instead of device. Therefore, the patch makes all the operations
based on PE instead of device.
Unfortunately, the backend for config space has to be kept as original
because it doesn't depend on PE.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/eeh.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index f210160c1fdb..3c8658ea13f2 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c @@ -729,6 +729,7 @@ static void *eeh_early_enable(struct device_node *dn, void *data) const u32 *regs; int enable; struct eeh_dev *edev = of_node_to_eeh_dev(dn); + struct eeh_pe pe; edev->class_code = 0; edev->mode = 0; @@ -755,9 +756,14 @@ static void *eeh_early_enable(struct device_node *dn, void *data) */ regs = of_get_property(dn, "reg", NULL); if (regs) { + /* Initialize the fake PE */ + memset(&pe, 0, sizeof(struct eeh_pe)); + pe.phb = edev->phb; + pe.config_addr = regs[0]; + /* First register entry is addr (00BBSS00) */ /* Try to enable eeh */ - ret = eeh_ops->set_option(dn, EEH_OPT_ENABLE); + ret = eeh_ops->set_option(&pe, EEH_OPT_ENABLE); enable = 0; if (ret == 0) { @@ -766,14 +772,15 @@ static void *eeh_early_enable(struct device_node *dn, void *data) /* If the newer, better, ibm,get-config-addr-info is supported, * then use that instead. */ - edev->pe_config_addr = eeh_ops->get_pe_addr(dn); + edev->pe_config_addr = eeh_ops->get_pe_addr(&pe); + pe.addr = edev->pe_config_addr; /* Some older systems (Power4) allow the * ibm,set-eeh-option call to succeed even on nodes * where EEH is not supported. Verify support * explicitly. */ - ret = eeh_ops->get_state(dn, NULL); + ret = eeh_ops->get_state(&pe, NULL); if (ret > 0 && ret != EEH_STATE_NOT_SUPPORT) enable = 1; } |