* [PATCH] fix the problem where pcix node is probed again as pci node.
@ 2010-03-30 17:41 Feng Kan
2010-03-30 20:48 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Feng Kan @ 2010-03-30 17:41 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Feng Kan, Tirumala R Marri
From: Feng Kan <fkan@appliedmicro.com>
The current matching scheme make the pci node match to pcix or pciex node.
To avoid the match, change the method so only one type of initialization
is called per node.
Signed-off-by: Feng Kan <fkan@appliedmicro.com>
Signed-off-by: Tirumala R Marri <tmarri@appliedmicro.com>
---
arch/powerpc/sysdev/ppc4xx_pci.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 8aa3302..1e67c74 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges(void)
ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
+ for_each_compatible_node(np, NULL, "ibm,plb-pci") {
+ if (of_device_is_compatible(np, "ibm,plb-pcix"))
+ ppc4xx_probe_pcix_bridge(np);
#ifdef CONFIG_PPC4xx_PCI_EXPRESS
- for_each_compatible_node(np, NULL, "ibm,plb-pciex")
- ppc4xx_probe_pciex_bridge(np);
+ else if (of_device_is_compatible(np, "ibm,plb-pciex"))
+ ppc4xx_probe_pciex_bridge(np);
#endif
- for_each_compatible_node(np, NULL, "ibm,plb-pcix")
- ppc4xx_probe_pcix_bridge(np);
- for_each_compatible_node(np, NULL, "ibm,plb-pci")
- ppc4xx_probe_pci_bridge(np);
+ else
+ ppc4xx_probe_pci_bridge(np);
+ }
return 0;
}
--
1.5.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] fix the problem where pcix node is probed again as pci node.
2010-03-30 17:41 [PATCH] fix the problem where pcix node is probed again as pci node Feng Kan
@ 2010-03-30 20:48 ` Benjamin Herrenschmidt
2010-03-30 21:14 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2010-03-30 20:48 UTC (permalink / raw)
To: Feng Kan; +Cc: linuxppc-dev, Tirumala R Marri, Feng Kan
On Tue, 2010-03-30 at 10:41 -0700, Feng Kan wrote:
> From: Feng Kan <fkan@appliedmicro.com>
>
> The current matching scheme make the pci node match to pcix or pciex node.
> To avoid the match, change the method so only one type of initialization
> is called per node.
No, your patch is not right. The problem was introduced by a patch from
Grant that incorrectly made of_device_is_compatible do a substring
match. Grant should have fixed that now. Grant ? Is your fix upstream
yet ? If not, can you send that ASAP ?
Cheers,
Ben.
> Signed-off-by: Feng Kan <fkan@appliedmicro.com>
> Signed-off-by: Tirumala R Marri <tmarri@appliedmicro.com>
> ---
> arch/powerpc/sysdev/ppc4xx_pci.c | 14 ++++++++------
> 1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
> index 8aa3302..1e67c74 100644
> --- a/arch/powerpc/sysdev/ppc4xx_pci.c
> +++ b/arch/powerpc/sysdev/ppc4xx_pci.c
> @@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges(void)
>
> ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
>
> + for_each_compatible_node(np, NULL, "ibm,plb-pci") {
> + if (of_device_is_compatible(np, "ibm,plb-pcix"))
> + ppc4xx_probe_pcix_bridge(np);
> #ifdef CONFIG_PPC4xx_PCI_EXPRESS
> - for_each_compatible_node(np, NULL, "ibm,plb-pciex")
> - ppc4xx_probe_pciex_bridge(np);
> + else if (of_device_is_compatible(np, "ibm,plb-pciex"))
> + ppc4xx_probe_pciex_bridge(np);
> #endif
> - for_each_compatible_node(np, NULL, "ibm,plb-pcix")
> - ppc4xx_probe_pcix_bridge(np);
> - for_each_compatible_node(np, NULL, "ibm,plb-pci")
> - ppc4xx_probe_pci_bridge(np);
> + else
> + ppc4xx_probe_pci_bridge(np);
> + }
>
> return 0;
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix the problem where pcix node is probed again as pci node.
2010-03-30 20:48 ` Benjamin Herrenschmidt
@ 2010-03-30 21:14 ` Benjamin Herrenschmidt
2010-03-30 22:02 ` Feng Kan
2010-03-30 22:28 ` Grant Likely
0 siblings, 2 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2010-03-30 21:14 UTC (permalink / raw)
To: Feng Kan; +Cc: linuxppc-dev, Tirumala R Marri, Feng Kan
On Wed, 2010-03-31 at 07:48 +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2010-03-30 at 10:41 -0700, Feng Kan wrote:
> > From: Feng Kan <fkan@appliedmicro.com>
> >
> > The current matching scheme make the pci node match to pcix or pciex node.
> > To avoid the match, change the method so only one type of initialization
> > is called per node.
>
> No, your patch is not right. The problem was introduced by a patch from
> Grant that incorrectly made of_device_is_compatible do a substring
> match. Grant should have fixed that now. Grant ? Is your fix upstream
> yet ? If not, can you send that ASAP ?
Better if I CC him too :-)
Cheers,
Ben.
> Cheers,
> Ben.
>
>
> > Signed-off-by: Feng Kan <fkan@appliedmicro.com>
> > Signed-off-by: Tirumala R Marri <tmarri@appliedmicro.com>
> > ---
> > arch/powerpc/sysdev/ppc4xx_pci.c | 14 ++++++++------
> > 1 files changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
> > index 8aa3302..1e67c74 100644
> > --- a/arch/powerpc/sysdev/ppc4xx_pci.c
> > +++ b/arch/powerpc/sysdev/ppc4xx_pci.c
> > @@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges(void)
> >
> > ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
> >
> > + for_each_compatible_node(np, NULL, "ibm,plb-pci") {
> > + if (of_device_is_compatible(np, "ibm,plb-pcix"))
> > + ppc4xx_probe_pcix_bridge(np);
> > #ifdef CONFIG_PPC4xx_PCI_EXPRESS
> > - for_each_compatible_node(np, NULL, "ibm,plb-pciex")
> > - ppc4xx_probe_pciex_bridge(np);
> > + else if (of_device_is_compatible(np, "ibm,plb-pciex"))
> > + ppc4xx_probe_pciex_bridge(np);
> > #endif
> > - for_each_compatible_node(np, NULL, "ibm,plb-pcix")
> > - ppc4xx_probe_pcix_bridge(np);
> > - for_each_compatible_node(np, NULL, "ibm,plb-pci")
> > - ppc4xx_probe_pci_bridge(np);
> > + else
> > + ppc4xx_probe_pci_bridge(np);
> > + }
> >
> > return 0;
> > }
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix the problem where pcix node is probed again as pci node.
2010-03-30 21:14 ` Benjamin Herrenschmidt
@ 2010-03-30 22:02 ` Feng Kan
2010-03-30 22:28 ` Benjamin Herrenschmidt
2010-03-30 22:28 ` Grant Likely
1 sibling, 1 reply; 6+ messages in thread
From: Feng Kan @ 2010-03-30 22:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Tirumala R Marri, Feng Kan
Ok thanks. This short string match may be useful in some cases, but I
agree it plays havoc with the current code.
Feng Kan
On Mar 30, 2010, at 14:14, "Benjamin Herrenschmidt" <benh@kernel.crashing.org
> wrote:
> On Wed, 2010-03-31 at 07:48 +1100, Benjamin Herrenschmidt wrote:
>> On Tue, 2010-03-30 at 10:41 -0700, Feng Kan wrote:
>>> From: Feng Kan <fkan@appliedmicro.com>
>>>
>>> The current matching scheme make the pci node match to pcix or
>>> pciex node.
>>> To avoid the match, change the method so only one type of
>>> initialization
>>> is called per node.
>>
>> No, your patch is not right. The problem was introduced by a patch
>> from
>> Grant that incorrectly made of_device_is_compatible do a substring
>> match. Grant should have fixed that now. Grant ? Is your fix upstream
>> yet ? If not, can you send that ASAP ?
>
> Better if I CC him too :-)
>
> Cheers,
> Ben.
>
>> Cheers,
>> Ben.
>>
>>
>>> Signed-off-by: Feng Kan <fkan@appliedmicro.com>
>>> Signed-off-by: Tirumala R Marri <tmarri@appliedmicro.com>
>>> ---
>>> arch/powerpc/sysdev/ppc4xx_pci.c | 14 ++++++++------
>>> 1 files changed, 8 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/
>>> sysdev/ppc4xx_pci.c
>>> index 8aa3302..1e67c74 100644
>>> --- a/arch/powerpc/sysdev/ppc4xx_pci.c
>>> +++ b/arch/powerpc/sysdev/ppc4xx_pci.c
>>> @@ -1842,14 +1842,16 @@ static int __init ppc4xx_pci_find_bridges
>>> (void)
>>>
>>> ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS |
>>> PPC_PCI_COMPAT_DOMAIN_0;
>>>
>>> + for_each_compatible_node(np, NULL, "ibm,plb-pci") {
>>> + if (of_device_is_compatible(np, "ibm,plb-pcix"))
>>> + ppc4xx_probe_pcix_bridge(np);
>>> #ifdef CONFIG_PPC4xx_PCI_EXPRESS
>>> - for_each_compatible_node(np, NULL, "ibm,plb-pciex")
>>> - ppc4xx_probe_pciex_bridge(np);
>>> + else if (of_device_is_compatible(np, "ibm,plb-pciex"))
>>> + ppc4xx_probe_pciex_bridge(np);
>>> #endif
>>> - for_each_compatible_node(np, NULL, "ibm,plb-pcix")
>>> - ppc4xx_probe_pcix_bridge(np);
>>> - for_each_compatible_node(np, NULL, "ibm,plb-pci")
>>> - ppc4xx_probe_pci_bridge(np);
>>> + else
>>> + ppc4xx_probe_pci_bridge(np);
>>> + }
>>>
>>> return 0;
>>> }
>>
>>
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix the problem where pcix node is probed again as pci node.
2010-03-30 21:14 ` Benjamin Herrenschmidt
2010-03-30 22:02 ` Feng Kan
@ 2010-03-30 22:28 ` Grant Likely
1 sibling, 0 replies; 6+ messages in thread
From: Grant Likely @ 2010-03-30 22:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Feng Kan, Tirumala R Marri, Feng Kan
On Tue, Mar 30, 2010 at 3:14 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2010-03-31 at 07:48 +1100, Benjamin Herrenschmidt wrote:
>> On Tue, 2010-03-30 at 10:41 -0700, Feng Kan wrote:
>> > From: Feng Kan <fkan@appliedmicro.com>
>> >
>> > The current matching scheme make the pci node match to pcix or pciex node.
>> > To avoid the match, change the method so only one type of initialization
>> > is called per node.
>>
>> No, your patch is not right. The problem was introduced by a patch from
>> Grant that incorrectly made of_device_is_compatible do a substring
>> match. Grant should have fixed that now. Grant ? Is your fix upstream
>> yet ? If not, can you send that ASAP ?
>
> Better if I CC him too :-)
The fix is in upstream. Commit 1976152fd8e706135deed6cf333e347c08416056
g.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix the problem where pcix node is probed again as pci node.
2010-03-30 22:02 ` Feng Kan
@ 2010-03-30 22:28 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2010-03-30 22:28 UTC (permalink / raw)
To: Feng Kan; +Cc: linuxppc-dev, Tirumala R Marri, Feng Kan
On Tue, 2010-03-30 at 15:02 -0700, Feng Kan wrote:
> Ok thanks. This short string match may be useful in some cases, but I
> agree it plays havoc with the current code.
Yeah well, it's not actually -that- useful and is definitely broken :-)
If you want multiples matches, then it's the compatible property itself
that should contain multiple entries since it's a list. The string match
should be exact.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-30 22:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30 17:41 [PATCH] fix the problem where pcix node is probed again as pci node Feng Kan
2010-03-30 20:48 ` Benjamin Herrenschmidt
2010-03-30 21:14 ` Benjamin Herrenschmidt
2010-03-30 22:02 ` Feng Kan
2010-03-30 22:28 ` Benjamin Herrenschmidt
2010-03-30 22:28 ` Grant Likely
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).