linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: benh@kernel.crashing.org, paulus@samba.org, Ulrich.Weigand@de.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 6/8] powerpc/pseries: Fix PCIE link speed endian issue
Date: Thu, 12 Dec 2013 15:59:39 +1100	[thread overview]
Message-ID: <1386824381-14032-7-git-send-email-anton@samba.org> (raw)
In-Reply-To: <1386824381-14032-1-git-send-email-anton@samba.org>

We need to byteswap ibm,pcie-link-speed-stats.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/platforms/pseries/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index 5f93856..70670a2 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -113,7 +113,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
 {
 	struct device_node *dn, *pdn;
 	struct pci_bus *bus;
-	const uint32_t *pcie_link_speed_stats;
+	const __be32 *pcie_link_speed_stats;
 
 	bus = bridge->bus;
 
@@ -122,7 +122,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
 		return 0;
 
 	for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) {
-		pcie_link_speed_stats = (const uint32_t *) of_get_property(pdn,
+		pcie_link_speed_stats = of_get_property(pdn,
 			"ibm,pcie-link-speed-stats", NULL);
 		if (pcie_link_speed_stats)
 			break;
@@ -135,7 +135,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
 		return 0;
 	}
 
-	switch (pcie_link_speed_stats[0]) {
+	switch (be32_to_cpup(pcie_link_speed_stats)) {
 	case 0x01:
 		bus->max_bus_speed = PCIE_SPEED_2_5GT;
 		break;
@@ -147,7 +147,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
 		break;
 	}
 
-	switch (pcie_link_speed_stats[1]) {
+	switch (be32_to_cpup(pcie_link_speed_stats)) {
 	case 0x01:
 		bus->cur_bus_speed = PCIE_SPEED_2_5GT;
 		break;
-- 
1.8.3.2

  parent reply	other threads:[~2013-12-12  4:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12  4:59 [PATCH 0/8] ppc64 little endian bug fixes Anton Blanchard
2013-12-12  4:59 ` [PATCH 1/8] powerpc: PTRACE_PEEKUSR always returns FPR0 Anton Blanchard
2013-12-12  4:59 ` [PATCH 2/8] powerpc: Fix endian issue in setup-common.c Anton Blanchard
2013-12-12  4:59 ` [PATCH 3/8] powerpc: Fix topology core_id endian issue on LE builds Anton Blanchard
2013-12-12  4:59 ` [PATCH 4/8] powerpc/pseries: Fix endian issues in /proc/ppc64/lparcfg Anton Blanchard
2013-12-12  4:59 ` [PATCH 5/8] powerpc/pseries: Fix endian issues in nvram code Anton Blanchard
2013-12-12  4:59 ` Anton Blanchard [this message]
2013-12-12  4:59 ` [PATCH 7/8] powerpc/pseries: Fix endian issues in MSI code Anton Blanchard
2013-12-12  4:59 ` [PATCH 8/8] powerpc: Fix endian issues in crash dump code Anton Blanchard
2013-12-18  4:45   ` Michael Ellerman
2014-01-22 10:42     ` 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=1386824381-14032-7-git-send-email-anton@samba.org \
    --to=anton@samba.org \
    --cc=Ulrich.Weigand@de.ibm.com \
    --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).