Commit af87d2fe authored by Gavin Shan's avatar Gavin Shan Committed by Benjamin Herrenschmidt

powerpc/powernv: Refactor PHB diag-data dump

As Ben suggested, the patch prints PHB diag-data with multiple
fields in one line and omits the line if the fields of that
line are all zero.

With the patch applied, the PHB3 diag-data dump looks like:

PHB3 PHB#3 Diag-data (Version: 1)

  brdgCtl:     00000002
  RootSts:     0000000f 00400000 b0830008 00100147 00002000
  nFir:        0000000000000000 0030006e00000000 0000000000000000
  PhbSts:      0000001c00000000 0000000000000000
  Lem:         0000000000100000 42498e327f502eae 0000000000000000
  InAErr:      8000000000000000 8000000000000000 0402030000000000 0000000000000000
  PE[  8] A/B: 8480002b00000000 8000000000000000

[ The current diag data is so big that it overflows the printk
  buffer pretty quickly in cases when we get a handful of errors
  at once which can happen. --BenH
]
Signed-off-by: default avatarGavin Shan <shangw@linux.vnet.ibm.com>
CC: <stable@vger.kernel.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 94716604
...@@ -134,57 +134,72 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose, ...@@ -134,57 +134,72 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose,
pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n\n", pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n\n",
hose->global_number, common->version); hose->global_number, common->version);
pr_info(" brdgCtl: %08x\n", data->brdgCtl); if (data->brdgCtl)
pr_info(" brdgCtl: %08x\n",
pr_info(" portStatusReg: %08x\n", data->portStatusReg); data->brdgCtl);
pr_info(" rootCmplxStatus: %08x\n", data->rootCmplxStatus); if (data->portStatusReg || data->rootCmplxStatus ||
pr_info(" busAgentStatus: %08x\n", data->busAgentStatus); data->busAgentStatus)
pr_info(" UtlSts: %08x %08x %08x\n",
pr_info(" deviceStatus: %08x\n", data->deviceStatus); data->portStatusReg, data->rootCmplxStatus,
pr_info(" slotStatus: %08x\n", data->slotStatus); data->busAgentStatus);
pr_info(" linkStatus: %08x\n", data->linkStatus); if (data->deviceStatus || data->slotStatus ||
pr_info(" devCmdStatus: %08x\n", data->devCmdStatus); data->linkStatus || data->devCmdStatus ||
pr_info(" devSecStatus: %08x\n", data->devSecStatus); data->devSecStatus)
pr_info(" RootSts: %08x %08x %08x %08x %08x\n",
pr_info(" rootErrorStatus: %08x\n", data->rootErrorStatus); data->deviceStatus, data->slotStatus,
pr_info(" uncorrErrorStatus: %08x\n", data->uncorrErrorStatus); data->linkStatus, data->devCmdStatus,
pr_info(" corrErrorStatus: %08x\n", data->corrErrorStatus); data->devSecStatus);
pr_info(" tlpHdr1: %08x\n", data->tlpHdr1); if (data->rootErrorStatus || data->uncorrErrorStatus ||
pr_info(" tlpHdr2: %08x\n", data->tlpHdr2); data->corrErrorStatus)
pr_info(" tlpHdr3: %08x\n", data->tlpHdr3); pr_info(" RootErrSts: %08x %08x %08x\n",
pr_info(" tlpHdr4: %08x\n", data->tlpHdr4); data->rootErrorStatus, data->uncorrErrorStatus,
pr_info(" sourceId: %08x\n", data->sourceId); data->corrErrorStatus);
pr_info(" errorClass: %016llx\n", data->errorClass); if (data->tlpHdr1 || data->tlpHdr2 ||
pr_info(" correlator: %016llx\n", data->correlator); data->tlpHdr3 || data->tlpHdr4)
pr_info(" p7iocPlssr: %016llx\n", data->p7iocPlssr); pr_info(" RootErrLog: %08x %08x %08x %08x\n",
pr_info(" p7iocCsr: %016llx\n", data->p7iocCsr); data->tlpHdr1, data->tlpHdr2,
pr_info(" lemFir: %016llx\n", data->lemFir); data->tlpHdr3, data->tlpHdr4);
pr_info(" lemErrorMask: %016llx\n", data->lemErrorMask); if (data->sourceId || data->errorClass ||
pr_info(" lemWOF: %016llx\n", data->lemWOF); data->correlator)
pr_info(" phbErrorStatus: %016llx\n", data->phbErrorStatus); pr_info(" RootErrLog1: %08x %016llx %016llx\n",
pr_info(" phbFirstErrorStatus: %016llx\n", data->phbFirstErrorStatus); data->sourceId, data->errorClass,
pr_info(" phbErrorLog0: %016llx\n", data->phbErrorLog0); data->correlator);
pr_info(" phbErrorLog1: %016llx\n", data->phbErrorLog1); if (data->p7iocPlssr || data->p7iocCsr)
pr_info(" mmioErrorStatus: %016llx\n", data->mmioErrorStatus); pr_info(" PhbSts: %016llx %016llx\n",
pr_info(" mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus); data->p7iocPlssr, data->p7iocCsr);
pr_info(" mmioErrorLog0: %016llx\n", data->mmioErrorLog0); if (data->lemFir || data->lemErrorMask ||
pr_info(" mmioErrorLog1: %016llx\n", data->mmioErrorLog1); data->lemWOF)
pr_info(" dma0ErrorStatus: %016llx\n", data->dma0ErrorStatus); pr_info(" Lem: %016llx %016llx %016llx\n",
pr_info(" dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus); data->lemFir, data->lemErrorMask,
pr_info(" dma0ErrorLog0: %016llx\n", data->dma0ErrorLog0); data->lemWOF);
pr_info(" dma0ErrorLog1: %016llx\n", data->dma0ErrorLog1); if (data->phbErrorStatus || data->phbFirstErrorStatus ||
pr_info(" dma1ErrorStatus: %016llx\n", data->dma1ErrorStatus); data->phbErrorLog0 || data->phbErrorLog1)
pr_info(" dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus); pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n",
pr_info(" dma1ErrorLog0: %016llx\n", data->dma1ErrorLog0); data->phbErrorStatus, data->phbFirstErrorStatus,
pr_info(" dma1ErrorLog1: %016llx\n", data->dma1ErrorLog1); data->phbErrorLog0, data->phbErrorLog1);
if (data->mmioErrorStatus || data->mmioFirstErrorStatus ||
data->mmioErrorLog0 || data->mmioErrorLog1)
pr_info(" OutErr: %016llx %016llx %016llx %016llx\n",
data->mmioErrorStatus, data->mmioFirstErrorStatus,
data->mmioErrorLog0, data->mmioErrorLog1);
if (data->dma0ErrorStatus || data->dma0FirstErrorStatus ||
data->dma0ErrorLog0 || data->dma0ErrorLog1)
pr_info(" InAErr: %016llx %016llx %016llx %016llx\n",
data->dma0ErrorStatus, data->dma0FirstErrorStatus,
data->dma0ErrorLog0, data->dma0ErrorLog1);
if (data->dma1ErrorStatus || data->dma1FirstErrorStatus ||
data->dma1ErrorLog0 || data->dma1ErrorLog1)
pr_info(" InBErr: %016llx %016llx %016llx %016llx\n",
data->dma1ErrorStatus, data->dma1FirstErrorStatus,
data->dma1ErrorLog0, data->dma1ErrorLog1);
for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) { for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) {
if ((data->pestA[i] >> 63) == 0 && if ((data->pestA[i] >> 63) == 0 &&
(data->pestB[i] >> 63) == 0) (data->pestB[i] >> 63) == 0)
continue; continue;
pr_info(" PE[%3d] PESTA: %016llx\n", i, data->pestA[i]); pr_info(" PE[%3d] A/B: %016llx %016llx\n",
pr_info(" PESTB: %016llx\n", data->pestB[i]); i, data->pestA[i], data->pestB[i]);
} }
} }
...@@ -197,62 +212,77 @@ static void pnv_pci_dump_phb3_diag_data(struct pci_controller *hose, ...@@ -197,62 +212,77 @@ static void pnv_pci_dump_phb3_diag_data(struct pci_controller *hose,
data = (struct OpalIoPhb3ErrorData*)common; data = (struct OpalIoPhb3ErrorData*)common;
pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n\n", pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n\n",
hose->global_number, common->version); hose->global_number, common->version);
if (data->brdgCtl)
pr_info(" brdgCtl: %08x\n", data->brdgCtl); pr_info(" brdgCtl: %08x\n",
data->brdgCtl);
pr_info(" portStatusReg: %08x\n", data->portStatusReg); if (data->portStatusReg || data->rootCmplxStatus ||
pr_info(" rootCmplxStatus: %08x\n", data->rootCmplxStatus); data->busAgentStatus)
pr_info(" busAgentStatus: %08x\n", data->busAgentStatus); pr_info(" UtlSts: %08x %08x %08x\n",
data->portStatusReg, data->rootCmplxStatus,
pr_info(" deviceStatus: %08x\n", data->deviceStatus); data->busAgentStatus);
pr_info(" slotStatus: %08x\n", data->slotStatus); if (data->deviceStatus || data->slotStatus ||
pr_info(" linkStatus: %08x\n", data->linkStatus); data->linkStatus || data->devCmdStatus ||
pr_info(" devCmdStatus: %08x\n", data->devCmdStatus); data->devSecStatus)
pr_info(" devSecStatus: %08x\n", data->devSecStatus); pr_info(" RootSts: %08x %08x %08x %08x %08x\n",
data->deviceStatus, data->slotStatus,
pr_info(" rootErrorStatus: %08x\n", data->rootErrorStatus); data->linkStatus, data->devCmdStatus,
pr_info(" uncorrErrorStatus: %08x\n", data->uncorrErrorStatus); data->devSecStatus);
pr_info(" corrErrorStatus: %08x\n", data->corrErrorStatus); if (data->rootErrorStatus || data->uncorrErrorStatus ||
pr_info(" tlpHdr1: %08x\n", data->tlpHdr1); data->corrErrorStatus)
pr_info(" tlpHdr2: %08x\n", data->tlpHdr2); pr_info(" RootErrSts: %08x %08x %08x\n",
pr_info(" tlpHdr3: %08x\n", data->tlpHdr3); data->rootErrorStatus, data->uncorrErrorStatus,
pr_info(" tlpHdr4: %08x\n", data->tlpHdr4); data->corrErrorStatus);
pr_info(" sourceId: %08x\n", data->sourceId); if (data->tlpHdr1 || data->tlpHdr2 ||
pr_info(" errorClass: %016llx\n", data->errorClass); data->tlpHdr3 || data->tlpHdr4)
pr_info(" correlator: %016llx\n", data->correlator); pr_info(" RootErrLog: %08x %08x %08x %08x\n",
data->tlpHdr1, data->tlpHdr2,
pr_info(" nFir: %016llx\n", data->nFir); data->tlpHdr3, data->tlpHdr4);
pr_info(" nFirMask: %016llx\n", data->nFirMask); if (data->sourceId || data->errorClass ||
pr_info(" nFirWOF: %016llx\n", data->nFirWOF); data->correlator)
pr_info(" PhbPlssr: %016llx\n", data->phbPlssr); pr_info(" RootErrLog1: %08x %016llx %016llx\n",
pr_info(" PhbCsr: %016llx\n", data->phbCsr); data->sourceId, data->errorClass,
pr_info(" lemFir: %016llx\n", data->lemFir); data->correlator);
pr_info(" lemErrorMask: %016llx\n", data->lemErrorMask); if (data->nFir || data->nFirMask ||
pr_info(" lemWOF: %016llx\n", data->lemWOF); data->nFirWOF)
pr_info(" phbErrorStatus: %016llx\n", data->phbErrorStatus); pr_info(" nFir: %016llx %016llx %016llx\n",
pr_info(" phbFirstErrorStatus: %016llx\n", data->phbFirstErrorStatus); data->nFir, data->nFirMask,
pr_info(" phbErrorLog0: %016llx\n", data->phbErrorLog0); data->nFirWOF);
pr_info(" phbErrorLog1: %016llx\n", data->phbErrorLog1); if (data->phbPlssr || data->phbCsr)
pr_info(" mmioErrorStatus: %016llx\n", data->mmioErrorStatus); pr_info(" PhbSts: %016llx %016llx\n",
pr_info(" mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus); data->phbPlssr, data->phbCsr);
pr_info(" mmioErrorLog0: %016llx\n", data->mmioErrorLog0); if (data->lemFir || data->lemErrorMask ||
pr_info(" mmioErrorLog1: %016llx\n", data->mmioErrorLog1); data->lemWOF)
pr_info(" dma0ErrorStatus: %016llx\n", data->dma0ErrorStatus); pr_info(" Lem: %016llx %016llx %016llx\n",
pr_info(" dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus); data->lemFir, data->lemErrorMask,
pr_info(" dma0ErrorLog0: %016llx\n", data->dma0ErrorLog0); data->lemWOF);
pr_info(" dma0ErrorLog1: %016llx\n", data->dma0ErrorLog1); if (data->phbErrorStatus || data->phbFirstErrorStatus ||
pr_info(" dma1ErrorStatus: %016llx\n", data->dma1ErrorStatus); data->phbErrorLog0 || data->phbErrorLog1)
pr_info(" dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus); pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n",
pr_info(" dma1ErrorLog0: %016llx\n", data->dma1ErrorLog0); data->phbErrorStatus, data->phbFirstErrorStatus,
pr_info(" dma1ErrorLog1: %016llx\n", data->dma1ErrorLog1); data->phbErrorLog0, data->phbErrorLog1);
if (data->mmioErrorStatus || data->mmioFirstErrorStatus ||
data->mmioErrorLog0 || data->mmioErrorLog1)
pr_info(" OutErr: %016llx %016llx %016llx %016llx\n",
data->mmioErrorStatus, data->mmioFirstErrorStatus,
data->mmioErrorLog0, data->mmioErrorLog1);
if (data->dma0ErrorStatus || data->dma0FirstErrorStatus ||
data->dma0ErrorLog0 || data->dma0ErrorLog1)
pr_info(" InAErr: %016llx %016llx %016llx %016llx\n",
data->dma0ErrorStatus, data->dma0FirstErrorStatus,
data->dma0ErrorLog0, data->dma0ErrorLog1);
if (data->dma1ErrorStatus || data->dma1FirstErrorStatus ||
data->dma1ErrorLog0 || data->dma1ErrorLog1)
pr_info(" InBErr: %016llx %016llx %016llx %016llx\n",
data->dma1ErrorStatus, data->dma1FirstErrorStatus,
data->dma1ErrorLog0, data->dma1ErrorLog1);
for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) { for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) {
if ((data->pestA[i] >> 63) == 0 && if ((data->pestA[i] >> 63) == 0 &&
(data->pestB[i] >> 63) == 0) (data->pestB[i] >> 63) == 0)
continue; continue;
pr_info(" PE[%3d] PESTA: %016llx\n", i, data->pestA[i]); pr_info(" PE[%3d] A/B: %016llx %016llx\n",
pr_info(" PESTB: %016llx\n", data->pestB[i]); i, data->pestA[i], data->pestB[i]);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment