From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B98A0178372 for ; Thu, 20 Nov 2025 01:01:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763600503; cv=none; b=QTkwFvSIvUyE7c76QP3fin0koFeGqip1CaD9r7kUzvuw/+akbKgrnlu0uTCZGcSh9UpXM6j6A1soi1jTvUylm3yOgZL/bPtuKbm0EZL0NqqVdbxfJdubDklA9WDN3ndR6I/rZ2Xnt8DXf/udhy3LTQXVdi3xM7QxsM01RDLqAgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763600503; c=relaxed/simple; bh=S1kXvrn93cUEzs6slAKgNy4bH/LtAkdBKIXZyolnmdQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=tqAX3lduO5RGfiAZJUsyx5OaLeZVMdhvqAr0BdG42i1nDFbrXWE7BvlAweFH94l9Oa8ASgaxtF2RGBu60z3SUiAtRJyDTGFwv1n/p0yqHwnu2wbIqmsRktCmiYQ+N8Crq1Qv2M1BuCnZfUfIBpmaEhVUx1auoWs5n+hVG9qSy1k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=lhzTm0Qc; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="lhzTm0Qc" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-297dd95ffe4so2924865ad.3 for ; Wed, 19 Nov 2025 17:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1763600501; x=1764205301; darn=vger.kernel.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=eIEhL4VxM7ghK2mG+iC47nZUgip1BfB1tOdqThTNDgY=; b=lhzTm0QcxdqtPS1J4JbnNJt5ajkk/hdh8WuxmYfXVUw6pTKP4b7vU9lTFeGD+su3/z NRToEiG/D2qjElPhlJJfpMSPKwTHb9Rrn+At8Cpx/rb+8eVihs0OtC/Un+VRDfvWQHrS Hb7NxJq3md3oYXu3Ur6IcahIUxJy7ZYlVCOSPZ4p15/xsSQy9Q34fs4s6eY1DMsW1kQC H7k1++cuV+0ollpGjg9sABJNGiaPK8bM2G2x5dofh/X7G1sLslw5ObHR0FCfv4RAul0h T6dCEZEAsAvDz2i6ICXTCZVxZ9HPuebPbdIlQjpXN3lDeKTvjTJ70SQlPtx1ILYLOBd3 G7hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763600501; x=1764205301; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eIEhL4VxM7ghK2mG+iC47nZUgip1BfB1tOdqThTNDgY=; b=pMFqUI3fawCAsTmX+ZZv5jNkXiWNM6Ng9K+BMO4LXb5qPaINeGawEHJGeAwdqJDJNY LvKqd4NStkJk1RWoR+bMN97fGTCcIOSglkrBtByay3epf1R5HR7ZrijNJoPb2dxRm/z6 mSCktFD2NiGqUmsjF0git7bcUr3Go124ZkcTf8XCKXiX3gS5abfJnIb18XinZu3+sYaW K6HQfHkF40llGb7yqqni9dDRY6ShEB8aLBua6CkAhIO9exWj8GDrm82gA3mc3yC75jdq dhNRph6A5qgLj19/LD//2EcVO17GS9GMTrWdQvVFZqhuN5/vlGz3OUKQo+9pvjplkHAt u7dQ== X-Gm-Message-State: AOJu0YwYeC9HJcY5WYpFQE60IqZy2w47E98C5XVwWnki+dYe7cuzPRs0 MtQvc/JiNmf5i3LSG9FDhnVjAI28ZsH22u6GJPOpucLqsoHCympEiGZ5empzXy9eDHfNKusFGuY P/DNqzGk= X-Gm-Gg: ASbGncv2Iwxr55QWDQ0NfU05q9QfTLEUnqBEBpB0EVEOSavI9w09L0q2hNOWewDodSm rBzj5oz47Sgyeg2GUPDa8Lq0DMa1FycSUkubCGDUTx+04n5c8S7inn7X42P7dfLrh/QwlkFaxkg A5QxoRkR8f2SWA45g1x1ukmKVVdpvnsoyZSIO495HOEibgnFRUsjVkPhYt5jksI2r7AuDOJfPiw 4Lzna5kEKzW4KArPk4/7lE0TNpT3UHdMKsnH2faV5lbruRg7komdXDycZO35cS5Y4OwarnUCX1Z BUhJMBg/JutlD14hlD2XVXkZ24qDq2XNZpSXQnENc/trQJkN+Xebdb/rSBxmdE2wbdUGcxbPYeM htl8g8B+95o8gXe3ZjMiaE0vt+BjrMgyEvlDGCcdwOcLO4+uw6TyP9opPoT17Tliwx1UozSjjJQ gWbCX6Nxo/2ZPEMaNf02A= X-Google-Smtp-Source: AGHT+IEqw78cftsDU7YZyIRB0CXtzePRU0iLnoit3ob3znYZ+DZXTr4p0cuA9rJuU7Vz7Z+gxqqtDg== X-Received: by 2002:a17:903:1a43:b0:296:2aed:4fab with SMTP id d9443c01a7336-29b5b05b6damr14930755ad.23.1763600500485; Wed, 19 Nov 2025 17:01:40 -0800 (PST) Received: from localhost ([71.212.208.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29b5b2ac81bsm6687805ad.93.2025.11.19.17.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 17:01:39 -0800 (PST) From: Kevin Hilman To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, arm-scmi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] of: Add of_parse_map_iter() helper for nexus node map iteration In-Reply-To: <20251119-topic-lpm-of-map-iterator-v6-18-v1-1-1f0075d771a3@baylibre.com> References: <20251119-topic-lpm-of-map-iterator-v6-18-v1-1-1f0075d771a3@baylibre.com> Date: Wed, 19 Nov 2025 17:01:39 -0800 Message-ID: <7h8qg1frf0.fsf@baylibre.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Kevin Hilman (TI.com)" writes: > Add a new helper function of_parse_map_iter() to iterate over nexus > node maps (c.f. DT spec, section 2.5.1.) > > This function provides an iterator interface for traversing map > entries, handling the complexity of variable-sized entries based on > -cells properties, as well as handling the -skip and > -pass-thru properties. > > RFC: There's a lot of overlap between this function and > of_parse_phandle_with_args_map(). However the key differences are: > > - of_parse_phandle_with_args_map() does matching > it searches for an entry that matches specific child args > - of_parse_map_iter() does iteration > it simply walks through all entries sequentially > > There are likely ways to extract some shared code between these two > functions into some shared helpers, but I'm hoping someone more > familiar with this OF code can help here. > > However, before refactoring the shared code, it would be good to have > some feedback on this approach. For a bit more context, the need for this comes from the work in drivers/pmdomain to be able to create pmdomain hierarchies using a power-domain-map property. I just posted an example user of this functionality here: https://lore.kernel.org/r/20251119-pmdomain-hierarchy-onecell-v4-0-f25a1d5022f8@baylibre.com Kevin