[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: Vikram Garhwal <vikram.garhwal@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Thu, 4 May 2023 04:23:17 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=/HYqL7xhkw9+WdB4I1aHYn7t4ZClm5rVJZUpNZxuLvU=; b=KC+SyAoSAaq1bonYkrT6FSLYodgAkOA7/JKTrcLMweOew+qXY3NQCWj0RvqYXuGDDhtPQ8HS1EPv7scFTK326IdFuXAgx2HxPChIT+n8WWPSkiV1G7bB+qezVjL72xr32sxufLuiLVvlnAJtKdYEnr1ytysN4yssFf5HffJLu3SJoSgWeG5QanLP3ZV7NjBSVuk61nmFOYEIWF7Pp31PF9lr92TuSyhK8q7QgMrZOY0ehR548hBhmUvsoUtV3ZT0fmHObKyvtuQ8Eoz/rvovNdrVhzoi7C4F0lAATXN/DQZ20IicN+wzBon3cA9zzDHmNKhXx9GQWm8DBJr/CpsQgQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QldMFTUaabUlA+KJ6xPGELEqViReWBaQt2iHFKymtJgzm6p8LxGn9J1OazTlbsCmVPVX25dWM2+dUoDH6ikVSGf5GMYF4ngXEwsJeT2pXGpLrVd267Rty020tRaaGMo0otVxqFwsW9KX6BkyzpyV+WvUj2tUGQT0+BezBWPK0naEHX3+ISlr6lmK5bDhsv4cScx6Byx2PojBQ+0WhSTubIBuq8EsSi98zOs84ft+2kVVPe5bGh9gYip64nwVX32Y5yC3nDAtuHvXqgJ1mP/OB7izm9n9WYwF+ur7i8QvzQxkmaabl02Rsrfe16ZNnawDHjIdbhKQ+x7/pMxnbog/hA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Thu, 04 May 2023 04:23:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZfU8kxczuWvlyd0qZ9yNYcQTG6K9JhHkw
  • Thread-topic: [XEN][PATCH v6 08/19] xen/device-tree: Add device_tree_find_node_by_path() to find nodes in device tree

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...

>   * @path: The full path to match
>   *
>   * Returns a node pointer.
>   */
> -struct dt_device_node *dt_find_node_by_path(const char *path);
> +struct dt_device_node *device_tree_find_node_by_path(struct
> dt_device_node *dt,

...here. I personally agree with Michal so I think please fix the comment
to keep consistency.

The rest of the patch looks good to me, so as long as you fixed this, you
can have my:

Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry




 


Rackspace

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