aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-05-08 19:36:21 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-09 02:35:01 -0400
commitfcf9892b553ba638e6c8f9b6a140c99927c69693 (patch)
tree5855a4cca38bd27c8e13a29e56e2443c08dbf68d /arch/powerpc
parentd99bb1db798f49eacb27e087da7e62433361174d (diff)
[POWERPC] EEH: log all PCI-X and PCI-E AER registers
When an EEH event is detected, and after the device driver has been notified, but before the device is reset, enable MMIO to the adapter, and grab the contents of the PCI status and command registers, the PCI-X status and command, and the PCI-E capability 10 and AER registers. Pass these up to the RTAS error log, and also printk them. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index b58ed05078b8..093438b93bd9 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -160,14 +160,58 @@ static void rtas_slot_error_detail(struct pci_dn *pdn, int severity,
160static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) 160static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
161{ 161{
162 u32 cfg; 162 u32 cfg;
163 int cap, i;
163 int n = 0; 164 int n = 0;
164 165
165 n += scnprintf(buf+n, len-n, "%s\n", pdn->node->name); 166 n += scnprintf(buf+n, len-n, "%s\n", pdn->node->full_name);
167 printk(KERN_WARNING "EEH: of node=%s\n", pdn->node->full_name);
168
166 rtas_read_config(pdn, PCI_VENDOR_ID, 4, &cfg); 169 rtas_read_config(pdn, PCI_VENDOR_ID, 4, &cfg);
167 n += scnprintf(buf+n, len-n, "dev/vend:%x\n", cfg); 170 n += scnprintf(buf+n, len-n, "dev/vend:%08x\n", cfg);
171 printk(KERN_WARNING "EEH: PCI device/vendor: %08x\n", cfg);
172
168 rtas_read_config(pdn, PCI_COMMAND, 4, &cfg); 173 rtas_read_config(pdn, PCI_COMMAND, 4, &cfg);
169 n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); 174 n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg);
175 printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg);
176
177 /* Dump out the PCI-X command and status regs */
178 cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX);
179 if (cap) {
180 rtas_read_config(pdn, cap, 4, &cfg);
181 n += scnprintf(buf+n, len-n, "pcix-cmd:%x\n", cfg);
182 printk(KERN_WARNING "EEH: PCI-X cmd: %08x\n", cfg);
183
184 rtas_read_config(pdn, cap+4, 4, &cfg);
185 n += scnprintf(buf+n, len-n, "pcix-stat:%x\n", cfg);
186 printk(KERN_WARNING "EEH: PCI-X status: %08x\n", cfg);
187 }
188
189 /* If PCI-E capable, dump PCI-E cap 10, and the AER */
190 cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_EXP);
191 if (cap) {
192 n += scnprintf(buf+n, len-n, "pci-e cap10:\n");
193 printk(KERN_WARNING
194 "EEH: PCI-E capabilities and status follow:\n");
195
196 for (i=0; i<=8; i++) {
197 rtas_read_config(pdn, cap+4*i, 4, &cfg);
198 n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg);
199 printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg);
200 }
170 201
202 cap = pci_find_ext_capability(pdn->pcidev,PCI_EXT_CAP_ID_ERR);
203 if (cap) {
204 n += scnprintf(buf+n, len-n, "pci-e AER:\n");
205 printk(KERN_WARNING
206 "EEH: PCI-E AER capability register set follows:\n");
207
208 for (i=0; i<14; i++) {
209 rtas_read_config(pdn, cap+4*i, 4, &cfg);
210 n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg);
211 printk(KERN_WARNING "EEH: PCI-E AER %02x: %08x\n", i, cfg);
212 }
213 }
214 }
171 return n; 215 return n;
172} 216}
173 217