From: Roland Dreier <rdreier@cisco.com>
To: mporter@kernel.crashing.org
Cc: linuxppc-embedded@ozlabs.org
Subject: [POWERPC] Fix config space address for 440SPe PCIeport 2
Date: Thu, 07 Dec 2006 15:47:28 -0800 [thread overview]
Message-ID: <adazm9z8e0f.fsf@cisco.com> (raw)
The PCI Express code for PowerPC 440SPe sets up windows for memory
mapped config space access starting with port 0 at 0xc40000000, with
port 1 offset at 0x40000000 and port 2 offset at 0x80000000. However,
ppc440spe_setup_pcie() calculates the offset as port * 0x40000000,
which doesn't work for port 2, since port is signed and the result is
big enough to be treated as negative. Fix this by using the unsigned
constant 0x40000000u instead.
Bug originally found by Ruslan V. Sushko <rsushko@ru.mvista.com>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
I'm still working on cleaning up my Rev B 440SPe changes, but this bug
kills PCIe port 2 on rev A silicon so I want to send this in now.
diff --git a/arch/ppc/syslib/ppc440spe_pcie.c b/arch/ppc/syslib/ppc440spe_pcie.c
index dd5d4b9..a116325 100644
--- a/arch/ppc/syslib/ppc440spe_pcie.c
+++ b/arch/ppc/syslib/ppc440spe_pcie.c
@@ -378,14 +378,14 @@ void ppc440spe_setup_pcie(struct pci_controller *hose, int port)
/*
* Map 16MB, which is enough for 4 bits of bus #
*/
- hose->cfg_data = ioremap64(0xc40000000ull + port * 0x40000000,
+ hose->cfg_data = ioremap64(0xc40000000ull + port * 0x40000000u,
1 << 24);
hose->ops = &pcie_pci_ops;
/*
* Set bus numbers on our root port
*/
- mbase = ioremap64(0xc50000000ull + port * 0x40000000, 4096);
+ mbase = ioremap64(0xc50000000ull + port * 0x40000000u, 4096);
out_8(mbase + PCI_PRIMARY_BUS, 0);
out_8(mbase + PCI_SECONDARY_BUS, 0);
reply other threads:[~2006-12-07 23:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=adazm9z8e0f.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=linuxppc-embedded@ozlabs.org \
--cc=mporter@kernel.crashing.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.