linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 32/39] powerpc/powernv: Fix some PCI sparse errors and one LE bug
Date: Mon, 23 Sep 2013 12:05:06 +1000	[thread overview]
Message-ID: <1379901913-5945-33-git-send-email-anton@samba.org> (raw)
In-Reply-To: <1379901913-5945-1-git-send-email-anton@samba.org>

pnv_pci_setup_bml_iommu was missing a byteswap of a device
tree property.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/include/asm/opal.h           | 22 +++++++++++-----------
 arch/powerpc/platforms/powernv/opal.c     |  2 +-
 arch/powerpc/platforms/powernv/pci-ioda.c |  6 +++---
 arch/powerpc/platforms/powernv/pci.c      |  6 +++---
 arch/powerpc/platforms/powernv/pci.h      |  2 +-
 5 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 3db5e82..51e3b26 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -551,7 +551,7 @@ int64_t opal_cec_power_down(uint64_t request);
 int64_t opal_cec_reboot(void);
 int64_t opal_read_nvram(uint64_t buffer, uint64_t size, uint64_t offset);
 int64_t opal_write_nvram(uint64_t buffer, uint64_t size, uint64_t offset);
-int64_t opal_handle_interrupt(uint64_t isn, uint64_t *outstanding_event_mask);
+int64_t opal_handle_interrupt(uint64_t isn, __be64 *outstanding_event_mask);
 int64_t opal_poll_events(__be64 *outstanding_event_mask);
 int64_t opal_pci_set_hub_tce_memory(uint64_t hub_id, uint64_t tce_mem_addr,
 				    uint64_t tce_mem_size);
@@ -560,9 +560,9 @@ int64_t opal_pci_set_phb_tce_memory(uint64_t phb_id, uint64_t tce_mem_addr,
 int64_t opal_pci_config_read_byte(uint64_t phb_id, uint64_t bus_dev_func,
 				  uint64_t offset, uint8_t *data);
 int64_t opal_pci_config_read_half_word(uint64_t phb_id, uint64_t bus_dev_func,
-				       uint64_t offset, uint16_t *data);
+				       uint64_t offset, __be16 *data);
 int64_t opal_pci_config_read_word(uint64_t phb_id, uint64_t bus_dev_func,
-				  uint64_t offset, uint32_t *data);
+				  uint64_t offset, __be32 *data);
 int64_t opal_pci_config_write_byte(uint64_t phb_id, uint64_t bus_dev_func,
 				   uint64_t offset, uint8_t data);
 int64_t opal_pci_config_write_half_word(uint64_t phb_id, uint64_t bus_dev_func,
@@ -570,14 +570,14 @@ int64_t opal_pci_config_write_half_word(uint64_t phb_id, uint64_t bus_dev_func,
 int64_t opal_pci_config_write_word(uint64_t phb_id, uint64_t bus_dev_func,
 				   uint64_t offset, uint32_t data);
 int64_t opal_set_xive(uint32_t isn, uint16_t server, uint8_t priority);
-int64_t opal_get_xive(uint32_t isn, uint16_t *server, uint8_t *priority);
+int64_t opal_get_xive(uint32_t isn, __be16 *server, uint8_t *priority);
 int64_t opal_register_exception_handler(uint64_t opal_exception,
 					uint64_t handler_address,
 					uint64_t glue_cache_line);
 int64_t opal_pci_eeh_freeze_status(uint64_t phb_id, uint64_t pe_number,
 				   uint8_t *freeze_state,
-				   uint16_t *pci_error_type,
-				   uint64_t *phb_status);
+				   __be16 *pci_error_type,
+				   __be64 *phb_status);
 int64_t opal_pci_eeh_freeze_clear(uint64_t phb_id, uint64_t pe_number,
 				  uint64_t eeh_action_token);
 int64_t opal_pci_shpc(uint64_t phb_id, uint64_t shpc_action, uint8_t *state);
@@ -614,13 +614,13 @@ int64_t opal_pci_msi_eoi(uint64_t phb_id, uint32_t hw_irq);
 int64_t opal_pci_set_xive_pe(uint64_t phb_id, uint32_t pe_number,
 			     uint32_t xive_num);
 int64_t opal_get_xive_source(uint64_t phb_id, uint32_t xive_num,
-			     int32_t *interrupt_source_number);
+			     __be32 *interrupt_source_number);
 int64_t opal_get_msi_32(uint64_t phb_id, uint32_t mve_number, uint32_t xive_num,
-			uint8_t msi_range, uint32_t *msi_address,
-			uint32_t *message_data);
+			uint8_t msi_range, __be32 *msi_address,
+			__be32 *message_data);
 int64_t opal_get_msi_64(uint64_t phb_id, uint32_t mve_number,
 			uint32_t xive_num, uint8_t msi_range,
-			uint64_t *msi_address, uint32_t *message_data);
+			__be64 *msi_address, __be32 *message_data);
 int64_t opal_start_cpu(uint64_t thread_number, uint64_t start_address);
 int64_t opal_query_cpu_status(uint64_t thread_number, uint8_t *thread_status);
 int64_t opal_write_oppanel(oppanel_line_t *lines, uint64_t num_lines);
@@ -642,7 +642,7 @@ int64_t opal_pci_fence_phb(uint64_t phb_id);
 int64_t opal_pci_reinit(uint64_t phb_id, uint8_t reinit_scope);
 int64_t opal_pci_mask_pe_error(uint64_t phb_id, uint16_t pe_number, uint8_t error_type, uint8_t mask_action);
 int64_t opal_set_slot_led_status(uint64_t phb_id, uint64_t slot_id, uint8_t led_type, uint8_t led_action);
-int64_t opal_get_epow_status(uint64_t *status);
+int64_t opal_get_epow_status(__be64 *status);
 int64_t opal_set_system_attention_led(uint8_t led_action);
 int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe,
 			    uint16_t *pci_error_type, uint16_t *severity);
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index c2391bb..09336f0 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -366,7 +366,7 @@ int opal_machine_check(struct pt_regs *regs)
 
 static irqreturn_t opal_interrupt(int irq, void *data)
 {
-	uint64_t events;
+	__be64 events;
 
 	opal_handle_interrupt(virq_to_hw(irq), &events);
 
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index f9cb6c5..a6531d2 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -455,7 +455,7 @@ static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus)
 }
 
 static void pnv_pci_ioda1_tce_invalidate(struct iommu_table *tbl,
-					 u64 *startp, u64 *endp)
+					 __be64 *startp, __be64 *endp)
 {
 	__be64 __iomem *invalidate = (__be64 __iomem *)tbl->it_index;
 	unsigned long start, end, inc;
@@ -496,7 +496,7 @@ static void pnv_pci_ioda1_tce_invalidate(struct iommu_table *tbl,
 
 static void pnv_pci_ioda2_tce_invalidate(struct pnv_ioda_pe *pe,
 					 struct iommu_table *tbl,
-					 u64 *startp, u64 *endp)
+					 __be64 *startp, __be64 *endp)
 {
 	unsigned long start, end, inc;
 	__be64 __iomem *invalidate = (__be64 __iomem *)tbl->it_index;
@@ -521,7 +521,7 @@ static void pnv_pci_ioda2_tce_invalidate(struct pnv_ioda_pe *pe,
 }
 
 void pnv_pci_ioda_tce_invalidate(struct iommu_table *tbl,
-				 u64 *startp, u64 *endp)
+				 __be64 *startp, __be64 *endp)
 {
 	struct pnv_ioda_pe *pe = container_of(tbl, struct pnv_ioda_pe,
 					      tce32_table);
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 2f73e0d..a26956c 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -412,7 +412,7 @@ static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
 	if (direction != DMA_TO_DEVICE)
 		proto_tce |= TCE_PCI_WRITE;
 
-	tces = tcep = ((u64 *)tbl->it_base) + index - tbl->it_offset;
+	tces = tcep = ((__be64 *)tbl->it_base) + index - tbl->it_offset;
 	rpn = __pa(uaddr) >> TCE_SHIFT;
 
 	while (npages--)
@@ -432,7 +432,7 @@ static void pnv_tce_free(struct iommu_table *tbl, long index, long npages)
 {
 	__be64 *tcep, *tces;
 
-	tces = tcep = ((u64 *)tbl->it_base) + index - tbl->it_offset;
+	tces = tcep = ((__be64 *)tbl->it_base) + index - tbl->it_offset;
 
 	while (npages--)
 		*(tcep++) = cpu_to_be64(0);
@@ -484,7 +484,7 @@ static struct iommu_table *pnv_pci_setup_bml_iommu(struct pci_controller *hose)
 	swinvp = of_get_property(hose->dn, "linux,tce-sw-invalidate-info",
 				 NULL);
 	if (swinvp) {
-		tbl->it_busno = swinvp[1];
+		tbl->it_busno = be64_to_cpu(swinvp[1]);
 		tbl->it_index = (unsigned long)ioremap(be64_to_cpup(swinvp), 8);
 		tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
 	}
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index d633c64..dfe2010 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -193,6 +193,6 @@ extern void pnv_pci_init_p5ioc2_hub(struct device_node *np);
 extern void pnv_pci_init_ioda_hub(struct device_node *np);
 extern void pnv_pci_init_ioda2_phb(struct device_node *np);
 extern void pnv_pci_ioda_tce_invalidate(struct iommu_table *tbl,
-					u64 *startp, u64 *endp);
+					__be64 *startp, __be64 *endp);
 
 #endif /* __POWERNV_PCI_H */
-- 
1.8.1.2

  parent reply	other threads:[~2013-09-23  2:05 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23  2:04 [PATCH 00/39] Second round of 64bit PowerPC little endian patches Anton Blanchard
2013-09-23  2:04 ` [PATCH 01/39] powerpc: Fix endian issues in VMX copy loops Anton Blanchard
2013-09-23  2:04 ` [PATCH 02/39] powerpc: Book 3S MMU little endian support Anton Blanchard
2013-09-23  2:04 ` [PATCH 03/39] powerpc: Fix offset of FPRs in VSX registers in little endian builds Anton Blanchard
2013-09-23  2:04 ` [PATCH 04/39] powerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR " Anton Blanchard
2013-09-23  2:04 ` [PATCH 05/39] powerpc: Little endian builds double word swap VSX state during context save/restore Anton Blanchard
2013-09-23  2:04 ` [PATCH 06/39] powerpc: Support endian agnostic MMIO Anton Blanchard
2013-09-23  2:04 ` [PATCH 07/39] powerpc: Add little endian support for word-at-a-time functions Anton Blanchard
2013-09-23  2:04 ` [PATCH 08/39] powerpc: Set MSR_LE bit on little endian builds Anton Blanchard
2013-09-23  2:04 ` [PATCH 09/39] powerpc: Reset MSR_LE on signal entry Anton Blanchard
2013-09-23  2:04 ` [PATCH 10/39] powerpc: Include the appropriate endianness header Anton Blanchard
2013-09-23  2:04 ` [PATCH 11/39] powerpc: endian safe trampoline Anton Blanchard
2013-12-28  7:24   ` Olof Johansson
2013-12-28  7:58     ` Benjamin Herrenschmidt
2013-09-23  2:04 ` [PATCH 12/39] powerpc: Remove open coded byte swap macro in alignment handler Anton Blanchard
2013-09-23  2:04 ` [PATCH 13/39] powerpc: Remove hard coded FP offsets " Anton Blanchard
2013-09-23  2:04 ` [PATCH 14/39] powerpc: Alignment handler shouldn't access VSX registers with TS_FPR Anton Blanchard
2013-09-23  2:04 ` [PATCH 15/39] powerpc: Add little endian support to alignment handler Anton Blanchard
2013-09-23  2:04 ` [PATCH 16/39] powerpc: Handle VSX alignment faults in little endian mode Anton Blanchard
2013-09-23  2:04 ` [PATCH 17/39] powerpc: Use generic checksum code in little endian Anton Blanchard
2013-09-23  2:04 ` [PATCH 18/39] powerpc: Use generic memcpy " Anton Blanchard
2013-09-23  2:04 ` [PATCH 19/39] powerpc: uname should return ppc64le/ppcle on little endian builds Anton Blanchard
2013-09-23  2:04 ` [PATCH 20/39] powerpc: Little endian fixes for platforms/powernv/opal.c Anton Blanchard
2013-09-23  2:04 ` [PATCH 21/39] powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci.c Anton Blanchard
2013-09-23  2:04 ` [PATCH 22/39] powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci-p5ioc2.c Anton Blanchard
2013-09-23  2:04 ` [PATCH 23/39] powerpc: Little endian sparse clean up for arch/powerpc/platforms/powernv/pci-ioda.c Anton Blanchard
2013-09-23  2:04 ` [PATCH 24/39] powerpc/powernv: Fix endian issues in OPAL RTC driver Anton Blanchard
2013-09-23  2:04 ` [PATCH 25/39] powerpc/powernv: Fix endian issues in OPAL ICS backend Anton Blanchard
2013-09-23  2:05 ` [PATCH 26/39] powerpc/powernv: Make OPAL NVRAM device tree accesses endian safe Anton Blanchard
2013-09-23  2:05 ` [PATCH 27/39] powerpc/powernv: Fix endian issues in powernv PCI code Anton Blanchard
2013-09-23  2:05 ` [PATCH 28/39] powerpc/powernv: Fix endian issues in OPAL console and udbg backend Anton Blanchard
2013-09-23  2:05 ` [PATCH 29/39] powerpc/powernv: Fix OPAL entry and exit in little endian mode Anton Blanchard
2013-09-23  2:05 ` [PATCH 30/39] powerpc/powernv: Don't register exception handlers " Anton Blanchard
2013-09-23  2:05 ` [PATCH 31/39] powerpc/powernv: More little endian issues in OPAL RTC driver Anton Blanchard
2013-09-23  2:05 ` Anton Blanchard [this message]
2013-09-23  2:05 ` [PATCH 33/39] powerpc/hvsi: Fix endian issues in HVSI driver Anton Blanchard
2013-09-23  2:05 ` [PATCH 34/39] tty/hvc_opal: powerpc: Make OPAL HVC device tree accesses endian safe Anton Blanchard
2013-09-23  2:05 ` [PATCH 35/39] KVM: PPC: Disable KVM on little endian builds Anton Blanchard
2013-09-23  2:05 ` [PATCH 36/39] powerpc/kvm/book3s_hv: Add little endian guest support Anton Blanchard
2013-09-25 12:10   ` [PATCH] powerpc/kvmbook3s_hv: propagate H_SET_MODE to the host Laurent Dufour
2013-09-25 12:27     ` Greg Kurz
2013-09-25 22:31     ` Paul Mackerras
2013-09-27  8:14       ` Laurent Dufour
2013-09-27 13:59       ` [PATCH V2] powerpc/kvm/book3s_hv: propagate H_SET_MODE_RESOURCE_LE " Laurent Dufour
2013-09-27 14:45         ` Greg Kurz
2013-09-30 18:40   ` [PATCH 36/39] powerpc/kvm/book3s_hv: Add little endian guest support Alexander Graf
2013-09-23  2:05 ` [PATCH 37/39] powerpc: Add ability to build little endian kernels Anton Blanchard
2013-09-23  2:05 ` [PATCH 38/39] powerpc: Don't set HAVE_EFFICIENT_UNALIGNED_ACCESS on little endian builds Anton Blanchard
2013-09-23  2:05 ` [PATCH 39/39] powerpc: Work around little endian gcc bug Anton Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379901913-5945-33-git-send-email-anton@samba.org \
    --to=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).