diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2013-09-05 21:00:04 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-10-11 01:54:12 -0400 |
commit | 8c6852e036daa512376de381a3b61547d90465d4 (patch) | |
tree | 9ee7f606b3f49470b7aa18a3bc652b6cfba504d6 | |
parent | 5c9d6d759b3be9f9bdd6f7e5f440d870a4ec675a (diff) |
powerpc/eeh: Output PHB3 diag-data
The patch adds function ioda_eeh_phb3_phb_diag() to dump PHB3
PHB diag-data. That's called while detecting informative errors
or frozen PE on the specific PHB.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/opal.h | 65 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/eeh-ioda.c | 70 |
2 files changed, 135 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 51e3b265ec12..4cc33ba1edd3 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
@@ -460,10 +460,12 @@ enum { | |||
460 | 460 | ||
461 | enum { | 461 | enum { |
462 | OPAL_PHB_ERROR_DATA_TYPE_P7IOC = 1, | 462 | OPAL_PHB_ERROR_DATA_TYPE_P7IOC = 1, |
463 | OPAL_PHB_ERROR_DATA_TYPE_PHB3 = 2 | ||
463 | }; | 464 | }; |
464 | 465 | ||
465 | enum { | 466 | enum { |
466 | OPAL_P7IOC_NUM_PEST_REGS = 128, | 467 | OPAL_P7IOC_NUM_PEST_REGS = 128, |
468 | OPAL_PHB3_NUM_PEST_REGS = 256 | ||
467 | }; | 469 | }; |
468 | 470 | ||
469 | struct OpalIoPhbErrorCommon { | 471 | struct OpalIoPhbErrorCommon { |
@@ -531,6 +533,69 @@ struct OpalIoP7IOCPhbErrorData { | |||
531 | uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS]; | 533 | uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS]; |
532 | }; | 534 | }; |
533 | 535 | ||
536 | struct OpalIoPhb3ErrorData { | ||
537 | struct OpalIoPhbErrorCommon common; | ||
538 | |||
539 | uint32_t brdgCtl; | ||
540 | |||
541 | /* PHB3 UTL regs */ | ||
542 | uint32_t portStatusReg; | ||
543 | uint32_t rootCmplxStatus; | ||
544 | uint32_t busAgentStatus; | ||
545 | |||
546 | /* PHB3 cfg regs */ | ||
547 | uint32_t deviceStatus; | ||
548 | uint32_t slotStatus; | ||
549 | uint32_t linkStatus; | ||
550 | uint32_t devCmdStatus; | ||
551 | uint32_t devSecStatus; | ||
552 | |||
553 | /* cfg AER regs */ | ||
554 | uint32_t rootErrorStatus; | ||
555 | uint32_t uncorrErrorStatus; | ||
556 | uint32_t corrErrorStatus; | ||
557 | uint32_t tlpHdr1; | ||
558 | uint32_t tlpHdr2; | ||
559 | uint32_t tlpHdr3; | ||
560 | uint32_t tlpHdr4; | ||
561 | uint32_t sourceId; | ||
562 | |||
563 | uint32_t rsv3; | ||
564 | |||
565 | /* Record data about the call to allocate a buffer */ | ||
566 | uint64_t errorClass; | ||
567 | uint64_t correlator; | ||
568 | |||
569 | uint64_t nFir; /* 000 */ | ||
570 | uint64_t nFirMask; /* 003 */ | ||
571 | uint64_t nFirWOF; /* 008 */ | ||
572 | |||
573 | /* PHB3 MMIO Error Regs */ | ||
574 | uint64_t phbPlssr; /* 120 */ | ||
575 | uint64_t phbCsr; /* 110 */ | ||
576 | uint64_t lemFir; /* C00 */ | ||
577 | uint64_t lemErrorMask; /* C18 */ | ||
578 | uint64_t lemWOF; /* C40 */ | ||
579 | uint64_t phbErrorStatus; /* C80 */ | ||
580 | uint64_t phbFirstErrorStatus; /* C88 */ | ||
581 | uint64_t phbErrorLog0; /* CC0 */ | ||
582 | uint64_t phbErrorLog1; /* CC8 */ | ||
583 | uint64_t mmioErrorStatus; /* D00 */ | ||
584 | uint64_t mmioFirstErrorStatus; /* D08 */ | ||
585 | uint64_t mmioErrorLog0; /* D40 */ | ||
586 | uint64_t mmioErrorLog1; /* D48 */ | ||
587 | uint64_t dma0ErrorStatus; /* D80 */ | ||
588 | uint64_t dma0FirstErrorStatus; /* D88 */ | ||
589 | uint64_t dma0ErrorLog0; /* DC0 */ | ||
590 | uint64_t dma0ErrorLog1; /* DC8 */ | ||
591 | uint64_t dma1ErrorStatus; /* E00 */ | ||
592 | uint64_t dma1FirstErrorStatus; /* E08 */ | ||
593 | uint64_t dma1ErrorLog0; /* E40 */ | ||
594 | uint64_t dma1ErrorLog1; /* E48 */ | ||
595 | uint64_t pestA[OPAL_PHB3_NUM_PEST_REGS]; | ||
596 | uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS]; | ||
597 | }; | ||
598 | |||
534 | typedef struct oppanel_line { | 599 | typedef struct oppanel_line { |
535 | const char * line; | 600 | const char * line; |
536 | uint64_t line_len; | 601 | uint64_t line_len; |
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index f426f4c24fb6..02245cee7818 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -747,6 +747,73 @@ static void ioda_eeh_p7ioc_phb_diag(struct pci_controller *hose, | |||
747 | } | 747 | } |
748 | } | 748 | } |
749 | 749 | ||
750 | static void ioda_eeh_phb3_phb_diag(struct pci_controller *hose, | ||
751 | struct OpalIoPhbErrorCommon *common) | ||
752 | { | ||
753 | struct OpalIoPhb3ErrorData *data; | ||
754 | int i; | ||
755 | |||
756 | data = (struct OpalIoPhb3ErrorData*)common; | ||
757 | pr_info("PHB3 PHB#%x Diag-data (Version: %d)\n\n", | ||
758 | hose->global_number, common->version); | ||
759 | |||
760 | pr_info(" brdgCtl: %08x\n", data->brdgCtl); | ||
761 | |||
762 | pr_info(" portStatusReg: %08x\n", data->portStatusReg); | ||
763 | pr_info(" rootCmplxStatus: %08x\n", data->rootCmplxStatus); | ||
764 | pr_info(" busAgentStatus: %08x\n", data->busAgentStatus); | ||
765 | |||
766 | pr_info(" deviceStatus: %08x\n", data->deviceStatus); | ||
767 | pr_info(" slotStatus: %08x\n", data->slotStatus); | ||
768 | pr_info(" linkStatus: %08x\n", data->linkStatus); | ||
769 | pr_info(" devCmdStatus: %08x\n", data->devCmdStatus); | ||
770 | pr_info(" devSecStatus: %08x\n", data->devSecStatus); | ||
771 | |||
772 | pr_info(" rootErrorStatus: %08x\n", data->rootErrorStatus); | ||
773 | pr_info(" uncorrErrorStatus: %08x\n", data->uncorrErrorStatus); | ||
774 | pr_info(" corrErrorStatus: %08x\n", data->corrErrorStatus); | ||
775 | pr_info(" tlpHdr1: %08x\n", data->tlpHdr1); | ||
776 | pr_info(" tlpHdr2: %08x\n", data->tlpHdr2); | ||
777 | pr_info(" tlpHdr3: %08x\n", data->tlpHdr3); | ||
778 | pr_info(" tlpHdr4: %08x\n", data->tlpHdr4); | ||
779 | pr_info(" sourceId: %08x\n", data->sourceId); | ||
780 | pr_info(" errorClass: %016llx\n", data->errorClass); | ||
781 | pr_info(" correlator: %016llx\n", data->correlator); | ||
782 | pr_info(" nFir: %016llx\n", data->nFir); | ||
783 | pr_info(" nFirMask: %016llx\n", data->nFirMask); | ||
784 | pr_info(" nFirWOF: %016llx\n", data->nFirWOF); | ||
785 | pr_info(" PhbPlssr: %016llx\n", data->phbPlssr); | ||
786 | pr_info(" PhbCsr: %016llx\n", data->phbCsr); | ||
787 | pr_info(" lemFir: %016llx\n", data->lemFir); | ||
788 | pr_info(" lemErrorMask: %016llx\n", data->lemErrorMask); | ||
789 | pr_info(" lemWOF: %016llx\n", data->lemWOF); | ||
790 | pr_info(" phbErrorStatus: %016llx\n", data->phbErrorStatus); | ||
791 | pr_info(" phbFirstErrorStatus: %016llx\n", data->phbFirstErrorStatus); | ||
792 | pr_info(" phbErrorLog0: %016llx\n", data->phbErrorLog0); | ||
793 | pr_info(" phbErrorLog1: %016llx\n", data->phbErrorLog1); | ||
794 | pr_info(" mmioErrorStatus: %016llx\n", data->mmioErrorStatus); | ||
795 | pr_info(" mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus); | ||
796 | pr_info(" mmioErrorLog0: %016llx\n", data->mmioErrorLog0); | ||
797 | pr_info(" mmioErrorLog1: %016llx\n", data->mmioErrorLog1); | ||
798 | pr_info(" dma0ErrorStatus: %016llx\n", data->dma0ErrorStatus); | ||
799 | pr_info(" dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus); | ||
800 | pr_info(" dma0ErrorLog0: %016llx\n", data->dma0ErrorLog0); | ||
801 | pr_info(" dma0ErrorLog1: %016llx\n", data->dma0ErrorLog1); | ||
802 | pr_info(" dma1ErrorStatus: %016llx\n", data->dma1ErrorStatus); | ||
803 | pr_info(" dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus); | ||
804 | pr_info(" dma1ErrorLog0: %016llx\n", data->dma1ErrorLog0); | ||
805 | pr_info(" dma1ErrorLog1: %016llx\n", data->dma1ErrorLog1); | ||
806 | |||
807 | for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) { | ||
808 | if ((data->pestA[i] >> 63) == 0 && | ||
809 | (data->pestB[i] >> 63) == 0) | ||
810 | continue; | ||
811 | |||
812 | pr_info(" PE[%3d] PESTA: %016llx\n", i, data->pestA[i]); | ||
813 | pr_info(" PESTB: %016llx\n", data->pestB[i]); | ||
814 | } | ||
815 | } | ||
816 | |||
750 | static void ioda_eeh_phb_diag(struct pci_controller *hose) | 817 | static void ioda_eeh_phb_diag(struct pci_controller *hose) |
751 | { | 818 | { |
752 | struct pnv_phb *phb = hose->private_data; | 819 | struct pnv_phb *phb = hose->private_data; |
@@ -765,6 +832,9 @@ static void ioda_eeh_phb_diag(struct pci_controller *hose) | |||
765 | case OPAL_PHB_ERROR_DATA_TYPE_P7IOC: | 832 | case OPAL_PHB_ERROR_DATA_TYPE_P7IOC: |
766 | ioda_eeh_p7ioc_phb_diag(hose, common); | 833 | ioda_eeh_p7ioc_phb_diag(hose, common); |
767 | break; | 834 | break; |
835 | case OPAL_PHB_ERROR_DATA_TYPE_PHB3: | ||
836 | ioda_eeh_phb3_phb_diag(hose, common); | ||
837 | break; | ||
768 | default: | 838 | default: |
769 | pr_warning("%s: Unrecognized I/O chip %d\n", | 839 | pr_warning("%s: Unrecognized I/O chip %d\n", |
770 | __func__, common->ioType); | 840 | __func__, common->ioType); |