[v2,3/3] of: property: Add in-ports/out-ports support to of_graph_get_port_parent()

Message ID 20240207011803.2637531-4-saravanak@google.com
State New
Headers
Series Improve remote-endpoint parsing |

Commit Message

Saravana Kannan Feb. 7, 2024, 1:18 a.m. UTC
  Similar to the existing "ports" node name, coresight device tree bindings
have added "in-ports" and "out-ports" as standard node names for a
collection of ports.

Add support for these name to of_graph_get_port_parent() so that
remote-endpoint parsing can find the correct parent node for these
coresight ports too.

Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 drivers/of/property.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Saravana Kannan Feb. 21, 2024, 12:47 a.m. UTC | #1
On Tue, Feb 6, 2024 at 5:18 PM Saravana Kannan <saravanak@google.com> wrote:
>
> Similar to the existing "ports" node name, coresight device tree bindings
> have added "in-ports" and "out-ports" as standard node names for a
> collection of ports.
>
> Add support for these name to of_graph_get_port_parent() so that
> remote-endpoint parsing can find the correct parent node for these
> coresight ports too.
>
> Signed-off-by: Saravana Kannan <saravanak@google.com>

Greg,

I saw that you pulled the previous 2 patches in this series to 6.1,
6.6 and 6.7 kernel branches. I really should have added both of those
Fixes tag to this patch too.

Can you please pull in the patch to those stable branches too?

Thanks,
Saravana

> ---
>  drivers/of/property.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 7bb2d8e290de..39a3ee1dfb58 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -763,7 +763,9 @@ struct device_node *of_graph_get_port_parent(struct device_node *node)
>         /* Walk 3 levels up only if there is 'ports' node. */
>         for (depth = 3; depth && node; depth--) {
>                 node = of_get_next_parent(node);
> -               if (depth == 2 && !of_node_name_eq(node, "ports"))
> +               if (depth == 2 && !of_node_name_eq(node, "ports") &&
> +                   !of_node_name_eq(node, "in-ports") &&
> +                   !of_node_name_eq(node, "out-ports"))
>                         break;
>         }
>         return node;
> --
> 2.43.0.594.gd9cf4e227d-goog
>
  
Greg KH Feb. 21, 2024, 7 a.m. UTC | #2
On Tue, Feb 20, 2024 at 04:47:35PM -0800, Saravana Kannan wrote:
> On Tue, Feb 6, 2024 at 5:18 PM Saravana Kannan <saravanak@google.com> wrote:
> >
> > Similar to the existing "ports" node name, coresight device tree bindings
> > have added "in-ports" and "out-ports" as standard node names for a
> > collection of ports.
> >
> > Add support for these name to of_graph_get_port_parent() so that
> > remote-endpoint parsing can find the correct parent node for these
> > coresight ports too.
> >
> > Signed-off-by: Saravana Kannan <saravanak@google.com>
> 
> Greg,
> 
> I saw that you pulled the previous 2 patches in this series to 6.1,
> 6.6 and 6.7 kernel branches. I really should have added both of those
> Fixes tag to this patch too.
> 
> Can you please pull in the patch to those stable branches too?

Sure, what's the git id?

thanks,

greg k-h
  
Greg KH Feb. 21, 2024, 8:38 a.m. UTC | #3
On Wed, Feb 21, 2024 at 08:00:00AM +0100, Greg Kroah-Hartman wrote:
> On Tue, Feb 20, 2024 at 04:47:35PM -0800, Saravana Kannan wrote:
> > On Tue, Feb 6, 2024 at 5:18 PM Saravana Kannan <saravanak@google.com> wrote:
> > >
> > > Similar to the existing "ports" node name, coresight device tree bindings
> > > have added "in-ports" and "out-ports" as standard node names for a
> > > collection of ports.
> > >
> > > Add support for these name to of_graph_get_port_parent() so that
> > > remote-endpoint parsing can find the correct parent node for these
> > > coresight ports too.
> > >
> > > Signed-off-by: Saravana Kannan <saravanak@google.com>
> > 
> > Greg,
> > 
> > I saw that you pulled the previous 2 patches in this series to 6.1,
> > 6.6 and 6.7 kernel branches. I really should have added both of those
> > Fixes tag to this patch too.
> > 
> > Can you please pull in the patch to those stable branches too?
> 
> Sure, what's the git id?

Nevermind, I found it...
  

Patch

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 7bb2d8e290de..39a3ee1dfb58 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -763,7 +763,9 @@  struct device_node *of_graph_get_port_parent(struct device_node *node)
 	/* Walk 3 levels up only if there is 'ports' node. */
 	for (depth = 3; depth && node; depth--) {
 		node = of_get_next_parent(node);
-		if (depth == 2 && !of_node_name_eq(node, "ports"))
+		if (depth == 2 && !of_node_name_eq(node, "ports") &&
+		    !of_node_name_eq(node, "in-ports") &&
+		    !of_node_name_eq(node, "out-ports"))
 			break;
 	}
 	return node;