Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2973341iog; Mon, 27 Jun 2022 06:46:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vxli1ZdW/lRH+wqeJ962GSPFDsdeQts8aQMCUNpS4GyhLETtAJ0JWSdJ7K5Kp4SN6ph1iY X-Received: by 2002:a17:90b:1a86:b0:1ed:20a2:f53b with SMTP id ng6-20020a17090b1a8600b001ed20a2f53bmr15886204pjb.184.1656337585142; Mon, 27 Jun 2022 06:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656337585; cv=none; d=google.com; s=arc-20160816; b=SA40PcakHfT9y9xr/GbhZe+b4N8tsbv/udBTzXsLZpDHNldbV61dogMZs/WVu6iT1/ 5FNHBZ9uzK7VBOe+yZNTJiBS3ngmed8PINynlnGz9bheb0yN2tnbhkuIWO0KWspgnpjg I+CMZoL0tisNdUKnzFkyfo6/8tPDemRjI5gjJQ8NkfAKRVqf2QcrsDbdrzDsJjk0UIGl fWVAnfHoWkdgUqWwlpASR0UMkDtip7az4xbZg9zgeL1gPkVZl653kTlPG+3TF6g22VR8 4YgmkitfsN0tn3rNSFk1Eg0vbNSIgeIvFb1LZFJN+sf2+9BsEjsUjGOEu+c0Hgr+Nfkv hCKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=ztN9msliEJWcvQDVWkbiAiIE0Z0BrDUarJzwnIGzjC8=; b=N6+/ffej4ZojG9BKpVBIMiUS16o3xaanF8Wq99x4zrwl04US316yggDSD5ZqUW/RqS A9+iHW1ioqDfVZb6GK8qo422U6t86SqWPS2JAT3Z31GQc4LiBU6mo1xsyaFx6xorDaqs SgC0ZkSdOtA7MnQ6XfQ/7bE+E6Ze/v4/2u8EOq2xplS3B+/R3F1oMFjXbps5nzu9lG/g hBwWgwcTNgTWkc74IOryYx8C40uaXevr1CtpyHU/7aPcmpUxyXV+rXk9pDF4oOzFjQZD ttmtgbe3FS3BAuXVKBC+p3zm86HrxVx7W1SxZW+X5fsKzgTj5pOazTPdadqXXDdCmK3s 6j+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n23-20020a63a517000000b003fc819ee690si15162302pgf.859.2022.06.27.06.46.12; Mon, 27 Jun 2022 06:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236484AbiF0Nd4 (ORCPT + 99 others); Mon, 27 Jun 2022 09:33:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236422AbiF0Ndx (ORCPT ); Mon, 27 Jun 2022 09:33:53 -0400 Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11A9A6362; Mon, 27 Jun 2022 06:33:52 -0700 (PDT) Received: by mail-yb1-f177.google.com with SMTP id p136so10567648ybg.4; Mon, 27 Jun 2022 06:33:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ztN9msliEJWcvQDVWkbiAiIE0Z0BrDUarJzwnIGzjC8=; b=YMw94vLB9C1PkhH+V5lHE0rNhfmHkWJaK7kt3QhDenuKQWmlOhucJzTRK/EJtRlOFz Z4g2MghMccb9BofygtQjvq9OZgzYxk5XUnE7BXcjXcLBe4fOgiG0T1uSsEyF7pZ/y5D7 Y0K5AhY2xgiMGskIMtjl3Bpz1fq/5WMAm9q4KnXqQmTB2pC/oVHN+vCICvOAB0CUOOAZ X45fPwpS13QQljWbylupAd+bnSCQzSFaqS4Cb1g9VuESufeKYg+m6uj9B4mBZ0kKkpaD eflb54zIg/XuaGOsi2kHXC2eRHI1/6KM94dep+34aylNVoV+BKMGGFWugk3tp01FQTKE xCpw== X-Gm-Message-State: AJIora/VDoTB+FIrujhlgzNanPht2ZH2YhFobQkIuZabib40fWX4f1x+ 0F3W2HZ7imnzrF99EXiVjNyEgw0YG0bu/Wmt0uTjOpZGsaQ= X-Received: by 2002:a25:9004:0:b0:66c:97a4:3053 with SMTP id s4-20020a259004000000b0066c97a43053mr10112879ybl.137.1656336831002; Mon, 27 Jun 2022 06:33:51 -0700 (PDT) MIME-Version: 1.0 References: <4e1d5db9dea68d82c94336a1d6aac404@walle.cc> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 27 Jun 2022 15:33:37 +0200 Message-ID: Subject: Re: fwnode_for_each_child_node() and OF backend discrepancy To: Krzysztof Kozlowski Cc: Michael Walle , Andy Shevchenko , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , ACPI Devel Maling List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Sakari Ailus , Saravana Kannan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 27, 2022 at 3:08 PM Krzysztof Kozlowski wrote: > > On 27/06/2022 14:49, Michael Walle wrote: > > Hi, > > > > I tired to iterate over all child nodes, regardless if they are > > available > > or not. Now there is that handy fwnode_for_each_child_node() (and the > > fwnode_for_each_available_child_node()). The only thing is the OF > > backend > > already skips disabled nodes [1], making fwnode_for_each_child_node() > > and > > fwnode_for_each_available_child_node() behave the same with the OF > > backend. > > > > Doesn't seem to be noticed by anyone for now. I'm not sure how to fix > > that > > one. fwnode_for_each_child_node() and also fwnode_get_next_child_node() > > are > > used by a handful of drivers. I've looked at some, but couldn't decide > > whether they really want to iterate over all child nodes or just the > > enabled > > ones. > > If I get it correctly, this was introduced by 8a0662d9ed29 ("Driver > core: Unified interface for firmware node properties") > . Originally it was, but then it has been reworked a few times. The backend callbacks were introduced by Sakari, in particular. > The question to Rafael - what was your intention when you added > device_get_next_child_node() looking only for available nodes? That depends on the backend. fwnode_for_each_available_child_node() is more specific and IIRC it was introduced for fw_devlink (CC Saravana). > My understanding is that this implementation should be consistent with > OF implementation, so fwnode_get_next_child_node=get any child. IIUC, the OF implementation is not consistent with the fwnode_get_next_child_node=get any child thing. > However maybe ACPI treats it somehow differently? acpi_get_next_subnode() simply returns the next subnode it can find.