aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-07-17 00:41:42 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-05 01:41:38 -0400
commitf18440fb7e4f95d2a8f882d3d27c8777101fac12 (patch)
treeb651300e254d002d50b453ccddad6681b26cd776 /arch
parent0dae27439acc75266d35c39970f1b5d80e0c596b (diff)
powerpc/eeh: Make diag-data not endian dependent
It's followup of commit ddf0322a ("powerpc/powernv: Fix endianness problems in EEH"). The patch helps to get non-endian-dependent diag-data. Cc: Guo Chao <yan@linux.vnet.ibm.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/opal.h128
-rw-r--r--arch/powerpc/platforms/powernv/eeh-ioda.c51
-rw-r--r--arch/powerpc/platforms/powernv/pci.c68
3 files changed, 139 insertions, 108 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 0da1dbd42e02..9d14aaba91e2 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -513,40 +513,40 @@ enum {
513}; 513};
514 514
515struct OpalIoP7IOCErrorData { 515struct OpalIoP7IOCErrorData {
516 uint16_t type; 516 __be16 type;
517 517
518 /* GEM */ 518 /* GEM */
519 uint64_t gemXfir; 519 __be64 gemXfir;
520 uint64_t gemRfir; 520 __be64 gemRfir;
521 uint64_t gemRirqfir; 521 __be64 gemRirqfir;
522 uint64_t gemMask; 522 __be64 gemMask;
523 uint64_t gemRwof; 523 __be64 gemRwof;
524 524
525 /* LEM */ 525 /* LEM */
526 uint64_t lemFir; 526 __be64 lemFir;
527 uint64_t lemErrMask; 527 __be64 lemErrMask;
528 uint64_t lemAction0; 528 __be64 lemAction0;
529 uint64_t lemAction1; 529 __be64 lemAction1;
530 uint64_t lemWof; 530 __be64 lemWof;
531 531
532 union { 532 union {
533 struct OpalIoP7IOCRgcErrorData { 533 struct OpalIoP7IOCRgcErrorData {
534 uint64_t rgcStatus; /* 3E1C10 */ 534 __be64 rgcStatus; /* 3E1C10 */
535 uint64_t rgcLdcp; /* 3E1C18 */ 535 __be64 rgcLdcp; /* 3E1C18 */
536 }rgc; 536 }rgc;
537 struct OpalIoP7IOCBiErrorData { 537 struct OpalIoP7IOCBiErrorData {
538 uint64_t biLdcp0; /* 3C0100, 3C0118 */ 538 __be64 biLdcp0; /* 3C0100, 3C0118 */
539 uint64_t biLdcp1; /* 3C0108, 3C0120 */ 539 __be64 biLdcp1; /* 3C0108, 3C0120 */
540 uint64_t biLdcp2; /* 3C0110, 3C0128 */ 540 __be64 biLdcp2; /* 3C0110, 3C0128 */
541 uint64_t biFenceStatus; /* 3C0130, 3C0130 */ 541 __be64 biFenceStatus; /* 3C0130, 3C0130 */
542 542
543 uint8_t biDownbound; /* BI Downbound or Upbound */ 543 u8 biDownbound; /* BI Downbound or Upbound */
544 }bi; 544 }bi;
545 struct OpalIoP7IOCCiErrorData { 545 struct OpalIoP7IOCCiErrorData {
546 uint64_t ciPortStatus; /* 3Dn008 */ 546 __be64 ciPortStatus; /* 3Dn008 */
547 uint64_t ciPortLdcp; /* 3Dn010 */ 547 __be64 ciPortLdcp; /* 3Dn010 */
548 548
549 uint8_t ciPort; /* Index of CI port: 0/1 */ 549 u8 ciPort; /* Index of CI port: 0/1 */
550 }ci; 550 }ci;
551 }; 551 };
552}; 552};
@@ -578,60 +578,60 @@ struct OpalIoPhbErrorCommon {
578struct OpalIoP7IOCPhbErrorData { 578struct OpalIoP7IOCPhbErrorData {
579 struct OpalIoPhbErrorCommon common; 579 struct OpalIoPhbErrorCommon common;
580 580
581 uint32_t brdgCtl; 581 __be32 brdgCtl;
582 582
583 // P7IOC utl regs 583 // P7IOC utl regs
584 uint32_t portStatusReg; 584 __be32 portStatusReg;
585 uint32_t rootCmplxStatus; 585 __be32 rootCmplxStatus;
586 uint32_t busAgentStatus; 586 __be32 busAgentStatus;
587 587
588 // P7IOC cfg regs 588 // P7IOC cfg regs
589 uint32_t deviceStatus; 589 __be32 deviceStatus;
590 uint32_t slotStatus; 590 __be32 slotStatus;
591 uint32_t linkStatus; 591 __be32 linkStatus;
592 uint32_t devCmdStatus; 592 __be32 devCmdStatus;
593 uint32_t devSecStatus; 593 __be32 devSecStatus;
594 594
595 // cfg AER regs 595 // cfg AER regs
596 uint32_t rootErrorStatus; 596 __be32 rootErrorStatus;
597 uint32_t uncorrErrorStatus; 597 __be32 uncorrErrorStatus;
598 uint32_t corrErrorStatus; 598 __be32 corrErrorStatus;
599 uint32_t tlpHdr1; 599 __be32 tlpHdr1;
600 uint32_t tlpHdr2; 600 __be32 tlpHdr2;
601 uint32_t tlpHdr3; 601 __be32 tlpHdr3;
602 uint32_t tlpHdr4; 602 __be32 tlpHdr4;
603 uint32_t sourceId; 603 __be32 sourceId;
604 604
605 uint32_t rsv3; 605 __be32 rsv3;
606 606
607 // Record data about the call to allocate a buffer. 607 // Record data about the call to allocate a buffer.
608 uint64_t errorClass; 608 __be64 errorClass;
609 uint64_t correlator; 609 __be64 correlator;
610 610
611 //P7IOC MMIO Error Regs 611 //P7IOC MMIO Error Regs
612 uint64_t p7iocPlssr; // n120 612 __be64 p7iocPlssr; // n120
613 uint64_t p7iocCsr; // n110 613 __be64 p7iocCsr; // n110
614 uint64_t lemFir; // nC00 614 __be64 lemFir; // nC00
615 uint64_t lemErrorMask; // nC18 615 __be64 lemErrorMask; // nC18
616 uint64_t lemWOF; // nC40 616 __be64 lemWOF; // nC40
617 uint64_t phbErrorStatus; // nC80 617 __be64 phbErrorStatus; // nC80
618 uint64_t phbFirstErrorStatus; // nC88 618 __be64 phbFirstErrorStatus; // nC88
619 uint64_t phbErrorLog0; // nCC0 619 __be64 phbErrorLog0; // nCC0
620 uint64_t phbErrorLog1; // nCC8 620 __be64 phbErrorLog1; // nCC8
621 uint64_t mmioErrorStatus; // nD00 621 __be64 mmioErrorStatus; // nD00
622 uint64_t mmioFirstErrorStatus; // nD08 622 __be64 mmioFirstErrorStatus; // nD08
623 uint64_t mmioErrorLog0; // nD40 623 __be64 mmioErrorLog0; // nD40
624 uint64_t mmioErrorLog1; // nD48 624 __be64 mmioErrorLog1; // nD48
625 uint64_t dma0ErrorStatus; // nD80 625 __be64 dma0ErrorStatus; // nD80
626 uint64_t dma0FirstErrorStatus; // nD88 626 __be64 dma0FirstErrorStatus; // nD88
627 uint64_t dma0ErrorLog0; // nDC0 627 __be64 dma0ErrorLog0; // nDC0
628 uint64_t dma0ErrorLog1; // nDC8 628 __be64 dma0ErrorLog1; // nDC8
629 uint64_t dma1ErrorStatus; // nE00 629 __be64 dma1ErrorStatus; // nE00
630 uint64_t dma1FirstErrorStatus; // nE08 630 __be64 dma1FirstErrorStatus; // nE08
631 uint64_t dma1ErrorLog0; // nE40 631 __be64 dma1ErrorLog0; // nE40
632 uint64_t dma1ErrorLog1; // nE48 632 __be64 dma1ErrorLog1; // nE48
633 uint64_t pestA[OPAL_P7IOC_NUM_PEST_REGS]; 633 __be64 pestA[OPAL_P7IOC_NUM_PEST_REGS];
634 uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS]; 634 __be64 pestB[OPAL_P7IOC_NUM_PEST_REGS];
635}; 635};
636 636
637struct OpalIoPhb3ErrorData { 637struct OpalIoPhb3ErrorData {
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 5ab61b78dfc6..4909e5f3adda 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -605,18 +605,24 @@ static int ioda_eeh_configure_bridge(struct eeh_pe *pe)
605static void ioda_eeh_hub_diag_common(struct OpalIoP7IOCErrorData *data) 605static void ioda_eeh_hub_diag_common(struct OpalIoP7IOCErrorData *data)
606{ 606{
607 /* GEM */ 607 /* GEM */
608 pr_info(" GEM XFIR: %016llx\n", data->gemXfir); 608 if (data->gemXfir || data->gemRfir ||
609 pr_info(" GEM RFIR: %016llx\n", data->gemRfir); 609 data->gemRirqfir || data->gemMask || data->gemRwof)
610 pr_info(" GEM RIRQFIR: %016llx\n", data->gemRirqfir); 610 pr_info(" GEM: %016llx %016llx %016llx %016llx %016llx\n",
611 pr_info(" GEM Mask: %016llx\n", data->gemMask); 611 be64_to_cpu(data->gemXfir),
612 pr_info(" GEM RWOF: %016llx\n", data->gemRwof); 612 be64_to_cpu(data->gemRfir),
613 be64_to_cpu(data->gemRirqfir),
614 be64_to_cpu(data->gemMask),
615 be64_to_cpu(data->gemRwof));
613 616
614 /* LEM */ 617 /* LEM */
615 pr_info(" LEM FIR: %016llx\n", data->lemFir); 618 if (data->lemFir || data->lemErrMask ||
616 pr_info(" LEM Error Mask: %016llx\n", data->lemErrMask); 619 data->lemAction0 || data->lemAction1 || data->lemWof)
617 pr_info(" LEM Action 0: %016llx\n", data->lemAction0); 620 pr_info(" LEM: %016llx %016llx %016llx %016llx %016llx\n",
618 pr_info(" LEM Action 1: %016llx\n", data->lemAction1); 621 be64_to_cpu(data->lemFir),
619 pr_info(" LEM WOF: %016llx\n", data->lemWof); 622 be64_to_cpu(data->lemErrMask),
623 be64_to_cpu(data->lemAction0),
624 be64_to_cpu(data->lemAction1),
625 be64_to_cpu(data->lemWof));
620} 626}
621 627
622static void ioda_eeh_hub_diag(struct pci_controller *hose) 628static void ioda_eeh_hub_diag(struct pci_controller *hose)
@@ -636,24 +642,31 @@ static void ioda_eeh_hub_diag(struct pci_controller *hose)
636 case OPAL_P7IOC_DIAG_TYPE_RGC: 642 case OPAL_P7IOC_DIAG_TYPE_RGC:
637 pr_info("P7IOC diag-data for RGC\n\n"); 643 pr_info("P7IOC diag-data for RGC\n\n");
638 ioda_eeh_hub_diag_common(data); 644 ioda_eeh_hub_diag_common(data);
639 pr_info(" RGC Status: %016llx\n", data->rgc.rgcStatus); 645 if (data->rgc.rgcStatus || data->rgc.rgcLdcp)
640 pr_info(" RGC LDCP: %016llx\n", data->rgc.rgcLdcp); 646 pr_info(" RGC: %016llx %016llx\n",
647 be64_to_cpu(data->rgc.rgcStatus),
648 be64_to_cpu(data->rgc.rgcLdcp));
641 break; 649 break;
642 case OPAL_P7IOC_DIAG_TYPE_BI: 650 case OPAL_P7IOC_DIAG_TYPE_BI:
643 pr_info("P7IOC diag-data for BI %s\n\n", 651 pr_info("P7IOC diag-data for BI %s\n\n",
644 data->bi.biDownbound ? "Downbound" : "Upbound"); 652 data->bi.biDownbound ? "Downbound" : "Upbound");
645 ioda_eeh_hub_diag_common(data); 653 ioda_eeh_hub_diag_common(data);
646 pr_info(" BI LDCP 0: %016llx\n", data->bi.biLdcp0); 654 if (data->bi.biLdcp0 || data->bi.biLdcp1 ||
647 pr_info(" BI LDCP 1: %016llx\n", data->bi.biLdcp1); 655 data->bi.biLdcp2 || data->bi.biFenceStatus)
648 pr_info(" BI LDCP 2: %016llx\n", data->bi.biLdcp2); 656 pr_info(" BI: %016llx %016llx %016llx %016llx\n",
649 pr_info(" BI Fence Status: %016llx\n", data->bi.biFenceStatus); 657 be64_to_cpu(data->bi.biLdcp0),
658 be64_to_cpu(data->bi.biLdcp1),
659 be64_to_cpu(data->bi.biLdcp2),
660 be64_to_cpu(data->bi.biFenceStatus));
650 break; 661 break;
651 case OPAL_P7IOC_DIAG_TYPE_CI: 662 case OPAL_P7IOC_DIAG_TYPE_CI:
652 pr_info("P7IOC diag-data for CI Port %d\\nn", 663 pr_info("P7IOC diag-data for CI Port %d\n\n",
653 data->ci.ciPort); 664 data->ci.ciPort);
654 ioda_eeh_hub_diag_common(data); 665 ioda_eeh_hub_diag_common(data);
655 pr_info(" CI Port Status: %016llx\n", data->ci.ciPortStatus); 666 if (data->ci.ciPortStatus || data->ci.ciPortLdcp)
656 pr_info(" CI Port LDCP: %016llx\n", data->ci.ciPortLdcp); 667 pr_info(" CI: %016llx %016llx\n",
668 be64_to_cpu(data->ci.ciPortStatus),
669 be64_to_cpu(data->ci.ciPortLdcp));
657 break; 670 break;
658 case OPAL_P7IOC_DIAG_TYPE_MISC: 671 case OPAL_P7IOC_DIAG_TYPE_MISC:
659 pr_info("P7IOC diag-data for MISC\n\n"); 672 pr_info("P7IOC diag-data for MISC\n\n");
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index c584961b99cc..de376584a96d 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -132,61 +132,78 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose,
132 132
133 data = (struct OpalIoP7IOCPhbErrorData *)common; 133 data = (struct OpalIoP7IOCPhbErrorData *)common;
134 pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n", 134 pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n",
135 hose->global_number, common->version); 135 hose->global_number, be32_to_cpu(common->version));
136 136
137 if (data->brdgCtl) 137 if (data->brdgCtl)
138 pr_info("brdgCtl: %08x\n", 138 pr_info("brdgCtl: %08x\n",
139 data->brdgCtl); 139 be32_to_cpu(data->brdgCtl));
140 if (data->portStatusReg || data->rootCmplxStatus || 140 if (data->portStatusReg || data->rootCmplxStatus ||
141 data->busAgentStatus) 141 data->busAgentStatus)
142 pr_info("UtlSts: %08x %08x %08x\n", 142 pr_info("UtlSts: %08x %08x %08x\n",
143 data->portStatusReg, data->rootCmplxStatus, 143 be32_to_cpu(data->portStatusReg),
144 data->busAgentStatus); 144 be32_to_cpu(data->rootCmplxStatus),
145 be32_to_cpu(data->busAgentStatus));
145 if (data->deviceStatus || data->slotStatus || 146 if (data->deviceStatus || data->slotStatus ||
146 data->linkStatus || data->devCmdStatus || 147 data->linkStatus || data->devCmdStatus ||
147 data->devSecStatus) 148 data->devSecStatus)
148 pr_info("RootSts: %08x %08x %08x %08x %08x\n", 149 pr_info("RootSts: %08x %08x %08x %08x %08x\n",
149 data->deviceStatus, data->slotStatus, 150 be32_to_cpu(data->deviceStatus),
150 data->linkStatus, data->devCmdStatus, 151 be32_to_cpu(data->slotStatus),
151 data->devSecStatus); 152 be32_to_cpu(data->linkStatus),
153 be32_to_cpu(data->devCmdStatus),
154 be32_to_cpu(data->devSecStatus));
152 if (data->rootErrorStatus || data->uncorrErrorStatus || 155 if (data->rootErrorStatus || data->uncorrErrorStatus ||
153 data->corrErrorStatus) 156 data->corrErrorStatus)
154 pr_info("RootErrSts: %08x %08x %08x\n", 157 pr_info("RootErrSts: %08x %08x %08x\n",
155 data->rootErrorStatus, data->uncorrErrorStatus, 158 be32_to_cpu(data->rootErrorStatus),
156 data->corrErrorStatus); 159 be32_to_cpu(data->uncorrErrorStatus),
160 be32_to_cpu(data->corrErrorStatus));
157 if (data->tlpHdr1 || data->tlpHdr2 || 161 if (data->tlpHdr1 || data->tlpHdr2 ||
158 data->tlpHdr3 || data->tlpHdr4) 162 data->tlpHdr3 || data->tlpHdr4)
159 pr_info("RootErrLog: %08x %08x %08x %08x\n", 163 pr_info("RootErrLog: %08x %08x %08x %08x\n",
160 data->tlpHdr1, data->tlpHdr2, 164 be32_to_cpu(data->tlpHdr1),
161 data->tlpHdr3, data->tlpHdr4); 165 be32_to_cpu(data->tlpHdr2),
166 be32_to_cpu(data->tlpHdr3),
167 be32_to_cpu(data->tlpHdr4));
162 if (data->sourceId || data->errorClass || 168 if (data->sourceId || data->errorClass ||
163 data->correlator) 169 data->correlator)
164 pr_info("RootErrLog1: %08x %016llx %016llx\n", 170 pr_info("RootErrLog1: %08x %016llx %016llx\n",
165 data->sourceId, data->errorClass, 171 be32_to_cpu(data->sourceId),
166 data->correlator); 172 be64_to_cpu(data->errorClass),
173 be64_to_cpu(data->correlator));
167 if (data->p7iocPlssr || data->p7iocCsr) 174 if (data->p7iocPlssr || data->p7iocCsr)
168 pr_info("PhbSts: %016llx %016llx\n", 175 pr_info("PhbSts: %016llx %016llx\n",
169 data->p7iocPlssr, data->p7iocCsr); 176 be64_to_cpu(data->p7iocPlssr),
177 be64_to_cpu(data->p7iocCsr));
170 if (data->lemFir) 178 if (data->lemFir)
171 pr_info("Lem: %016llx %016llx %016llx\n", 179 pr_info("Lem: %016llx %016llx %016llx\n",
172 data->lemFir, data->lemErrorMask, 180 be64_to_cpu(data->lemFir),
173 data->lemWOF); 181 be64_to_cpu(data->lemErrorMask),
182 be64_to_cpu(data->lemWOF));
174 if (data->phbErrorStatus) 183 if (data->phbErrorStatus)
175 pr_info("PhbErr: %016llx %016llx %016llx %016llx\n", 184 pr_info("PhbErr: %016llx %016llx %016llx %016llx\n",
176 data->phbErrorStatus, data->phbFirstErrorStatus, 185 be64_to_cpu(data->phbErrorStatus),
177 data->phbErrorLog0, data->phbErrorLog1); 186 be64_to_cpu(data->phbFirstErrorStatus),
187 be64_to_cpu(data->phbErrorLog0),
188 be64_to_cpu(data->phbErrorLog1));
178 if (data->mmioErrorStatus) 189 if (data->mmioErrorStatus)
179 pr_info("OutErr: %016llx %016llx %016llx %016llx\n", 190 pr_info("OutErr: %016llx %016llx %016llx %016llx\n",
180 data->mmioErrorStatus, data->mmioFirstErrorStatus, 191 be64_to_cpu(data->mmioErrorStatus),
181 data->mmioErrorLog0, data->mmioErrorLog1); 192 be64_to_cpu(data->mmioFirstErrorStatus),
193 be64_to_cpu(data->mmioErrorLog0),
194 be64_to_cpu(data->mmioErrorLog1));
182 if (data->dma0ErrorStatus) 195 if (data->dma0ErrorStatus)
183 pr_info("InAErr: %016llx %016llx %016llx %016llx\n", 196 pr_info("InAErr: %016llx %016llx %016llx %016llx\n",
184 data->dma0ErrorStatus, data->dma0FirstErrorStatus, 197 be64_to_cpu(data->dma0ErrorStatus),
185 data->dma0ErrorLog0, data->dma0ErrorLog1); 198 be64_to_cpu(data->dma0FirstErrorStatus),
199 be64_to_cpu(data->dma0ErrorLog0),
200 be64_to_cpu(data->dma0ErrorLog1));
186 if (data->dma1ErrorStatus) 201 if (data->dma1ErrorStatus)
187 pr_info("InBErr: %016llx %016llx %016llx %016llx\n", 202 pr_info("InBErr: %016llx %016llx %016llx %016llx\n",
188 data->dma1ErrorStatus, data->dma1FirstErrorStatus, 203 be64_to_cpu(data->dma1ErrorStatus),
189 data->dma1ErrorLog0, data->dma1ErrorLog1); 204 be64_to_cpu(data->dma1FirstErrorStatus),
205 be64_to_cpu(data->dma1ErrorLog0),
206 be64_to_cpu(data->dma1ErrorLog1));
190 207
191 for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) { 208 for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) {
192 if ((data->pestA[i] >> 63) == 0 && 209 if ((data->pestA[i] >> 63) == 0 &&
@@ -194,7 +211,8 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose,
194 continue; 211 continue;
195 212
196 pr_info("PE[%3d] A/B: %016llx %016llx\n", 213 pr_info("PE[%3d] A/B: %016llx %016llx\n",
197 i, data->pestA[i], data->pestB[i]); 214 i, be64_to_cpu(data->pestA[i]),
215 be64_to_cpu(data->pestB[i]));
198 } 216 }
199} 217}
200 218