提交 f18440fb 编写于 作者: G Gavin Shan 提交者: Benjamin Herrenschmidt

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: NGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 0dae2743
...@@ -513,40 +513,40 @@ enum { ...@@ -513,40 +513,40 @@ enum {
}; };
struct OpalIoP7IOCErrorData { struct OpalIoP7IOCErrorData {
uint16_t type; __be16 type;
/* GEM */ /* GEM */
uint64_t gemXfir; __be64 gemXfir;
uint64_t gemRfir; __be64 gemRfir;
uint64_t gemRirqfir; __be64 gemRirqfir;
uint64_t gemMask; __be64 gemMask;
uint64_t gemRwof; __be64 gemRwof;
/* LEM */ /* LEM */
uint64_t lemFir; __be64 lemFir;
uint64_t lemErrMask; __be64 lemErrMask;
uint64_t lemAction0; __be64 lemAction0;
uint64_t lemAction1; __be64 lemAction1;
uint64_t lemWof; __be64 lemWof;
union { union {
struct OpalIoP7IOCRgcErrorData { struct OpalIoP7IOCRgcErrorData {
uint64_t rgcStatus; /* 3E1C10 */ __be64 rgcStatus; /* 3E1C10 */
uint64_t rgcLdcp; /* 3E1C18 */ __be64 rgcLdcp; /* 3E1C18 */
}rgc; }rgc;
struct OpalIoP7IOCBiErrorData { struct OpalIoP7IOCBiErrorData {
uint64_t biLdcp0; /* 3C0100, 3C0118 */ __be64 biLdcp0; /* 3C0100, 3C0118 */
uint64_t biLdcp1; /* 3C0108, 3C0120 */ __be64 biLdcp1; /* 3C0108, 3C0120 */
uint64_t biLdcp2; /* 3C0110, 3C0128 */ __be64 biLdcp2; /* 3C0110, 3C0128 */
uint64_t biFenceStatus; /* 3C0130, 3C0130 */ __be64 biFenceStatus; /* 3C0130, 3C0130 */
uint8_t biDownbound; /* BI Downbound or Upbound */ u8 biDownbound; /* BI Downbound or Upbound */
}bi; }bi;
struct OpalIoP7IOCCiErrorData { struct OpalIoP7IOCCiErrorData {
uint64_t ciPortStatus; /* 3Dn008 */ __be64 ciPortStatus; /* 3Dn008 */
uint64_t ciPortLdcp; /* 3Dn010 */ __be64 ciPortLdcp; /* 3Dn010 */
uint8_t ciPort; /* Index of CI port: 0/1 */ u8 ciPort; /* Index of CI port: 0/1 */
}ci; }ci;
}; };
}; };
...@@ -578,60 +578,60 @@ struct OpalIoPhbErrorCommon { ...@@ -578,60 +578,60 @@ struct OpalIoPhbErrorCommon {
struct OpalIoP7IOCPhbErrorData { struct OpalIoP7IOCPhbErrorData {
struct OpalIoPhbErrorCommon common; struct OpalIoPhbErrorCommon common;
uint32_t brdgCtl; __be32 brdgCtl;
// P7IOC utl regs // P7IOC utl regs
uint32_t portStatusReg; __be32 portStatusReg;
uint32_t rootCmplxStatus; __be32 rootCmplxStatus;
uint32_t busAgentStatus; __be32 busAgentStatus;
// P7IOC cfg regs // P7IOC cfg regs
uint32_t deviceStatus; __be32 deviceStatus;
uint32_t slotStatus; __be32 slotStatus;
uint32_t linkStatus; __be32 linkStatus;
uint32_t devCmdStatus; __be32 devCmdStatus;
uint32_t devSecStatus; __be32 devSecStatus;
// cfg AER regs // cfg AER regs
uint32_t rootErrorStatus; __be32 rootErrorStatus;
uint32_t uncorrErrorStatus; __be32 uncorrErrorStatus;
uint32_t corrErrorStatus; __be32 corrErrorStatus;
uint32_t tlpHdr1; __be32 tlpHdr1;
uint32_t tlpHdr2; __be32 tlpHdr2;
uint32_t tlpHdr3; __be32 tlpHdr3;
uint32_t tlpHdr4; __be32 tlpHdr4;
uint32_t sourceId; __be32 sourceId;
uint32_t rsv3; __be32 rsv3;
// Record data about the call to allocate a buffer. // Record data about the call to allocate a buffer.
uint64_t errorClass; __be64 errorClass;
uint64_t correlator; __be64 correlator;
//P7IOC MMIO Error Regs //P7IOC MMIO Error Regs
uint64_t p7iocPlssr; // n120 __be64 p7iocPlssr; // n120
uint64_t p7iocCsr; // n110 __be64 p7iocCsr; // n110
uint64_t lemFir; // nC00 __be64 lemFir; // nC00
uint64_t lemErrorMask; // nC18 __be64 lemErrorMask; // nC18
uint64_t lemWOF; // nC40 __be64 lemWOF; // nC40
uint64_t phbErrorStatus; // nC80 __be64 phbErrorStatus; // nC80
uint64_t phbFirstErrorStatus; // nC88 __be64 phbFirstErrorStatus; // nC88
uint64_t phbErrorLog0; // nCC0 __be64 phbErrorLog0; // nCC0
uint64_t phbErrorLog1; // nCC8 __be64 phbErrorLog1; // nCC8
uint64_t mmioErrorStatus; // nD00 __be64 mmioErrorStatus; // nD00
uint64_t mmioFirstErrorStatus; // nD08 __be64 mmioFirstErrorStatus; // nD08
uint64_t mmioErrorLog0; // nD40 __be64 mmioErrorLog0; // nD40
uint64_t mmioErrorLog1; // nD48 __be64 mmioErrorLog1; // nD48
uint64_t dma0ErrorStatus; // nD80 __be64 dma0ErrorStatus; // nD80
uint64_t dma0FirstErrorStatus; // nD88 __be64 dma0FirstErrorStatus; // nD88
uint64_t dma0ErrorLog0; // nDC0 __be64 dma0ErrorLog0; // nDC0
uint64_t dma0ErrorLog1; // nDC8 __be64 dma0ErrorLog1; // nDC8
uint64_t dma1ErrorStatus; // nE00 __be64 dma1ErrorStatus; // nE00
uint64_t dma1FirstErrorStatus; // nE08 __be64 dma1FirstErrorStatus; // nE08
uint64_t dma1ErrorLog0; // nE40 __be64 dma1ErrorLog0; // nE40
uint64_t dma1ErrorLog1; // nE48 __be64 dma1ErrorLog1; // nE48
uint64_t pestA[OPAL_P7IOC_NUM_PEST_REGS]; __be64 pestA[OPAL_P7IOC_NUM_PEST_REGS];
uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS]; __be64 pestB[OPAL_P7IOC_NUM_PEST_REGS];
}; };
struct OpalIoPhb3ErrorData { struct OpalIoPhb3ErrorData {
......
...@@ -605,18 +605,24 @@ static int ioda_eeh_configure_bridge(struct eeh_pe *pe) ...@@ -605,18 +605,24 @@ static int ioda_eeh_configure_bridge(struct eeh_pe *pe)
static void ioda_eeh_hub_diag_common(struct OpalIoP7IOCErrorData *data) static void ioda_eeh_hub_diag_common(struct OpalIoP7IOCErrorData *data)
{ {
/* GEM */ /* GEM */
pr_info(" GEM XFIR: %016llx\n", data->gemXfir); if (data->gemXfir || data->gemRfir ||
pr_info(" GEM RFIR: %016llx\n", data->gemRfir); data->gemRirqfir || data->gemMask || data->gemRwof)
pr_info(" GEM RIRQFIR: %016llx\n", data->gemRirqfir); pr_info(" GEM: %016llx %016llx %016llx %016llx %016llx\n",
pr_info(" GEM Mask: %016llx\n", data->gemMask); be64_to_cpu(data->gemXfir),
pr_info(" GEM RWOF: %016llx\n", data->gemRwof); be64_to_cpu(data->gemRfir),
be64_to_cpu(data->gemRirqfir),
be64_to_cpu(data->gemMask),
be64_to_cpu(data->gemRwof));
/* LEM */ /* LEM */
pr_info(" LEM FIR: %016llx\n", data->lemFir); if (data->lemFir || data->lemErrMask ||
pr_info(" LEM Error Mask: %016llx\n", data->lemErrMask); data->lemAction0 || data->lemAction1 || data->lemWof)
pr_info(" LEM Action 0: %016llx\n", data->lemAction0); pr_info(" LEM: %016llx %016llx %016llx %016llx %016llx\n",
pr_info(" LEM Action 1: %016llx\n", data->lemAction1); be64_to_cpu(data->lemFir),
pr_info(" LEM WOF: %016llx\n", data->lemWof); be64_to_cpu(data->lemErrMask),
be64_to_cpu(data->lemAction0),
be64_to_cpu(data->lemAction1),
be64_to_cpu(data->lemWof));
} }
static void ioda_eeh_hub_diag(struct pci_controller *hose) static void ioda_eeh_hub_diag(struct pci_controller *hose)
...@@ -636,24 +642,31 @@ static void ioda_eeh_hub_diag(struct pci_controller *hose) ...@@ -636,24 +642,31 @@ static void ioda_eeh_hub_diag(struct pci_controller *hose)
case OPAL_P7IOC_DIAG_TYPE_RGC: case OPAL_P7IOC_DIAG_TYPE_RGC:
pr_info("P7IOC diag-data for RGC\n\n"); pr_info("P7IOC diag-data for RGC\n\n");
ioda_eeh_hub_diag_common(data); ioda_eeh_hub_diag_common(data);
pr_info(" RGC Status: %016llx\n", data->rgc.rgcStatus); if (data->rgc.rgcStatus || data->rgc.rgcLdcp)
pr_info(" RGC LDCP: %016llx\n", data->rgc.rgcLdcp); pr_info(" RGC: %016llx %016llx\n",
be64_to_cpu(data->rgc.rgcStatus),
be64_to_cpu(data->rgc.rgcLdcp));
break; break;
case OPAL_P7IOC_DIAG_TYPE_BI: case OPAL_P7IOC_DIAG_TYPE_BI:
pr_info("P7IOC diag-data for BI %s\n\n", pr_info("P7IOC diag-data for BI %s\n\n",
data->bi.biDownbound ? "Downbound" : "Upbound"); data->bi.biDownbound ? "Downbound" : "Upbound");
ioda_eeh_hub_diag_common(data); ioda_eeh_hub_diag_common(data);
pr_info(" BI LDCP 0: %016llx\n", data->bi.biLdcp0); if (data->bi.biLdcp0 || data->bi.biLdcp1 ||
pr_info(" BI LDCP 1: %016llx\n", data->bi.biLdcp1); data->bi.biLdcp2 || data->bi.biFenceStatus)
pr_info(" BI LDCP 2: %016llx\n", data->bi.biLdcp2); pr_info(" BI: %016llx %016llx %016llx %016llx\n",
pr_info(" BI Fence Status: %016llx\n", data->bi.biFenceStatus); be64_to_cpu(data->bi.biLdcp0),
be64_to_cpu(data->bi.biLdcp1),
be64_to_cpu(data->bi.biLdcp2),
be64_to_cpu(data->bi.biFenceStatus));
break; break;
case OPAL_P7IOC_DIAG_TYPE_CI: case OPAL_P7IOC_DIAG_TYPE_CI:
pr_info("P7IOC diag-data for CI Port %d\\nn", pr_info("P7IOC diag-data for CI Port %d\n\n",
data->ci.ciPort); data->ci.ciPort);
ioda_eeh_hub_diag_common(data); ioda_eeh_hub_diag_common(data);
pr_info(" CI Port Status: %016llx\n", data->ci.ciPortStatus); if (data->ci.ciPortStatus || data->ci.ciPortLdcp)
pr_info(" CI Port LDCP: %016llx\n", data->ci.ciPortLdcp); pr_info(" CI: %016llx %016llx\n",
be64_to_cpu(data->ci.ciPortStatus),
be64_to_cpu(data->ci.ciPortLdcp));
break; break;
case OPAL_P7IOC_DIAG_TYPE_MISC: case OPAL_P7IOC_DIAG_TYPE_MISC:
pr_info("P7IOC diag-data for MISC\n\n"); pr_info("P7IOC diag-data for MISC\n\n");
......
...@@ -132,61 +132,78 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose, ...@@ -132,61 +132,78 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose,
data = (struct OpalIoP7IOCPhbErrorData *)common; data = (struct OpalIoP7IOCPhbErrorData *)common;
pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n", pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n",
hose->global_number, common->version); hose->global_number, be32_to_cpu(common->version));
if (data->brdgCtl) if (data->brdgCtl)
pr_info("brdgCtl: %08x\n", pr_info("brdgCtl: %08x\n",
data->brdgCtl); be32_to_cpu(data->brdgCtl));
if (data->portStatusReg || data->rootCmplxStatus || if (data->portStatusReg || data->rootCmplxStatus ||
data->busAgentStatus) data->busAgentStatus)
pr_info("UtlSts: %08x %08x %08x\n", pr_info("UtlSts: %08x %08x %08x\n",
data->portStatusReg, data->rootCmplxStatus, be32_to_cpu(data->portStatusReg),
data->busAgentStatus); be32_to_cpu(data->rootCmplxStatus),
be32_to_cpu(data->busAgentStatus));
if (data->deviceStatus || data->slotStatus || if (data->deviceStatus || data->slotStatus ||
data->linkStatus || data->devCmdStatus || data->linkStatus || data->devCmdStatus ||
data->devSecStatus) data->devSecStatus)
pr_info("RootSts: %08x %08x %08x %08x %08x\n", pr_info("RootSts: %08x %08x %08x %08x %08x\n",
data->deviceStatus, data->slotStatus, be32_to_cpu(data->deviceStatus),
data->linkStatus, data->devCmdStatus, be32_to_cpu(data->slotStatus),
data->devSecStatus); be32_to_cpu(data->linkStatus),
be32_to_cpu(data->devCmdStatus),
be32_to_cpu(data->devSecStatus));
if (data->rootErrorStatus || data->uncorrErrorStatus || if (data->rootErrorStatus || data->uncorrErrorStatus ||
data->corrErrorStatus) data->corrErrorStatus)
pr_info("RootErrSts: %08x %08x %08x\n", pr_info("RootErrSts: %08x %08x %08x\n",
data->rootErrorStatus, data->uncorrErrorStatus, be32_to_cpu(data->rootErrorStatus),
data->corrErrorStatus); be32_to_cpu(data->uncorrErrorStatus),
be32_to_cpu(data->corrErrorStatus));
if (data->tlpHdr1 || data->tlpHdr2 || if (data->tlpHdr1 || data->tlpHdr2 ||
data->tlpHdr3 || data->tlpHdr4) data->tlpHdr3 || data->tlpHdr4)
pr_info("RootErrLog: %08x %08x %08x %08x\n", pr_info("RootErrLog: %08x %08x %08x %08x\n",
data->tlpHdr1, data->tlpHdr2, be32_to_cpu(data->tlpHdr1),
data->tlpHdr3, data->tlpHdr4); be32_to_cpu(data->tlpHdr2),
be32_to_cpu(data->tlpHdr3),
be32_to_cpu(data->tlpHdr4));
if (data->sourceId || data->errorClass || if (data->sourceId || data->errorClass ||
data->correlator) data->correlator)
pr_info("RootErrLog1: %08x %016llx %016llx\n", pr_info("RootErrLog1: %08x %016llx %016llx\n",
data->sourceId, data->errorClass, be32_to_cpu(data->sourceId),
data->correlator); be64_to_cpu(data->errorClass),
be64_to_cpu(data->correlator));
if (data->p7iocPlssr || data->p7iocCsr) if (data->p7iocPlssr || data->p7iocCsr)
pr_info("PhbSts: %016llx %016llx\n", pr_info("PhbSts: %016llx %016llx\n",
data->p7iocPlssr, data->p7iocCsr); be64_to_cpu(data->p7iocPlssr),
be64_to_cpu(data->p7iocCsr));
if (data->lemFir) if (data->lemFir)
pr_info("Lem: %016llx %016llx %016llx\n", pr_info("Lem: %016llx %016llx %016llx\n",
data->lemFir, data->lemErrorMask, be64_to_cpu(data->lemFir),
data->lemWOF); be64_to_cpu(data->lemErrorMask),
be64_to_cpu(data->lemWOF));
if (data->phbErrorStatus) if (data->phbErrorStatus)
pr_info("PhbErr: %016llx %016llx %016llx %016llx\n", pr_info("PhbErr: %016llx %016llx %016llx %016llx\n",
data->phbErrorStatus, data->phbFirstErrorStatus, be64_to_cpu(data->phbErrorStatus),
data->phbErrorLog0, data->phbErrorLog1); be64_to_cpu(data->phbFirstErrorStatus),
be64_to_cpu(data->phbErrorLog0),
be64_to_cpu(data->phbErrorLog1));
if (data->mmioErrorStatus) if (data->mmioErrorStatus)
pr_info("OutErr: %016llx %016llx %016llx %016llx\n", pr_info("OutErr: %016llx %016llx %016llx %016llx\n",
data->mmioErrorStatus, data->mmioFirstErrorStatus, be64_to_cpu(data->mmioErrorStatus),
data->mmioErrorLog0, data->mmioErrorLog1); be64_to_cpu(data->mmioFirstErrorStatus),
be64_to_cpu(data->mmioErrorLog0),
be64_to_cpu(data->mmioErrorLog1));
if (data->dma0ErrorStatus) if (data->dma0ErrorStatus)
pr_info("InAErr: %016llx %016llx %016llx %016llx\n", pr_info("InAErr: %016llx %016llx %016llx %016llx\n",
data->dma0ErrorStatus, data->dma0FirstErrorStatus, be64_to_cpu(data->dma0ErrorStatus),
data->dma0ErrorLog0, data->dma0ErrorLog1); be64_to_cpu(data->dma0FirstErrorStatus),
be64_to_cpu(data->dma0ErrorLog0),
be64_to_cpu(data->dma0ErrorLog1));
if (data->dma1ErrorStatus) if (data->dma1ErrorStatus)
pr_info("InBErr: %016llx %016llx %016llx %016llx\n", pr_info("InBErr: %016llx %016llx %016llx %016llx\n",
data->dma1ErrorStatus, data->dma1FirstErrorStatus, be64_to_cpu(data->dma1ErrorStatus),
data->dma1ErrorLog0, data->dma1ErrorLog1); be64_to_cpu(data->dma1FirstErrorStatus),
be64_to_cpu(data->dma1ErrorLog0),
be64_to_cpu(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 &&
...@@ -194,7 +211,8 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose, ...@@ -194,7 +211,8 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose,
continue; continue;
pr_info("PE[%3d] A/B: %016llx %016llx\n", pr_info("PE[%3d] A/B: %016llx %016llx\n",
i, data->pestA[i], data->pestB[i]); i, be64_to_cpu(data->pestA[i]),
be64_to_cpu(data->pestB[i]));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册