From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 535772FFDEB; Fri, 6 Mar 2026 13:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772804291; cv=none; b=VUFAeyngfzgLg0m3IKj9h1APF7o8EeBxqTC/UOFRMbA6Q0Xn2EhSwo+Mx7pB0+2alwh6Kgmq0wXKC8hSbO3NRPvC7YPG4RLBY/ZKk3bWiH4twpJ9TyVvmz3LA5vPh9eNs3jztY1EsA+s3kECUWADoyGNqcyYpGvc+HHamXpjbvc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772804291; c=relaxed/simple; bh=/X6zVb6fLuL5VCnI7k40OgzmqM2kfpen+KHrEjgS9lA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JCUfOOjOYgOTmenW4QPj4gdLkdW94MXpPY3M8nn9JkWAdhZaSh/HllVx0AYEDUoSmtfYiKm7+9+nPiQNHvgsdA/tPZYtJJrgnA2oZDwux0T1mfyDiIXwiGPB4++DdAYlkh9Dw5+wALU0Gq6V73rsaBZ0lcp40UagPN/gmg6p6M4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NuY0X8/t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NuY0X8/t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94DB3C4CEF7; Fri, 6 Mar 2026 13:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772804290; bh=/X6zVb6fLuL5VCnI7k40OgzmqM2kfpen+KHrEjgS9lA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NuY0X8/tfBXFxxo33X2/UXArIb0QDxqzPgYxin4z3yyLxuNBHRxFMUi0J4uusxhRp tdKxXthNazq4Pm1LEirp3ZeOwWUua9TA2dlSFTYsSsoeIT5hqIG+wjaReHr/xa/tG8 D9Xs+VuIg+jS5HaG7xr9RkjScYARdvk1s30z4U3KasAv9avT5l3OVMBiAZe65Nsr9Q Gn3fXgRAkdbveVGJhR5w2bJ+1qDtfOrtPf5+hX2iquIt5cMl6+/Hzxvs3rCQ6cnlj0 nsTKvRtHdAm1ObkgPVBknh2ngHi/AVChbD5nNyPnq6je3Yt9fB1xMF+wtdkBJhbOD1 q5ewRWcqrI2JQ== Date: Fri, 6 Mar 2026 13:38:06 +0000 From: Lee Jones To: Brian Mak Cc: Herve Codina , Andy Shevchenko , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] mfd: core: Preserve OF node when ACPI handle is present Message-ID: <20260306133806.GM183676@google.com> References: <20260226224511.458065-1-makb@juniper.net> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260226224511.458065-1-makb@juniper.net> On Thu, 26 Feb 2026, Brian Mak wrote: > Switch device_set_node to set_primary_fwnode, so that the ACPI fwnode > does not overwrite the of_node with NULL. > > This allows MFD children with both OF nodes and ACPI handles to have OF > nodes again. > > Fixes: 51e3b257099d ("mfd: core: Make use of device_set_node()") > Cc: stable@vger.kernel.org > Signed-off-by: Brian Mak > --- > drivers/mfd/mfd-core.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c > index 6be58eb5a746..5c5465763312 100644 > --- a/drivers/mfd/mfd-core.c > +++ b/drivers/mfd/mfd-core.c > @@ -88,7 +88,20 @@ static void mfd_acpi_add_device(const struct mfd_cell *cell, > } > } > > - device_set_node(&pdev->dev, acpi_fwnode_handle(adev ?: parent)); > + /* > + * FIXME: The fwnode design doesn't allow proper stacking/sharing. This So when will this be fixed exactly? > + * should eventually turn into a device fwnode API call that will allow > + * prepending to a list of fwnodes (with ACPI taking precedence). > + * > + * set_primary_fwnode() is used here, instead of device_set_node(), as > + * device_set_node() will overwrite the existing fwnode, which may be an > + * OF node that was populated earlier. To support a use case where ACPI > + * and OF is used in conjunction, we call set_primary_fwnode() instead. > + */ > + if (adev) > + set_primary_fwnode(&pdev->dev, acpi_fwnode_handle(adev)); > + else > + set_primary_fwnode(&pdev->dev, acpi_fwnode_handle(parent)); > } > #else > static inline void mfd_acpi_add_device(const struct mfd_cell *cell, > > base-commit: d9d32e5bd5a4e57675f2b70ddf73c3dc5cf44fc2 > -- > 2.25.1 > -- Lee Jones [李琼斯]