diff options
author | Guo Chao <yan@linux.vnet.ibm.com> | 2014-06-09 04:58:51 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-06-11 03:03:23 -0400 |
commit | ddf0322a3ffe2d98facc72f255ac5c140b547c72 (patch) | |
tree | 72c1e1a794a0b2363e8053617accb9c306d04777 /arch | |
parent | 8b9f9269bcfb4fe9b44bb52aac1ce796834109fe (diff) |
powerpc/powernv: Fix endianness problems in EEH
EEH information fetched from OPAL need fix before using in LE environment.
To be included in sparse's endian check, declare them as __beXX and
access them by accessors.
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
Acked-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.h | 102 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/eeh-ioda.c | 36 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.c | 81 |
3 files changed, 120 insertions, 99 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index cb15cbb51600..460018889ba9 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
@@ -599,9 +599,9 @@ enum { | |||
599 | }; | 599 | }; |
600 | 600 | ||
601 | struct OpalIoPhbErrorCommon { | 601 | struct OpalIoPhbErrorCommon { |
602 | uint32_t version; | 602 | __be32 version; |
603 | uint32_t ioType; | 603 | __be32 ioType; |
604 | uint32_t len; | 604 | __be32 len; |
605 | }; | 605 | }; |
606 | 606 | ||
607 | struct OpalIoP7IOCPhbErrorData { | 607 | struct OpalIoP7IOCPhbErrorData { |
@@ -666,64 +666,64 @@ struct OpalIoP7IOCPhbErrorData { | |||
666 | struct OpalIoPhb3ErrorData { | 666 | struct OpalIoPhb3ErrorData { |
667 | struct OpalIoPhbErrorCommon common; | 667 | struct OpalIoPhbErrorCommon common; |
668 | 668 | ||
669 | uint32_t brdgCtl; | 669 | __be32 brdgCtl; |
670 | 670 | ||
671 | /* PHB3 UTL regs */ | 671 | /* PHB3 UTL regs */ |
672 | uint32_t portStatusReg; | 672 | __be32 portStatusReg; |
673 | uint32_t rootCmplxStatus; | 673 | __be32 rootCmplxStatus; |
674 | uint32_t busAgentStatus; | 674 | __be32 busAgentStatus; |
675 | 675 | ||
676 | /* PHB3 cfg regs */ | 676 | /* PHB3 cfg regs */ |
677 | uint32_t deviceStatus; | 677 | __be32 deviceStatus; |
678 | uint32_t slotStatus; | 678 | __be32 slotStatus; |
679 | uint32_t linkStatus; | 679 | __be32 linkStatus; |
680 | uint32_t devCmdStatus; | 680 | __be32 devCmdStatus; |
681 | uint32_t devSecStatus; | 681 | __be32 devSecStatus; |
682 | 682 | ||
683 | /* cfg AER regs */ | 683 | /* cfg AER regs */ |
684 | uint32_t rootErrorStatus; | 684 | __be32 rootErrorStatus; |
685 | uint32_t uncorrErrorStatus; | 685 | __be32 uncorrErrorStatus; |
686 | uint32_t corrErrorStatus; | 686 | __be32 corrErrorStatus; |
687 | uint32_t tlpHdr1; | 687 | __be32 tlpHdr1; |
688 | uint32_t tlpHdr2; | 688 | __be32 tlpHdr2; |
689 | uint32_t tlpHdr3; | 689 | __be32 tlpHdr3; |
690 | uint32_t tlpHdr4; | 690 | __be32 tlpHdr4; |
691 | uint32_t sourceId; | 691 | __be32 sourceId; |
692 | 692 | ||
693 | uint32_t rsv3; | 693 | __be32 rsv3; |
694 | 694 | ||
695 | /* Record data about the call to allocate a buffer */ | 695 | /* Record data about the call to allocate a buffer */ |
696 | uint64_t errorClass; | 696 | __be64 errorClass; |
697 | uint64_t correlator; | 697 | __be64 correlator; |
698 | 698 | ||
699 | uint64_t nFir; /* 000 */ | 699 | __be64 nFir; /* 000 */ |
700 | uint64_t nFirMask; /* 003 */ | 700 | __be64 nFirMask; /* 003 */ |
701 | uint64_t nFirWOF; /* 008 */ | 701 | __be64 nFirWOF; /* 008 */ |
702 | 702 | ||
703 | /* PHB3 MMIO Error Regs */ | 703 | /* PHB3 MMIO Error Regs */ |
704 | uint64_t phbPlssr; /* 120 */ | 704 | __be64 phbPlssr; /* 120 */ |
705 | uint64_t phbCsr; /* 110 */ | 705 | __be64 phbCsr; /* 110 */ |
706 | uint64_t lemFir; /* C00 */ | 706 | __be64 lemFir; /* C00 */ |
707 | uint64_t lemErrorMask; /* C18 */ | 707 | __be64 lemErrorMask; /* C18 */ |
708 | uint64_t lemWOF; /* C40 */ | 708 | __be64 lemWOF; /* C40 */ |
709 | uint64_t phbErrorStatus; /* C80 */ | 709 | __be64 phbErrorStatus; /* C80 */ |
710 | uint64_t phbFirstErrorStatus; /* C88 */ | 710 | __be64 phbFirstErrorStatus; /* C88 */ |
711 | uint64_t phbErrorLog0; /* CC0 */ | 711 | __be64 phbErrorLog0; /* CC0 */ |
712 | uint64_t phbErrorLog1; /* CC8 */ | 712 | __be64 phbErrorLog1; /* CC8 */ |
713 | uint64_t mmioErrorStatus; /* D00 */ | 713 | __be64 mmioErrorStatus; /* D00 */ |
714 | uint64_t mmioFirstErrorStatus; /* D08 */ | 714 | __be64 mmioFirstErrorStatus; /* D08 */ |
715 | uint64_t mmioErrorLog0; /* D40 */ | 715 | __be64 mmioErrorLog0; /* D40 */ |
716 | uint64_t mmioErrorLog1; /* D48 */ | 716 | __be64 mmioErrorLog1; /* D48 */ |
717 | uint64_t dma0ErrorStatus; /* D80 */ | 717 | __be64 dma0ErrorStatus; /* D80 */ |
718 | uint64_t dma0FirstErrorStatus; /* D88 */ | 718 | __be64 dma0FirstErrorStatus; /* D88 */ |
719 | uint64_t dma0ErrorLog0; /* DC0 */ | 719 | __be64 dma0ErrorLog0; /* DC0 */ |
720 | uint64_t dma0ErrorLog1; /* DC8 */ | 720 | __be64 dma0ErrorLog1; /* DC8 */ |
721 | uint64_t dma1ErrorStatus; /* E00 */ | 721 | __be64 dma1ErrorStatus; /* E00 */ |
722 | uint64_t dma1FirstErrorStatus; /* E08 */ | 722 | __be64 dma1FirstErrorStatus; /* E08 */ |
723 | uint64_t dma1ErrorLog0; /* E40 */ | 723 | __be64 dma1ErrorLog0; /* E40 */ |
724 | uint64_t dma1ErrorLog1; /* E48 */ | 724 | __be64 dma1ErrorLog1; /* E48 */ |
725 | uint64_t pestA[OPAL_PHB3_NUM_PEST_REGS]; | 725 | __be64 pestA[OPAL_PHB3_NUM_PEST_REGS]; |
726 | uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS]; | 726 | __be64 pestB[OPAL_PHB3_NUM_PEST_REGS]; |
727 | }; | 727 | }; |
728 | 728 | ||
729 | enum { | 729 | enum { |
@@ -851,8 +851,8 @@ int64_t opal_pci_mask_pe_error(uint64_t phb_id, uint16_t pe_number, uint8_t erro | |||
851 | int64_t opal_set_slot_led_status(uint64_t phb_id, uint64_t slot_id, uint8_t led_type, uint8_t led_action); | 851 | int64_t opal_set_slot_led_status(uint64_t phb_id, uint64_t slot_id, uint8_t led_type, uint8_t led_action); |
852 | int64_t opal_get_epow_status(__be64 *status); | 852 | int64_t opal_get_epow_status(__be64 *status); |
853 | int64_t opal_set_system_attention_led(uint8_t led_action); | 853 | int64_t opal_set_system_attention_led(uint8_t led_action); |
854 | int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe, | 854 | int64_t opal_pci_next_error(uint64_t phb_id, __be64 *first_frozen_pe, |
855 | uint16_t *pci_error_type, uint16_t *severity); | 855 | __be16 *pci_error_type, __be16 *severity); |
856 | int64_t opal_pci_poll(uint64_t phb_id); | 856 | int64_t opal_pci_poll(uint64_t phb_id); |
857 | int64_t opal_return_cpu(void); | 857 | int64_t opal_return_cpu(void); |
858 | int64_t opal_reinit_cpus(uint64_t flags); | 858 | int64_t opal_reinit_cpus(uint64_t flags); |
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index 753f08e36dfa..e0d6a3a213e2 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -267,7 +267,7 @@ static int ioda_eeh_get_state(struct eeh_pe *pe) | |||
267 | { | 267 | { |
268 | s64 ret = 0; | 268 | s64 ret = 0; |
269 | u8 fstate; | 269 | u8 fstate; |
270 | u16 pcierr; | 270 | __be16 pcierr; |
271 | u32 pe_no; | 271 | u32 pe_no; |
272 | int result; | 272 | int result; |
273 | struct pci_controller *hose = pe->phb; | 273 | struct pci_controller *hose = pe->phb; |
@@ -316,7 +316,7 @@ static int ioda_eeh_get_state(struct eeh_pe *pe) | |||
316 | result = 0; | 316 | result = 0; |
317 | result &= ~EEH_STATE_RESET_ACTIVE; | 317 | result &= ~EEH_STATE_RESET_ACTIVE; |
318 | 318 | ||
319 | if (pcierr != OPAL_EEH_PHB_ERROR) { | 319 | if (be16_to_cpu(pcierr) != OPAL_EEH_PHB_ERROR) { |
320 | result |= EEH_STATE_MMIO_ACTIVE; | 320 | result |= EEH_STATE_MMIO_ACTIVE; |
321 | result |= EEH_STATE_DMA_ACTIVE; | 321 | result |= EEH_STATE_DMA_ACTIVE; |
322 | result |= EEH_STATE_MMIO_ENABLED; | 322 | result |= EEH_STATE_MMIO_ENABLED; |
@@ -706,8 +706,8 @@ static int ioda_eeh_next_error(struct eeh_pe **pe) | |||
706 | struct pci_controller *hose; | 706 | struct pci_controller *hose; |
707 | struct pnv_phb *phb; | 707 | struct pnv_phb *phb; |
708 | struct eeh_pe *phb_pe; | 708 | struct eeh_pe *phb_pe; |
709 | u64 frozen_pe_no; | 709 | __be64 frozen_pe_no; |
710 | u16 err_type, severity; | 710 | __be16 err_type, severity; |
711 | long rc; | 711 | long rc; |
712 | int ret = EEH_NEXT_ERR_NONE; | 712 | int ret = EEH_NEXT_ERR_NONE; |
713 | 713 | ||
@@ -742,8 +742,8 @@ static int ioda_eeh_next_error(struct eeh_pe **pe) | |||
742 | } | 742 | } |
743 | 743 | ||
744 | /* If the PHB doesn't have error, stop processing */ | 744 | /* If the PHB doesn't have error, stop processing */ |
745 | if (err_type == OPAL_EEH_NO_ERROR || | 745 | if (be16_to_cpu(err_type) == OPAL_EEH_NO_ERROR || |
746 | severity == OPAL_EEH_SEV_NO_ERROR) { | 746 | be16_to_cpu(severity) == OPAL_EEH_SEV_NO_ERROR) { |
747 | pr_devel("%s: No error found on PHB#%x\n", | 747 | pr_devel("%s: No error found on PHB#%x\n", |
748 | __func__, hose->global_number); | 748 | __func__, hose->global_number); |
749 | continue; | 749 | continue; |
@@ -755,14 +755,14 @@ static int ioda_eeh_next_error(struct eeh_pe **pe) | |||
755 | * specific PHB. | 755 | * specific PHB. |
756 | */ | 756 | */ |
757 | pr_devel("%s: Error (%d, %d, %llu) on PHB#%x\n", | 757 | pr_devel("%s: Error (%d, %d, %llu) on PHB#%x\n", |
758 | __func__, err_type, severity, | 758 | __func__, be16_to_cpu(err_type), be16_to_cpu(severity), |
759 | frozen_pe_no, hose->global_number); | 759 | be64_to_cpu(frozen_pe_no), hose->global_number); |
760 | switch (err_type) { | 760 | switch (be16_to_cpu(err_type)) { |
761 | case OPAL_EEH_IOC_ERROR: | 761 | case OPAL_EEH_IOC_ERROR: |
762 | if (severity == OPAL_EEH_SEV_IOC_DEAD) { | 762 | if (be16_to_cpu(severity) == OPAL_EEH_SEV_IOC_DEAD) { |
763 | pr_err("EEH: dead IOC detected\n"); | 763 | pr_err("EEH: dead IOC detected\n"); |
764 | ret = EEH_NEXT_ERR_DEAD_IOC; | 764 | ret = EEH_NEXT_ERR_DEAD_IOC; |
765 | } else if (severity == OPAL_EEH_SEV_INF) { | 765 | } else if (be16_to_cpu(severity) == OPAL_EEH_SEV_INF) { |
766 | pr_info("EEH: IOC informative error " | 766 | pr_info("EEH: IOC informative error " |
767 | "detected\n"); | 767 | "detected\n"); |
768 | ioda_eeh_hub_diag(hose); | 768 | ioda_eeh_hub_diag(hose); |
@@ -771,17 +771,18 @@ static int ioda_eeh_next_error(struct eeh_pe **pe) | |||
771 | 771 | ||
772 | break; | 772 | break; |
773 | case OPAL_EEH_PHB_ERROR: | 773 | case OPAL_EEH_PHB_ERROR: |
774 | if (severity == OPAL_EEH_SEV_PHB_DEAD) { | 774 | if (be16_to_cpu(severity) == OPAL_EEH_SEV_PHB_DEAD) { |
775 | *pe = phb_pe; | 775 | *pe = phb_pe; |
776 | pr_err("EEH: dead PHB#%x detected\n", | 776 | pr_err("EEH: dead PHB#%x detected\n", |
777 | hose->global_number); | 777 | hose->global_number); |
778 | ret = EEH_NEXT_ERR_DEAD_PHB; | 778 | ret = EEH_NEXT_ERR_DEAD_PHB; |
779 | } else if (severity == OPAL_EEH_SEV_PHB_FENCED) { | 779 | } else if (be16_to_cpu(severity) == |
780 | OPAL_EEH_SEV_PHB_FENCED) { | ||
780 | *pe = phb_pe; | 781 | *pe = phb_pe; |
781 | pr_err("EEH: fenced PHB#%x detected\n", | 782 | pr_err("EEH: fenced PHB#%x detected\n", |
782 | hose->global_number); | 783 | hose->global_number); |
783 | ret = EEH_NEXT_ERR_FENCED_PHB; | 784 | ret = EEH_NEXT_ERR_FENCED_PHB; |
784 | } else if (severity == OPAL_EEH_SEV_INF) { | 785 | } else if (be16_to_cpu(severity) == OPAL_EEH_SEV_INF) { |
785 | pr_info("EEH: PHB#%x informative error " | 786 | pr_info("EEH: PHB#%x informative error " |
786 | "detected\n", | 787 | "detected\n", |
787 | hose->global_number); | 788 | hose->global_number); |
@@ -801,12 +802,13 @@ static int ioda_eeh_next_error(struct eeh_pe **pe) | |||
801 | * progress with recovery. We needn't report | 802 | * progress with recovery. We needn't report |
802 | * it again. | 803 | * it again. |
803 | */ | 804 | */ |
804 | if (ioda_eeh_get_pe(hose, frozen_pe_no, pe)) { | 805 | if (ioda_eeh_get_pe(hose, |
806 | be64_to_cpu(frozen_pe_no), pe)) { | ||
805 | *pe = phb_pe; | 807 | *pe = phb_pe; |
806 | pr_err("EEH: Escalated fenced PHB#%x " | 808 | pr_err("EEH: Escalated fenced PHB#%x " |
807 | "detected for PE#%llx\n", | 809 | "detected for PE#%llx\n", |
808 | hose->global_number, | 810 | hose->global_number, |
809 | frozen_pe_no); | 811 | be64_to_cpu(frozen_pe_no)); |
810 | ret = EEH_NEXT_ERR_FENCED_PHB; | 812 | ret = EEH_NEXT_ERR_FENCED_PHB; |
811 | } else if ((*pe)->state & EEH_PE_ISOLATED) { | 813 | } else if ((*pe)->state & EEH_PE_ISOLATED) { |
812 | ret = EEH_NEXT_ERR_NONE; | 814 | ret = EEH_NEXT_ERR_NONE; |
@@ -819,7 +821,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe) | |||
819 | break; | 821 | break; |
820 | default: | 822 | default: |
821 | pr_warn("%s: Unexpected error type %d\n", | 823 | pr_warn("%s: Unexpected error type %d\n", |
822 | __func__, err_type); | 824 | __func__, be16_to_cpu(err_type)); |
823 | } | 825 | } |
824 | 826 | ||
825 | /* | 827 | /* |
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index eefbfcc3fd8c..f91a4e5d872e 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -206,72 +206,91 @@ static void pnv_pci_dump_phb3_diag_data(struct pci_controller *hose, | |||
206 | 206 | ||
207 | data = (struct OpalIoPhb3ErrorData*)common; | 207 | data = (struct OpalIoPhb3ErrorData*)common; |
208 | pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n", | 208 | pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n", |
209 | hose->global_number, common->version); | 209 | hose->global_number, be32_to_cpu(common->version)); |
210 | if (data->brdgCtl) | 210 | if (data->brdgCtl) |
211 | pr_info("brdgCtl: %08x\n", | 211 | pr_info("brdgCtl: %08x\n", |
212 | data->brdgCtl); | 212 | be32_to_cpu(data->brdgCtl)); |
213 | if (data->portStatusReg || data->rootCmplxStatus || | 213 | if (data->portStatusReg || data->rootCmplxStatus || |
214 | data->busAgentStatus) | 214 | data->busAgentStatus) |
215 | pr_info("UtlSts: %08x %08x %08x\n", | 215 | pr_info("UtlSts: %08x %08x %08x\n", |
216 | data->portStatusReg, data->rootCmplxStatus, | 216 | be32_to_cpu(data->portStatusReg), |
217 | data->busAgentStatus); | 217 | be32_to_cpu(data->rootCmplxStatus), |
218 | be32_to_cpu(data->busAgentStatus)); | ||
218 | if (data->deviceStatus || data->slotStatus || | 219 | if (data->deviceStatus || data->slotStatus || |
219 | data->linkStatus || data->devCmdStatus || | 220 | data->linkStatus || data->devCmdStatus || |
220 | data->devSecStatus) | 221 | data->devSecStatus) |
221 | pr_info("RootSts: %08x %08x %08x %08x %08x\n", | 222 | pr_info("RootSts: %08x %08x %08x %08x %08x\n", |
222 | data->deviceStatus, data->slotStatus, | 223 | be32_to_cpu(data->deviceStatus), |
223 | data->linkStatus, data->devCmdStatus, | 224 | be32_to_cpu(data->slotStatus), |
224 | data->devSecStatus); | 225 | be32_to_cpu(data->linkStatus), |
226 | be32_to_cpu(data->devCmdStatus), | ||
227 | be32_to_cpu(data->devSecStatus)); | ||
225 | if (data->rootErrorStatus || data->uncorrErrorStatus || | 228 | if (data->rootErrorStatus || data->uncorrErrorStatus || |
226 | data->corrErrorStatus) | 229 | data->corrErrorStatus) |
227 | pr_info("RootErrSts: %08x %08x %08x\n", | 230 | pr_info("RootErrSts: %08x %08x %08x\n", |
228 | data->rootErrorStatus, data->uncorrErrorStatus, | 231 | be32_to_cpu(data->rootErrorStatus), |
229 | data->corrErrorStatus); | 232 | be32_to_cpu(data->uncorrErrorStatus), |
233 | be32_to_cpu(data->corrErrorStatus)); | ||
230 | if (data->tlpHdr1 || data->tlpHdr2 || | 234 | if (data->tlpHdr1 || data->tlpHdr2 || |
231 | data->tlpHdr3 || data->tlpHdr4) | 235 | data->tlpHdr3 || data->tlpHdr4) |
232 | pr_info("RootErrLog: %08x %08x %08x %08x\n", | 236 | pr_info("RootErrLog: %08x %08x %08x %08x\n", |
233 | data->tlpHdr1, data->tlpHdr2, | 237 | be32_to_cpu(data->tlpHdr1), |
234 | data->tlpHdr3, data->tlpHdr4); | 238 | be32_to_cpu(data->tlpHdr2), |
239 | be32_to_cpu(data->tlpHdr3), | ||
240 | be32_to_cpu(data->tlpHdr4)); | ||
235 | if (data->sourceId || data->errorClass || | 241 | if (data->sourceId || data->errorClass || |
236 | data->correlator) | 242 | data->correlator) |
237 | pr_info("RootErrLog1: %08x %016llx %016llx\n", | 243 | pr_info("RootErrLog1: %08x %016llx %016llx\n", |
238 | data->sourceId, data->errorClass, | 244 | be32_to_cpu(data->sourceId), |
239 | data->correlator); | 245 | be64_to_cpu(data->errorClass), |
246 | be64_to_cpu(data->correlator)); | ||
240 | if (data->nFir) | 247 | if (data->nFir) |
241 | pr_info("nFir: %016llx %016llx %016llx\n", | 248 | pr_info("nFir: %016llx %016llx %016llx\n", |
242 | data->nFir, data->nFirMask, | 249 | be64_to_cpu(data->nFir), |
243 | data->nFirWOF); | 250 | be64_to_cpu(data->nFirMask), |
251 | be64_to_cpu(data->nFirWOF)); | ||
244 | if (data->phbPlssr || data->phbCsr) | 252 | if (data->phbPlssr || data->phbCsr) |
245 | pr_info("PhbSts: %016llx %016llx\n", | 253 | pr_info("PhbSts: %016llx %016llx\n", |
246 | data->phbPlssr, data->phbCsr); | 254 | be64_to_cpu(data->phbPlssr), |
255 | be64_to_cpu(data->phbCsr)); | ||
247 | if (data->lemFir) | 256 | if (data->lemFir) |
248 | pr_info("Lem: %016llx %016llx %016llx\n", | 257 | pr_info("Lem: %016llx %016llx %016llx\n", |
249 | data->lemFir, data->lemErrorMask, | 258 | be64_to_cpu(data->lemFir), |
250 | data->lemWOF); | 259 | be64_to_cpu(data->lemErrorMask), |
260 | be64_to_cpu(data->lemWOF)); | ||
251 | if (data->phbErrorStatus) | 261 | if (data->phbErrorStatus) |
252 | pr_info("PhbErr: %016llx %016llx %016llx %016llx\n", | 262 | pr_info("PhbErr: %016llx %016llx %016llx %016llx\n", |
253 | data->phbErrorStatus, data->phbFirstErrorStatus, | 263 | be64_to_cpu(data->phbErrorStatus), |
254 | data->phbErrorLog0, data->phbErrorLog1); | 264 | be64_to_cpu(data->phbFirstErrorStatus), |
265 | be64_to_cpu(data->phbErrorLog0), | ||
266 | be64_to_cpu(data->phbErrorLog1)); | ||
255 | if (data->mmioErrorStatus) | 267 | if (data->mmioErrorStatus) |
256 | pr_info("OutErr: %016llx %016llx %016llx %016llx\n", | 268 | pr_info("OutErr: %016llx %016llx %016llx %016llx\n", |
257 | data->mmioErrorStatus, data->mmioFirstErrorStatus, | 269 | be64_to_cpu(data->mmioErrorStatus), |
258 | data->mmioErrorLog0, data->mmioErrorLog1); | 270 | be64_to_cpu(data->mmioFirstErrorStatus), |
271 | be64_to_cpu(data->mmioErrorLog0), | ||
272 | be64_to_cpu(data->mmioErrorLog1)); | ||
259 | if (data->dma0ErrorStatus) | 273 | if (data->dma0ErrorStatus) |
260 | pr_info("InAErr: %016llx %016llx %016llx %016llx\n", | 274 | pr_info("InAErr: %016llx %016llx %016llx %016llx\n", |
261 | data->dma0ErrorStatus, data->dma0FirstErrorStatus, | 275 | be64_to_cpu(data->dma0ErrorStatus), |
262 | data->dma0ErrorLog0, data->dma0ErrorLog1); | 276 | be64_to_cpu(data->dma0FirstErrorStatus), |
277 | be64_to_cpu(data->dma0ErrorLog0), | ||
278 | be64_to_cpu(data->dma0ErrorLog1)); | ||
263 | if (data->dma1ErrorStatus) | 279 | if (data->dma1ErrorStatus) |
264 | pr_info("InBErr: %016llx %016llx %016llx %016llx\n", | 280 | pr_info("InBErr: %016llx %016llx %016llx %016llx\n", |
265 | data->dma1ErrorStatus, data->dma1FirstErrorStatus, | 281 | be64_to_cpu(data->dma1ErrorStatus), |
266 | data->dma1ErrorLog0, data->dma1ErrorLog1); | 282 | be64_to_cpu(data->dma1FirstErrorStatus), |
283 | be64_to_cpu(data->dma1ErrorLog0), | ||
284 | be64_to_cpu(data->dma1ErrorLog1)); | ||
267 | 285 | ||
268 | for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) { | 286 | for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) { |
269 | if ((data->pestA[i] >> 63) == 0 && | 287 | if ((be64_to_cpu(data->pestA[i]) >> 63) == 0 && |
270 | (data->pestB[i] >> 63) == 0) | 288 | (be64_to_cpu(data->pestB[i]) >> 63) == 0) |
271 | continue; | 289 | continue; |
272 | 290 | ||
273 | pr_info("PE[%3d] A/B: %016llx %016llx\n", | 291 | pr_info("PE[%3d] A/B: %016llx %016llx\n", |
274 | i, data->pestA[i], data->pestB[i]); | 292 | i, be64_to_cpu(data->pestA[i]), |
293 | be64_to_cpu(data->pestB[i])); | ||
275 | } | 294 | } |
276 | } | 295 | } |
277 | 296 | ||
@@ -284,7 +303,7 @@ void pnv_pci_dump_phb_diag_data(struct pci_controller *hose, | |||
284 | return; | 303 | return; |
285 | 304 | ||
286 | common = (struct OpalIoPhbErrorCommon *)log_buff; | 305 | common = (struct OpalIoPhbErrorCommon *)log_buff; |
287 | switch (common->ioType) { | 306 | switch (be32_to_cpu(common->ioType)) { |
288 | case OPAL_PHB_ERROR_DATA_TYPE_P7IOC: | 307 | case OPAL_PHB_ERROR_DATA_TYPE_P7IOC: |
289 | pnv_pci_dump_p7ioc_diag_data(hose, common); | 308 | pnv_pci_dump_p7ioc_diag_data(hose, common); |
290 | break; | 309 | break; |
@@ -293,7 +312,7 @@ void pnv_pci_dump_phb_diag_data(struct pci_controller *hose, | |||
293 | break; | 312 | break; |
294 | default: | 313 | default: |
295 | pr_warn("%s: Unrecognized ioType %d\n", | 314 | pr_warn("%s: Unrecognized ioType %d\n", |
296 | __func__, common->ioType); | 315 | __func__, be32_to_cpu(common->ioType)); |
297 | } | 316 | } |
298 | } | 317 | } |
299 | 318 | ||