From: Scott Wood <scottwood@freescale.com>
To: Jia Hongtao <B38951@freescale.com>
Cc: B07421@freescale.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH V5 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code
Date: Fri, 3 Aug 2012 11:27:58 -0500 [thread overview]
Message-ID: <501BFC0E.6070708@freescale.com> (raw)
In-Reply-To: <1343988851-884-4-git-send-email-B38951@freescale.com>
On 08/03/2012 05:14 AM, Jia Hongtao wrote:
> -void __devinit fsl_pci_init(void)
> +/* Checkout if PCI contains ISA node */
> +static int of_pci_has_isa(struct device_node *pci_node)
> +{
> + struct device_node *np;
> + int ret = 0;
> +
> + if (!pci_node)
> + return 0;
> +
> + read_lock(&devtree_lock);
> + np = pci_node->allnext;
> +
> + /* Only scan the children of PCI node */
> + for (; np != pci_node->sibling; np = np->allnext) {
> + if (np->type && (of_node_cmp(np->type, "isa") == 0)
> + && of_node_get(np)) {
> + ret = 1;
> + break;
> + }
> + }
> +
> + of_node_put(pci_node);
> + read_unlock(&devtree_lock);
> +
> + return ret;
> +}
Why do you keep insisting on substituting your ISA search code here?
What advantages does it have over the code that is already there? It
unnecessarily digs into the internals of the tree representation.
> +
> +static int __devinit fsl_pci_probe(struct platform_device *pdev)
> {
> int ret;
> - struct device_node *node;
> struct pci_controller *hose;
> - dma_addr_t max = 0xffffffff;
> + int is_primary = 0;
>
> - /* Callers can specify the primary bus using other means. */
> if (!fsl_pci_primary) {
> - /* If a PCI host bridge contains an ISA node, it's primary. */
> - node = of_find_node_by_type(NULL, "isa");
> - while ((fsl_pci_primary = of_get_parent(node))) {
> - of_node_put(node);
> - node = fsl_pci_primary;
> -
> - if (of_match_node(pci_ids, node))
> - break;
> - }
> + is_primary = of_pci_has_isa(pdev->dev.of_node);
> + if (is_primary)
> + fsl_pci_primary = pdev->dev.of_node;
> }
As I explained before, this has to be done globally, not from the probe
function, so we can assign a default primary bus if there isn't any ISA.
There are bugs in the Linux PPC PCI code relating to not having any
primary bus.
-Scott
next prev parent reply other threads:[~2012-08-03 16:28 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 ` [PATCH V5 1/3] powerpc/fsl-pci: Only scan PCI bus if configured as a host Jia Hongtao
2012-08-03 13:57 ` 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 [this message]
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=501BFC0E.6070708@freescale.com \
--to=scottwood@freescale.com \
--cc=B07421@freescale.com \
--cc=B38951@freescale.com \
--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).