Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2167955lqb; Mon, 27 May 2024 09:55:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWaR9R2bYQf0aSxdFKHZAWWSKvlY6V7P3HTj43GftfUYToAvy4EM0IRy5lwXf9N86RXlGdS2lE5sqkdQUaGNGiwN07Y87SrN8SqVwZ8Sw== X-Google-Smtp-Source: AGHT+IHygN4vaQtrGwIHzuuR5PCi/QDKuWVh5a/FosBI9r2rDrropvDnkaC3jCDuZkv/ZfCYO+NZ X-Received: by 2002:a17:903:188:b0:1f4:bd38:2e15 with SMTP id d9443c01a7336-1f4bd3830ddmr9331425ad.10.1716828924192; Mon, 27 May 2024 09:55:24 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c997ae9si63360865ad.346.2024.05.27.09.55.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 09:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-191235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191235-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BB374B22FC5 for ; Mon, 27 May 2024 16:29:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F1CB61FF8; Mon, 27 May 2024 16:28:59 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B62717E91C; Mon, 27 May 2024 16:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716827338; cv=none; b=qgdjkc8HHx64Z0bQdG3+OqdvZcs60IhvRmBE8BC4XZmVHHJWSXIniArdOOY7UL60vZaj7AeO49OxnSTNM7gSc5JCNCXk72DAQ+G24l2OY8cWdiBt0HUPB6gUpT3Hf8cgIrWWrOUU4CHHFkd0wNh3NaspTMicQxItKeInsGIgDtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716827338; c=relaxed/simple; bh=tenOVureWXg27A/BRhhEdtjSgdb2iCP2DVRnVahKpPk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mrP0jS29tFOXumDl4OaoyTRmLKvo90ractauoZAzC+9FNAcGeTxoVvIiSxJzf0uFDYUB52A15LryV62PvmLeDRf9z0IW3qNgQoU7Ph1m+9pRQV/yuG+Iq5T0Qu33JG5UFtsgtkBmxE6VstkgCQjcPZujb2Hf16UHRldQXRuv2Vg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com X-CSE-ConnectionGUID: 3kOW+QshRp2cQBpvXH/mbw== X-CSE-MsgGUID: 4bRUBYHhTRKlFm67aVp6Hw== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="23821203" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="23821203" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:28:56 -0700 X-CSE-ConnectionGUID: u7ozXfdDQlyZg0xj64Fwpg== X-CSE-MsgGUID: 6BCTSqMYT8SubiDMHSGfnQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="34694966" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa010.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:28:52 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1sBdDN-0000000BJxg-3Sai; Mon, 27 May 2024 19:28:49 +0300 Date: Mon, 27 May 2024 19:28:49 +0300 From: Andy Shevchenko To: Jonathan Cameron Cc: Javier Carrasco , Greg Kroah-Hartman , "Rafael J. Wysocki" , Daniel Scally , Heikki Krogerus , Sakari Ailus , Jean Delvare , Guenter Roeck , Antoniu Miclaus , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Subject: Re: [PATCH v2 3/3] hwmon: (ltc2992) Use fwnode_for_each_available_child_node_scoped() Message-ID: References: <20240523-fwnode_for_each_available_child_node_scoped-v2-0-701f3a03f2fb@gmail.com> <20240523-fwnode_for_each_available_child_node_scoped-v2-3-701f3a03f2fb@gmail.com> <20240526144851.493dd3f2@jic23-huawei> <20240527155717.58292509@jic23-huawei> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240527155717.58292509@jic23-huawei> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, May 27, 2024 at 03:57:17PM +0100, Jonathan Cameron wrote: > On Mon, 27 May 2024 17:30:10 +0300 > Andy Shevchenko wrote: > > Sun, May 26, 2024 at 02:48:51PM +0100, Jonathan Cameron kirjoitti: > > > On Thu, 23 May 2024 17:47:16 +0200 > > > Javier Carrasco wrote: .. > > > This looks like another instances of the lack of clarify about > > > what device_for_each_child_node[_scoped]() guarantees about node availability. > > > On DT it guarantees the node is available as ultimately calls > > > of_get_next_available_child() > > > > > > On ACPI it doesn't (I think). > > > For swnode, there isn't an obvious concept of available. > > > > > > It would be much better if we reached some agreement on this and > > > hence could avoid using the fwnode variants just to get the _available_ form > > > as done here. > > > > > Or just add the device_for_each_available_child_node[_scoped]() > > > and call that in almost all cases. > > > > device_for_each*() _implies_ availability. You need to talk to Rob about all > > this. The design of the device_for_each*() was exactly done in accordance with > > his suggestions... > > Does it imply that for ACPI? I can't find a query of _STA in the callbacks > (which is there for the for fwnode_*available calls. IIRC for ACPI/swnode the availability is always "yes" as long as property can be found. Basically it means the fwnode_*() == fwnode_*available() for these back-ends. AFAIU ACPI concept here is that once parsed and namespaced (in terms of putting the respective part of description table into ACPI namespace) it's lways available. Otherwise it's not, but at the same time the respective child node (property) may not be found > Mind you it wouldn't be the first time I've missed something in the ACPI parsing > code, so maybe it is there indirectly. I might have a weak memory, but see my understanding above. > I know from previous discussions that the DT version was intentional, but > I'm nervous that the same assumptions don't apply to ACPI. > > > > In generic code, do we ever want to walk unavailable child nodes? > > > > ...which are most likely like your question here, i.e. why we ever need to > > traverse over unavailable nodes. -- With Best Regards, Andy Shevchenko