[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: Henry Wang <Henry.Wang@xxxxxxx>, Vikram Garhwal <vikram.garhwal@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 9 May 2023 13:29:41 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=6lEcqQLcDaEF19Nz3REWbrermeWgjlYGyZZ8ZM+1zR4=; b=TJA0Ja8tFZ3poU/KCePZnAz8U9qyAklk/Hqs+UuiUYJFpxTEdIpgwUWVScHiXMzt+s2PZFpc1AnuZ7UzbtzJLRrBUa/BrFzbAcMJ+r/NizE2PjbXQ9JsfGsE5sJJMguuDTlcpxO8Y+jgFltkadzLMa2y0361P3QsdPog0Q/LP8u1BFDETpm8gRgP9EID9Rqgg60bhXyiDeFQt2Isu0tH3oL4fExPubgRcGzcOPZuFiGvptCPdLaSeLrF0kMG9jYE1U31EZXt9I0rn6adfpALKNVWTVMwYRDuwExZgqSdoUi/eaNO8dlcAyePWyimpGC4PTGNoZqU/3xJiQJMkmcyNQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jVm6F4awnu945CCXBOLTejpcGJ+uisdVhuwYrfleMqlgZ2OrdBwDU6vOwDNecuG0s2Iher9wqwoJYxoD2fOxQk8lQDpHB/h/1G10Cke3Tqhknr3ciUv9I1/Lsl/mSk4Fq7KUNA7+Vou8fgSG+Dph+0pq3V2FoCjHHSoiOmZUUZK0rnT590HfpuYPaW4n8R/67tG2sPSqtAdHKm/zc0fDn06wuOhvW/7urGDbOTN2XrmQewthtY00XaZdxh1Ct9v/kSScEnoe0/2qN1tWfN5w72PXgArRRUCAAaNFGhkL4rmzYDFzBXDojSClljg4NU7UUZ932vBoJMWltzKQXv5ysg==
  • Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Tue, 09 May 2023 11:30:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


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

~Michal



 


Rackspace

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