diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/eeh.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 22322b35a0ff..fb3d636e088b 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -186,6 +186,11 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
186 | n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); | 186 | n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); |
187 | printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg); | 187 | printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg); |
188 | 188 | ||
189 | if (!dev) { | ||
190 | printk(KERN_WARNING "EEH: no PCI device for this of node\n"); | ||
191 | return n; | ||
192 | } | ||
193 | |||
189 | /* Gather bridge-specific registers */ | 194 | /* Gather bridge-specific registers */ |
190 | if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) { | 195 | if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) { |
191 | rtas_read_config(pdn, PCI_SEC_STATUS, 2, &cfg); | 196 | rtas_read_config(pdn, PCI_SEC_STATUS, 2, &cfg); |
@@ -198,7 +203,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
198 | } | 203 | } |
199 | 204 | ||
200 | /* Dump out the PCI-X command and status regs */ | 205 | /* Dump out the PCI-X command and status regs */ |
201 | cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX); | 206 | cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); |
202 | if (cap) { | 207 | if (cap) { |
203 | rtas_read_config(pdn, cap, 4, &cfg); | 208 | rtas_read_config(pdn, cap, 4, &cfg); |
204 | n += scnprintf(buf+n, len-n, "pcix-cmd:%x\n", cfg); | 209 | n += scnprintf(buf+n, len-n, "pcix-cmd:%x\n", cfg); |
@@ -210,7 +215,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
210 | } | 215 | } |
211 | 216 | ||
212 | /* If PCI-E capable, dump PCI-E cap 10, and the AER */ | 217 | /* If PCI-E capable, dump PCI-E cap 10, and the AER */ |
213 | cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_EXP); | 218 | cap = pci_find_capability(dev, PCI_CAP_ID_EXP); |
214 | if (cap) { | 219 | if (cap) { |
215 | n += scnprintf(buf+n, len-n, "pci-e cap10:\n"); | 220 | n += scnprintf(buf+n, len-n, "pci-e cap10:\n"); |
216 | printk(KERN_WARNING | 221 | printk(KERN_WARNING |
@@ -222,7 +227,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
222 | printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg); | 227 | printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg); |
223 | } | 228 | } |
224 | 229 | ||
225 | cap = pci_find_ext_capability(pdn->pcidev, PCI_EXT_CAP_ID_ERR); | 230 | cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); |
226 | if (cap) { | 231 | if (cap) { |
227 | n += scnprintf(buf+n, len-n, "pci-e AER:\n"); | 232 | n += scnprintf(buf+n, len-n, "pci-e AER:\n"); |
228 | printk(KERN_WARNING | 233 | printk(KERN_WARNING |
@@ -318,7 +323,7 @@ eeh_wait_for_slot_status(struct pci_dn *pdn, int max_wait_msecs) | |||
318 | 323 | ||
319 | if (rets[2] == 0) return -1; /* permanently unavailable */ | 324 | if (rets[2] == 0) return -1; /* permanently unavailable */ |
320 | 325 | ||
321 | if (max_wait_msecs <= 0) return -1; | 326 | if (max_wait_msecs <= 0) break; |
322 | 327 | ||
323 | mwait = rets[2]; | 328 | mwait = rets[2]; |
324 | if (mwait <= 0) { | 329 | if (mwait <= 0) { |