[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN][PATCH v6 08/19] xen/device-tree: Add device_tree_find_node_by_path() to find nodes in device tree


  • To: Michal Orzel <michal.orzel@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Wed, 31 May 2023 14:31:53 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QZqgq69XDgY/WCCBtf8GsCnxxbOsGmopbsOOxTJh9WQ=; b=JMdmgAJsFW5uj81cmQH/CYQsQuwpUU6qsLNmAJisNzKiadYErJeBhUAb+e3+BVlxPBiV2pqD70t/cYvUdOmT9dvfSVfU/w+adts46VVrCFvs+dyC6tyhCxjx2/HGXaDftn1B5xDONxeV1W/AaX+SCdnAgzChDDge/+vekH4COxq+Irb7BU5TYuP6scrJ9kyIUGcyO5B/QS6Gf+hlLuqcT0vhgT0fHG7rbTwuHOLLq6digfEiNrtsIlEa8WHdvBodvVx54hGXg+TfUJUfvHqFqe86iRTPdx9TwxpnxTE82bPp748n+pdFPQnVh/PjQbj6itwoc1iAFIrCpk+AAGeeFg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dbBArU04kAQpB2JVuvBHrdYiuMDxjT3WU2qvdXjOFbFFTY60q/YWmpGr1m8pP5IOygWSifkntF3MAfLUYxAPygdUY3RPjsEcnpBUBL3XAIxFBdNQWa6v8o93qPxsYYcRjvDe04oFJI5CbMAxyzT33iSXC4zhOe8qRg0zs4XvaMs1fcOmA8paGlRMGRR9eXrjCifht/5KcLUe9sK9EyzIx0DXo+07rKvTdkHAkc5mUIHATTuT1MvbxnV+h2tGOkn7mG2LIQ3L0wIwpgIyyuEjcS95LG8iJNvlG9+AxRmKdyn6T0Pw0Oou8fAy3bie9x1zqjXL+ZyjML9GAptEcNu8Ug==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Wed, 31 May 2023 21:37:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Henry & Michal,


On 5/9/23 4:29 AM, Michal Orzel wrote:

On 04/05/2023 06:23, Henry Wang wrote:

Hi Vikram,

-----Original Message-----
Subject: [XEN][PATCH v6 08/19] xen/device-tree: Add
device_tree_find_node_by_path() to find nodes in device tree

Add device_tree_find_node_by_path() to find a matching node with path for
a
dt_device_node.

Reason behind this function:
     Each time overlay nodes are added using .dtbo, a new fdt(memcpy of
     device_tree_flattened) is created and updated with overlay nodes. This
     updated fdt is further unflattened to a dt_host_new. Next, we need to find
     the overlay nodes in dt_host_new, find the overlay node's parent in dt_host
     and add the nodes as child under their parent in the dt_host. Thus we need
     this function to search for node in different unflattened device trees.

Also, make dt_find_node_by_path() static inline.

Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
---
  xen/common/device_tree.c      |  5 +++--
  xen/include/xen/device_tree.h | 17 +++++++++++++++--
  2 files changed, 18 insertions(+), 4 deletions(-)

[...]

  /**
- * dt_find_node_by_path - Find a node matching a full DT path
+ * device_tree_find_node_by_path - Generic function to find a node
matching the
+ * full DT path for any given unflatten device tree
+ * @dt_node: The device tree to search
I noticed that you missed Michal's comment here about renaming the
"dt_node" here to "dt" to match below function prototype...
This is one thing. The other is that in v5 you said this is to be a generic 
function
where you can search from a middle of a device tree. This means that the 
parameter should be
named "node" or "from" and the description needs to say "The node to start searching 
from" +
seeing the lack of ->allnext you can mention that this is inclusive (i.e. the 
passed node will also be searched).
Changed this for v7. Will send it out soon.

@Henry, i didn't add reviewed-by as the patch is bit changed with renaming. Can you please review v7 and give your feedback.

~Michal




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.