From: Jia Hongtao <B38951@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>, <galak@kernel.crashing.org>
Cc: B07421@freescale.com, b38951@freescale.com
Subject: [PATCH V5 1/3] powerpc/fsl-pci: Only scan PCI bus if configured as a host
Date: Fri, 3 Aug 2012 18:14:09 +0800 [thread overview]
Message-ID: <1343988851-884-2-git-send-email-B38951@freescale.com> (raw)
In-Reply-To: <1343988851-884-1-git-send-email-B38951@freescale.com>
We change fsl_add_bridge to return -ENODEV if the controller is working in
agent mode. Then check the return value of fsl_add_bridge to guarantee
that only successfully added host bus will be scanned.
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
arch/powerpc/sysdev/fsl_pci.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 50a38b3..6938792 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -465,7 +465,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
iounmap(hose->cfg_data);
iounmap(hose->cfg_addr);
pcibios_free_controller(hose);
- return 0;
+ return -ENODEV;
}
setup_pci_cmd(hose);
@@ -828,6 +828,7 @@ struct device_node *fsl_pci_primary;
void __devinit fsl_pci_init(void)
{
+ int ret;
struct device_node *node;
struct pci_controller *hose;
dma_addr_t max = 0xffffffff;
@@ -856,10 +857,12 @@ void __devinit fsl_pci_init(void)
if (!fsl_pci_primary)
fsl_pci_primary = node;
- fsl_add_bridge(node, fsl_pci_primary == node);
- hose = pci_find_hose_for_OF_device(node);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
+ ret = fsl_add_bridge(node, fsl_pci_primary == node);
+ if (ret == 0) {
+ hose = pci_find_hose_for_OF_device(node);
+ max = min(max, hose->dma_window_base_cur +
+ hose->dma_window_size);
+ }
}
}
--
1.7.5.1
next prev parent reply other threads:[~2012-08-03 10:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 10:14 [PATCH V5 0/3] PCI patch set description Jia Hongtao
2012-08-03 10:14 ` Jia Hongtao [this message]
2012-08-03 13:57 ` [PATCH V5 1/3] powerpc/fsl-pci: Only scan PCI bus if configured as a host Kumar Gala
2012-08-03 10:14 ` [PATCH V5 2/3] powerpc/swiotlb: Enable at early stage and disable if not necessary Jia Hongtao
2012-08-08 19:03 ` Kumar Gala
2012-08-09 5:57 ` Tony Breeds
2012-08-10 12:58 ` Kumar Gala
2012-08-03 10:14 ` [PATCH V5 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code Jia Hongtao
2012-08-03 16:27 ` Scott Wood
2012-08-06 3:07 ` Jia Hongtao-B38951
2012-08-06 15:09 ` Scott Wood
2012-08-07 4:20 ` Li Yang
2012-08-07 15:24 ` Scott Wood
2012-08-08 9:03 ` Jia Hongtao-B38951
2012-08-08 15:58 ` Scott Wood
2012-08-08 19:04 ` Gala Kumar-B11780
2012-08-10 8:47 ` Jia Hongtao-B38951
2012-08-10 16:00 ` Scott Wood
2012-08-15 9:22 ` Jia Hongtao-B38951
2012-08-15 17:45 ` Scott Wood
2012-08-09 3:48 ` Jia Hongtao-B38951
2012-08-09 17:00 ` Scott Wood
2012-08-07 8:09 ` Jia Hongtao-B38951
2012-08-07 15:28 ` Scott Wood
2012-08-08 9:39 ` Jia Hongtao-B38951
2012-08-08 16:02 ` Scott Wood
2012-08-09 3:48 ` Jia Hongtao-B38951
2012-08-09 22:20 ` Scott Wood
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=1343988851-884-2-git-send-email-B38951@freescale.com \
--to=b38951@freescale.com \
--cc=B07421@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.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).