aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2013-06-27 01:46:42 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-30 21:10:31 -0400
commitc35ae1796bd4865bad322645a7edb92d223dfb51 (patch)
tree0c8eb255dc4b996f4b17813ed287ba4a1c189e22 /arch/powerpc/kernel
parent090b9284d72561644d17a6e568d29c9e472c9865 (diff)
powerpc/eeh: Don't collect PCI-CFG data on PHB
When the PHB is fenced or dead, it's pointless to collect the data from PCI config space of subordinate PCI devices since it should return 0xFF's. The patch also fixes overwritten buffer while getting PCI config data. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/eeh.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index e5796524631c..416fb432d7e2 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -232,16 +232,30 @@ void eeh_slot_error_detail(struct eeh_pe *pe, int severity)
232{ 232{
233 size_t loglen = 0; 233 size_t loglen = 0;
234 struct eeh_dev *edev; 234 struct eeh_dev *edev;
235 bool valid_cfg_log = true;
235 236
236 eeh_pci_enable(pe, EEH_OPT_THAW_MMIO); 237 /*
237 eeh_ops->configure_bridge(pe); 238 * When the PHB is fenced or dead, it's pointless to collect
238 eeh_pe_restore_bars(pe); 239 * the data from PCI config space because it should return
239 240 * 0xFF's. For ER, we still retrieve the data from the PCI
240 pci_regs_buf[0] = 0; 241 * config space.
241 eeh_pe_for_each_dev(pe, edev) { 242 */
242 loglen += eeh_gather_pci_data(edev, pci_regs_buf, 243 if (eeh_probe_mode_dev() &&
243 EEH_PCI_REGS_LOG_LEN); 244 (pe->type & EEH_PE_PHB) &&
244 } 245 (pe->state & (EEH_PE_ISOLATED | EEH_PE_PHB_DEAD)))
246 valid_cfg_log = false;
247
248 if (valid_cfg_log) {
249 eeh_pci_enable(pe, EEH_OPT_THAW_MMIO);
250 eeh_ops->configure_bridge(pe);
251 eeh_pe_restore_bars(pe);
252
253 pci_regs_buf[0] = 0;
254 eeh_pe_for_each_dev(pe, edev) {
255 loglen += eeh_gather_pci_data(edev, pci_regs_buf + loglen,
256 EEH_PCI_REGS_LOG_LEN - loglen);
257 }
258 }
245 259
246 eeh_ops->get_log(pe, severity, pci_regs_buf, loglen); 260 eeh_ops->get_log(pe, severity, pci_regs_buf, loglen);
247} 261}