diff options
author | Mike Qiu <qiudayu@linux.vnet.ibm.com> | 2014-06-26 02:58:47 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-08-05 01:28:49 -0400 |
commit | dadcd6d6e71311f433a16b71203d983944f14095 (patch) | |
tree | 4792fe74da970ec478376c0398f9126fc1e0b69c /arch/powerpc/platforms | |
parent | 1b69be5e8afc634f39ad695a6ab6aad0cf0975c7 (diff) |
powerpc/eeh: sysfs entries lost
The sysfs entries are lost because of commit 2213fb1 ("powerpc/eeh:
Skip eeh sysfs when eeh is disabled"). That commit added condition
to create sysfs entries with EEH_ENABLED, which isn't populated
when trying to create sysfs entries on PowerNV platform during system
boot time. The patch fixes the issue by:
* Reoder EEH initialization functions so that they're same on
PowerNV/pSeries.
* Cache PE's primary bus by PowerNV platform instead of EEH core
to avoid kernel crash caused by the function reorder. Another
benefit with this is to avoid one eeh_probe_mode_dev() in EEH
core.
Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/powernv/eeh-powernv.c | 17 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 998bcc18a491..c3a5c2f63c3d 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c | |||
@@ -107,6 +107,7 @@ static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag) | |||
107 | struct pnv_phb *phb = hose->private_data; | 107 | struct pnv_phb *phb = hose->private_data; |
108 | struct device_node *dn = pci_device_to_OF_node(dev); | 108 | struct device_node *dn = pci_device_to_OF_node(dev); |
109 | struct eeh_dev *edev = of_node_to_eeh_dev(dn); | 109 | struct eeh_dev *edev = of_node_to_eeh_dev(dn); |
110 | int ret; | ||
110 | 111 | ||
111 | /* | 112 | /* |
112 | * When probing the root bridge, which doesn't have any | 113 | * When probing the root bridge, which doesn't have any |
@@ -143,7 +144,21 @@ static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag) | |||
143 | edev->pe_config_addr = phb->bdfn_to_pe(phb, dev->bus, dev->devfn & 0xff); | 144 | edev->pe_config_addr = phb->bdfn_to_pe(phb, dev->bus, dev->devfn & 0xff); |
144 | 145 | ||
145 | /* Create PE */ | 146 | /* Create PE */ |
146 | eeh_add_to_parent_pe(edev); | 147 | ret = eeh_add_to_parent_pe(edev); |
148 | if (ret) { | ||
149 | pr_warn("%s: Can't add PCI dev %s to parent PE (%d)\n", | ||
150 | __func__, pci_name(dev), ret); | ||
151 | return ret; | ||
152 | } | ||
153 | |||
154 | /* | ||
155 | * Cache the PE primary bus, which can't be fetched when | ||
156 | * full hotplug is in progress. In that case, all child | ||
157 | * PCI devices of the PE are expected to be removed prior | ||
158 | * to PE reset. | ||
159 | */ | ||
160 | if (!edev->pe->bus) | ||
161 | edev->pe->bus = dev->bus; | ||
147 | 162 | ||
148 | /* | 163 | /* |
149 | * Enable EEH explicitly so that we will do EEH check | 164 | * Enable EEH explicitly so that we will do EEH check |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 9f28e184ff0e..fa3029aba165 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -1145,8 +1145,8 @@ static void pnv_pci_ioda_fixup(void) | |||
1145 | 1145 | ||
1146 | #ifdef CONFIG_EEH | 1146 | #ifdef CONFIG_EEH |
1147 | eeh_probe_mode_set(EEH_PROBE_MODE_DEV); | 1147 | eeh_probe_mode_set(EEH_PROBE_MODE_DEV); |
1148 | eeh_addr_cache_build(); | ||
1149 | eeh_init(); | 1148 | eeh_init(); |
1149 | eeh_addr_cache_build(); | ||
1150 | #endif | 1150 | #endif |
1151 | } | 1151 | } |
1152 | 1152 | ||