linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* PCI EDAC on MPC85xx
@ 2011-05-31 13:17 Dmitry Eremin-Solenikov
  2011-05-31 18:41 ` Kumar Gala
  2011-05-31 19:12 ` Grant Likely
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-05-31 13:17 UTC (permalink / raw)
  To: devicetree-discuss, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

Hello,

Long time ago (around July of 2010), I've reported a problem of binding
pci error reporting driver to the hardware (See
http://thread.gmane.org/gmane.linux.kernel.edac/181). Grant Likely has
come with a patch to create platform devices (of_platform at that time),
for device_nodes which have "compatible" properties
(http://article.gmane.org/gmane.linux.ports.ppc.embedded/36981).

The patch was not applied at that time and the problem still arises at
3.0-rc1. Should the patch in question be applied, or is there any new
solution?
Current version of that patch which I have in my tree is attached
to this mail (no original signoff by Grant).

-- 
With best wishes
Dmitry


[-- Attachment #2: 0001-of-device-Register-children-with-a-compatible-value-.patch --]
[-- Type: text/x-diff, Size: 2200 bytes --]

>From 511ce78e6aeeb9562cff0f0bbc186419b53bc209 Mon Sep 17 00:00:00 2001
From: Grant Likely <grant.likely@secretlab.ca>
Date: Thu, 22 Jul 2010 13:01:11 -0600
Subject: [PATCH] of/device: Register children with a compatible value in
 of_platform_bus_probe()

Currently, of_platform_bus_probe() completely skips nodes which do not
explicitly match the 'matches' table passed in.  Or, if the root node
matches, then it registers all the children unconditionally.  However,
there are situations, such as registering devices from the root node,
when it is desirable to register child nodes, but only if they actually
represent devices.  For example, the root node may contain both a local
bus and a PCI device, but it also contains the chosen, aliases and cpus
nodes which don't represent real devices.

This patch changes of_platform_bus_probe() to register all nodes at the
top level if they either match the matches table (the current behaviour),
or if they have a 'compatible' value (indicating it represents a device).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/of/platform.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 63d3cb7..80f0682 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -269,7 +269,18 @@ int of_platform_bus_probe(struct device_node *root,
 	if (of_match_node(matches, root)) {
 		rc = of_platform_bus_create(root, matches, parent);
 	} else for_each_child_of_node(root, child) {
-		if (!of_match_node(matches, child))
+
+		/* Register each child node if either:
+		 *  a) it has a 'compatible' value indicating they are a device, or
+		 *  b) it is specified by the 'matches' table (by name or device_type)
+		 * If a node is specified in the matches table, then all its children
+		 * also get registered.
+		 */
+		const void *compat = of_get_property(child, "compatible", NULL);
+		const struct of_device_id *match = of_match_node(matches, child);
+
+		/* Skip if node neither matches nor has a compatible property */
+		if (!compat && !match)
 			continue;
 		rc = of_platform_bus_create(child, matches, parent);
 		if (rc)
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: PCI EDAC on MPC85xx
  2011-05-31 13:17 PCI EDAC on MPC85xx Dmitry Eremin-Solenikov
@ 2011-05-31 18:41 ` Kumar Gala
  2011-05-31 19:25   ` Dmitry Eremin-Solenikov
  2011-05-31 19:12 ` Grant Likely
  1 sibling, 1 reply; 4+ messages in thread
From: Kumar Gala @ 2011-05-31 18:41 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: devicetree-discuss, linuxppc-dev


On May 31, 2011, at 8:17 AM, Dmitry Eremin-Solenikov wrote:

> Hello,
>=20
> Long time ago (around July of 2010), I've reported a problem of =
binding
> pci error reporting driver to the hardware (See
> http://thread.gmane.org/gmane.linux.kernel.edac/181). Grant Likely has
> come with a patch to create platform devices (of_platform at that =
time),
> for device_nodes which have "compatible" properties
> (http://article.gmane.org/gmane.linux.ports.ppc.embedded/36981).
>=20
> The patch was not applied at that time and the problem still arises at
> 3.0-rc1. Should the patch in question be applied, or is there any new
> solution?
> Current version of that patch which I have in my tree is attached
> to this mail (no original signoff by Grant).
>=20
> --=20
> With best wishes
> Dmitry
>=20
> <0001-of-device-Register-children-with-a-compatible-value-.patch>

I think the desired solution here was to create a new node in the =
fsl_pci code that the edac code would bind against.

- k=

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PCI EDAC on MPC85xx
  2011-05-31 13:17 PCI EDAC on MPC85xx Dmitry Eremin-Solenikov
  2011-05-31 18:41 ` Kumar Gala
@ 2011-05-31 19:12 ` Grant Likely
  1 sibling, 0 replies; 4+ messages in thread
From: Grant Likely @ 2011-05-31 19:12 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: devicetree-discuss, linuxppc-dev

On Tue, May 31, 2011 at 7:17 AM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> Hello,
>
> Long time ago (around July of 2010), I've reported a problem of binding
> pci error reporting driver to the hardware (See
> http://thread.gmane.org/gmane.linux.kernel.edac/181). Grant Likely has
> come with a patch to create platform devices (of_platform at that time),
> for device_nodes which have "compatible" properties
> (http://article.gmane.org/gmane.linux.ports.ppc.embedded/36981).
>
> The patch was not applied at that time and the problem still arises at
> 3.0-rc1. Should the patch in question be applied, or is there any new
> solution?
> Current version of that patch which I have in my tree is attached
> to this mail (no original signoff by Grant).

Hi Dmitry,

I've since looked at the problem more, and I've been working on
refactoring both of_platform_bus_probe(), and creating a new function,
of_platform_populate(), which implements the symantics that I think
are needed for your use case.  The work isn't done yet, but it has
gone out for at least one round of review, and I hope to get it into
the 3.1 merge window.

g.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PCI EDAC on MPC85xx
  2011-05-31 18:41 ` Kumar Gala
@ 2011-05-31 19:25   ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-05-31 19:25 UTC (permalink / raw)
  To: Kumar Gala; +Cc: devicetree-discuss, linuxppc-dev

On 5/31/11, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On May 31, 2011, at 8:17 AM, Dmitry Eremin-Solenikov wrote:
>
>> Hello,
>>
>> Long time ago (around July of 2010), I've reported a problem of binding
>> pci error reporting driver to the hardware (See
>> http://thread.gmane.org/gmane.linux.kernel.edac/181). Grant Likely has
>> come with a patch to create platform devices (of_platform at that time),
>> for device_nodes which have "compatible" properties
>> (http://article.gmane.org/gmane.linux.ports.ppc.embedded/36981).
>>
>> The patch was not applied at that time and the problem still arises at
>> 3.0-rc1. Should the patch in question be applied, or is there any new
>> solution?
>> Current version of that patch which I have in my tree is attached
>> to this mail (no original signoff by Grant).
>>
>> --
>> With best wishes
>> Dmitry
>>
>> <0001-of-device-Register-children-with-a-compatible-value-.patch>
>
> I think the desired solution here was to create a new node in the fsl_pci
> code that the edac code would bind against.

Sorry, got mistaken then by Grant=B4s patch. Will provide an update on this=
 topic
soon.


--=20
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-31 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-31 13:17 PCI EDAC on MPC85xx Dmitry Eremin-Solenikov
2011-05-31 18:41 ` Kumar Gala
2011-05-31 19:25   ` Dmitry Eremin-Solenikov
2011-05-31 19:12 ` 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).