From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A4AAB3BD225; Thu, 13 Aug 2026 12:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786624732; cv=none; b=G3YRrO5YWlopvIYXznvyNUVyrqGd2VhQkCI5794KUg2UkGr8RVd7SpzinG7ZwUNr25hQNCk30+bGGQRxxamqc/9OykKC2WxSj/33SdEz6QxYF7HZppT960XFA/ReJdkO8KeJj1on8Q2qd2O8jf6dauD7sPJfsWBd5gX7VhE9XEw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786624732; c=relaxed/simple; bh=l6kqcTsMKzlAtJHGFOG2awd1t7J9zIBNdmxrYPkmxNQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PijT8Ye/mdSYaoLN4RuZDxIuQkbApxoqbnBHHuy4NFYrGHS+OyLTX41hywogk6jLhlKnNyg6uBMhM68xOmBZckGW+yKTrcToBcFc/H+UzrkTsjUMyz3sdG8+l/42Ch/spEUAX24DVBKskzihgJsLjMPhotmYQqXX7pvEGFg/fso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D/qsNX5x; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D/qsNX5x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 048DF1F000E9; Thu, 13 Aug 2026 12:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786624731; bh=LBP1ThiJDiqMaPUW1k9BGd4ceLpbU1ZyA9FI9qbdQ7Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=D/qsNX5xklT6SE2DiETI0i94S7g9+6U0xsNx33gQlU6zUQCsgryLjqLfDMnmhYOK0 2bhiDt7foF/iK0glpKcOAc4o423Ry/3L7VJIfn0JWywvQBTEi9bZ5oaTPDO4tLpREj b4S/5B5/kH41ebLY4v53hDfK4NlYeXuf3Dxf+yJPB9WBdFOgt0TgJk7hf8obw7M97y 6asPwAjuwjFHg7BA9TStZb44VKxrFf1uisjJYptSpigN0bG5dm6XRMFrbUK0ZaiXIO sKfUjOinvtJiMtcSjBxsRgMjbKnuGCG5kP6FmpQNdBeBug+typBAs53ml0rnrSP2JU Lc7O/qslA0ouA== Date: Thu, 13 Aug 2026 13:38:41 +0100 From: Lee Jones To: Shivendra Pratap Cc: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Srinivas Kandagatla , Bartosz Golaszewski Subject: Re: [PATCH v24 04/12] mfd: psci-mfd: Add PSCI MFD driver for cpuidle-psci-domain cell Message-ID: <20260813123841.GC1820248@google.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> <20260803-arm-psci-system_reset2-vendor-reboots-v24-4-889281373870@oss.qualcomm.com> 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: <20260803-arm-psci-system_reset2-vendor-reboots-v24-4-889281373870@oss.qualcomm.com> On Mon, 03 Aug 2026, Shivendra Pratap wrote: > PSCI has multiple kernel consumers, such as cpuidle-psci-domain. > Currently, both the PSCI core driver and cpuidle-psci-domain bind > directly to the same PSCI node "arm,psci-1.0". Additional consumers, if > introduced, would also need to bind in the same way, leading to several > drivers attached to a single device node. > > Introduce a PSCI MFD driver that binds to "arm,psci-1.0" and registers > PSCI child cells. As the first user, register cpuidle-psci-domain as a > child cell. > > Update cpuidle-psci-domain to probe as an MFD child and use the parent > PSCI node for power-domain traversal. > > Suggested-by: Bartosz Golaszewski > Reviewed-by: Bartosz Golaszewski > Signed-off-by: Shivendra Pratap > --- > MAINTAINERS | 1 + > drivers/cpuidle/Kconfig.arm | 1 + > drivers/cpuidle/cpuidle-psci-domain.c | 9 +------- > drivers/mfd/Kconfig | 12 ++++++++++ > drivers/mfd/Makefile | 2 ++ > drivers/mfd/psci-mfd.c | 43 +++++++++++++++++++++++++++++++++++ We don't usually allow the use of the term MFD in devices. What does this do? Is it a mux? psci-mux? If not, think about what it is and call it that instead. > 6 files changed, 60 insertions(+), 8 deletions(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index fe67f7bfa44c..0b6e4f89f319 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -21671,6 +21671,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) > S: Maintained > F: Documentation/devicetree/bindings/arm/psci.yaml > F: drivers/firmware/psci/ > +F: drivers/mfd/psci-mfd.c > F: include/linux/psci.h > F: include/uapi/linux/psci.h > > diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm > index b88b01aa5829..c5ecca0d7397 100644 > --- a/drivers/cpuidle/Kconfig.arm > +++ b/drivers/cpuidle/Kconfig.arm > @@ -36,6 +36,7 @@ config ARM_PSCI_CPUIDLE_DOMAIN > bool "PSCI CPU idle Domain" > depends on ARM_PSCI_CPUIDLE > depends on PM_GENERIC_DOMAINS_OF > + depends on MFD_PSCI > select DT_IDLE_GENPD > default y > help > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c > index b9e4ad7d43a3..a2d01810f295 100644 > --- a/drivers/cpuidle/cpuidle-psci-domain.c > +++ b/drivers/cpuidle/cpuidle-psci-domain.c > @@ -17,7 +17,6 @@ > #include > #include > #include > -#include > > #include "cpuidle-psci.h" > #include "dt_idle_genpd.h" > @@ -122,14 +121,9 @@ static void psci_pd_remove(void) > } > } > > -static const struct of_device_id psci_of_match[] = { > - { .compatible = "arm,psci-1.0" }, > - {} > -}; > - > static int psci_cpuidle_domain_probe(struct platform_device *pdev) > { > - struct device_node *np = pdev->dev.of_node; > + struct device_node *np = pdev->dev.parent->of_node; dev_of_node(pdev->dev.parent); > bool use_osi = psci_has_osi_support(); > int ret = 0, pd_count = 0; > > @@ -181,7 +175,6 @@ static struct platform_driver psci_cpuidle_domain_driver = { > .probe = psci_cpuidle_domain_probe, > .driver = { > .name = "psci-cpuidle-domain", > - .of_match_table = psci_of_match, > }, > }; > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > index e4fd4572472f..d18655d76172 100644 > --- a/drivers/mfd/Kconfig > +++ b/drivers/mfd/Kconfig > @@ -2374,6 +2374,18 @@ config MFD_KHADAS_MCU > additional drivers must be enabled in order to use the functionality > of the device. > > +config MFD_PSCI > + bool "PSCI MFD for psci child cells" "PSCI mux for registering PSCI component devices" ? > + depends on ARM_PSCI_FW > + depends on OF > + select MFD_CORE > + default y > + help > + PSCI MFD registers PSCI child cells and exposes them as > + platform devices. This is what all DT related MFD devices do. > + Child drivers are probed only if enabled in the > + kernel configuration. Nothing new here either. This is the norm. "PSCI Mux is a Linux specific device splitter designed to register multiple PSCI related components via a single Device Tree compatible. Without it, devices would each bind to a single node ... " > + Select this option whenever a supported PSCI > + child driver is selected. > + > config MFD_ACER_A500_EC > tristate "Support for Acer Iconia Tab A500 Embedded Controller" > depends on I2C > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > index 72d3944b0ad8..f3edfad702ff 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile > @@ -24,6 +24,8 @@ obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o > obj-$(CONFIG_MFD_GATEWORKS_GSC) += gateworks-gsc.o > obj-$(CONFIG_MFD_MACSMC) += macsmc.o > > +obj-$(CONFIG_MFD_PSCI) += psci-mfd.o > + > obj-$(CONFIG_MFD_TI_LP873X) += lp873x.o > obj-$(CONFIG_MFD_TI_LP87565) += lp87565.o > obj-$(CONFIG_MFD_TI_AM335X_TSCADC) += ti_am335x_tscadc.o > diff --git a/drivers/mfd/psci-mfd.c b/drivers/mfd/psci-mfd.c > new file mode 100644 > index 000000000000..7affd6bb09dd > --- /dev/null > +++ b/drivers/mfd/psci-mfd.c > @@ -0,0 +1,43 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. > + */ > + > +#include > +#include > +#include > +#include > + > +static const struct mfd_cell psci_cells[] = { > + { > + .name = "psci-cpuidle-domain", > + }, > +}; MFD_CELL_NAME() ? MFD drivers have to support more than one device from the get-go. Please add your other device here in this patch. > +static int psci_mfd_probe(struct platform_device *pdev) No to _mfd_. > +{ > + return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells, > + ARRAY_SIZE(psci_cells), NULL, 0, NULL); > +} > + > +static const struct of_device_id psci_mfd_of_match[] = { > + { .compatible = "arm,psci-1.0" }, > + { } > +}; > + > +static struct platform_driver psci_mfd_driver = { > + .probe = psci_mfd_probe, > + .driver = { > + .name = "psci-mfd", > + .of_match_table = psci_mfd_of_match, > + }, > +}; > + > +static int __init psci_mfd_init(void) > +{ > + return platform_driver_register(&psci_mfd_driver); > +} > + Remove this line. > +core_initcall(psci_mfd_init); This is usually a hack. Why can't you use -EPROBE_DEFER? > + > +MODULE_LICENSE("GPL"); > > -- > 2.34.1 > -- Lee Jones