From 3d123f513af055b4c085b555f9c856bbd7390536 Mon Sep 17 00:00:00 2001 From: Sibi Sankar Date: Thu, 23 Nov 2023 15:30:20 +0530 Subject: [PATCH 01/19] dt-bindings: power: rpmpd: Update part number to X1E80100 There was a recent part number update from SC8380XP to X1E80100 and as a result of which the SC8380xp rpmpd bindings introduced is no longer correct. Given that it currently has no users, it was agreed that it can be updated to the correct part number (X1E80100) without causing any binding breakage. Signed-off-by: Sibi Sankar Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231123100021.10918-2-quic_sibis@quicinc.com Signed-off-by: Ulf Hansson --- Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml index da9c5846f4e1..2ff246cf8b81 100644 --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml @@ -39,7 +39,6 @@ properties: - qcom,sc7280-rpmhpd - qcom,sc8180x-rpmhpd - qcom,sc8280xp-rpmhpd - - qcom,sc8380xp-rpmhpd - qcom,sdm660-rpmpd - qcom,sdm670-rpmhpd - qcom,sdm845-rpmhpd @@ -57,6 +56,7 @@ properties: - qcom,sm8450-rpmhpd - qcom,sm8550-rpmhpd - qcom,sm8650-rpmhpd + - qcom,x1e80100-rpmhpd - items: - enum: - qcom,msm8937-rpmpd From e60b6c183e1d2925c94987d2754ae1378c0181b7 Mon Sep 17 00:00:00 2001 From: Sibi Sankar Date: Thu, 23 Nov 2023 15:30:21 +0530 Subject: [PATCH 02/19] pmdomain: qcom: rpmhpd: Update part number to X1E80100 There was a recent part number update from SC8380XP to X1E80100 and as a result of which SC8380xp prefix introduced in the rpmhpd driver is no longer correct. Update it to X1E80100, to reflect the bindings change. Signed-off-by: Sibi Sankar Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231123100021.10918-3-quic_sibis@quicinc.com Signed-off-by: Ulf Hansson --- drivers/pmdomain/qcom/rpmhpd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pmdomain/qcom/rpmhpd.c b/drivers/pmdomain/qcom/rpmhpd.c index f2e64324deb8..3078896b1300 100644 --- a/drivers/pmdomain/qcom/rpmhpd.c +++ b/drivers/pmdomain/qcom/rpmhpd.c @@ -598,8 +598,8 @@ static const struct rpmhpd_desc sc8280xp_desc = { .num_pds = ARRAY_SIZE(sc8280xp_rpmhpds), }; -/* SC8380xp RPMH powerdomains */ -static struct rpmhpd *sc8380xp_rpmhpds[] = { +/* X1E80100 RPMH powerdomains */ +static struct rpmhpd *x1e80100_rpmhpds[] = { [RPMHPD_CX] = &cx, [RPMHPD_CX_AO] = &cx_ao, [RPMHPD_EBI] = &ebi, @@ -615,9 +615,9 @@ static struct rpmhpd *sc8380xp_rpmhpds[] = { [RPMHPD_GMXC] = &gmxc, }; -static const struct rpmhpd_desc sc8380xp_desc = { - .rpmhpds = sc8380xp_rpmhpds, - .num_pds = ARRAY_SIZE(sc8380xp_rpmhpds), +static const struct rpmhpd_desc x1e80100_desc = { + .rpmhpds = x1e80100_rpmhpds, + .num_pds = ARRAY_SIZE(x1e80100_rpmhpds), }; static const struct of_device_id rpmhpd_match_table[] = { @@ -629,7 +629,6 @@ static const struct of_device_id rpmhpd_match_table[] = { { .compatible = "qcom,sc7280-rpmhpd", .data = &sc7280_desc }, { .compatible = "qcom,sc8180x-rpmhpd", .data = &sc8180x_desc }, { .compatible = "qcom,sc8280xp-rpmhpd", .data = &sc8280xp_desc }, - { .compatible = "qcom,sc8380xp-rpmhpd", .data = &sc8380xp_desc }, { .compatible = "qcom,sdm670-rpmhpd", .data = &sdm670_desc }, { .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc }, { .compatible = "qcom,sdx55-rpmhpd", .data = &sdx55_desc}, @@ -643,6 +642,7 @@ static const struct of_device_id rpmhpd_match_table[] = { { .compatible = "qcom,sm8450-rpmhpd", .data = &sm8450_desc }, { .compatible = "qcom,sm8550-rpmhpd", .data = &sm8550_desc }, { .compatible = "qcom,sm8650-rpmhpd", .data = &sm8650_desc }, + { .compatible = "qcom,x1e80100-rpmhpd", .data = &x1e80100_desc }, { } }; MODULE_DEVICE_TABLE(of, rpmhpd_match_table); From 820cec125970b37cbbd0fa026b314c5e6094fcbf Mon Sep 17 00:00:00 2001 From: Sudeep Holla Date: Thu, 23 Nov 2023 12:08:46 +0000 Subject: [PATCH 03/19] pmdomain: arm_scmi: Move Kconfig options to the pmdomain subsystem The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the firmware to the pmdomain subsystem. Signed-off-by: Sudeep Holla Link: https://lore.kernel.org/r/20231123120847.2825444-1-sudeep.holla@arm.com Signed-off-by: Ulf Hansson --- drivers/firmware/arm_scmi/Kconfig | 25 ------------------------- drivers/pmdomain/Kconfig | 1 + drivers/pmdomain/arm/Kconfig | 25 +++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 drivers/pmdomain/arm/Kconfig diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig index 706d1264d038..aa5842be19b2 100644 --- a/drivers/firmware/arm_scmi/Kconfig +++ b/drivers/firmware/arm_scmi/Kconfig @@ -168,31 +168,6 @@ config ARM_SCMI_TRANSPORT_VIRTIO_ATOMIC_ENABLE endif #ARM_SCMI_PROTOCOL -config ARM_SCMI_POWER_DOMAIN - tristate "SCMI power domain driver" - depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF) - default y - select PM_GENERIC_DOMAINS if PM - help - This enables support for the SCMI power domains which can be - enabled or disabled via the SCP firmware - - This driver can also be built as a module. If so, the module - will be called scmi_pm_domain. Note this may needed early in boot - before rootfs may be available. - -config ARM_SCMI_PERF_DOMAIN - tristate "SCMI performance domain driver" - depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF) - default y - select PM_GENERIC_DOMAINS if PM - help - This enables support for the SCMI performance domains which can be - enabled or disabled via the SCP firmware. - - This driver can also be built as a module. If so, the module will be - called scmi_perf_domain. - config ARM_SCMI_POWER_CONTROL tristate "SCMI system power control driver" depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF) diff --git a/drivers/pmdomain/Kconfig b/drivers/pmdomain/Kconfig index c98c5bf75a14..23c64851a5b0 100644 --- a/drivers/pmdomain/Kconfig +++ b/drivers/pmdomain/Kconfig @@ -4,6 +4,7 @@ menu "PM Domains" source "drivers/pmdomain/actions/Kconfig" source "drivers/pmdomain/amlogic/Kconfig" source "drivers/pmdomain/apple/Kconfig" +source "drivers/pmdomain/arm/Kconfig" source "drivers/pmdomain/bcm/Kconfig" source "drivers/pmdomain/imx/Kconfig" source "drivers/pmdomain/mediatek/Kconfig" diff --git a/drivers/pmdomain/arm/Kconfig b/drivers/pmdomain/arm/Kconfig new file mode 100644 index 000000000000..acbe4331aaf7 --- /dev/null +++ b/drivers/pmdomain/arm/Kconfig @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: GPL-2.0-only +config ARM_SCMI_PERF_DOMAIN + tristate "SCMI performance domain driver" + depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF) + default y + select PM_GENERIC_DOMAINS if PM + help + This enables support for the SCMI performance domains which can be + enabled or disabled via the SCP firmware. + + This driver can also be built as a module. If so, the module will be + called scmi_perf_domain. + +config ARM_SCMI_POWER_DOMAIN + tristate "SCMI power domain driver" + depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF) + default y + select PM_GENERIC_DOMAINS if PM + help + This enables support for the SCMI power domains which can be + enabled or disabled via the SCP firmware + + This driver can also be built as a module. If so, the module + will be called scmi_pm_domain. Note this may needed early in boot + before rootfs may be available. From 62b14b9e86a1c94b1a2f41a52adcfda822a9863e Mon Sep 17 00:00:00 2001 From: Sudeep Holla Date: Thu, 23 Nov 2023 12:08:47 +0000 Subject: [PATCH 04/19] firmware: arm_scpi: Move power-domain driver to the pmdomain dir To simplify with maintenance let's move the Arm SCPI power-domain driver to the new pmdomain directory. Note this is different from and precedes the new Arm SCMI protocol. Signed-off-by: Sudeep Holla Link: https://lore.kernel.org/r/20231123120847.2825444-2-sudeep.holla@arm.com Signed-off-by: Ulf Hansson --- drivers/firmware/Kconfig | 9 --------- drivers/firmware/Makefile | 1 - drivers/pmdomain/arm/Kconfig | 12 ++++++++++++ drivers/pmdomain/arm/Makefile | 1 + drivers/{firmware => pmdomain/arm}/scpi_pm_domain.c | 0 5 files changed, 13 insertions(+), 10 deletions(-) rename drivers/{firmware => pmdomain/arm}/scpi_pm_domain.c (100%) diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 4a98a859d44d..afeb050ae1b4 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -28,15 +28,6 @@ config ARM_SCPI_PROTOCOL This protocol library provides interface for all the client drivers making use of the features offered by the SCP. -config ARM_SCPI_POWER_DOMAIN - tristate "SCPI power domain driver" - depends on ARM_SCPI_PROTOCOL || (COMPILE_TEST && OF) - default y - select PM_GENERIC_DOMAINS if PM - help - This enables support for the SCPI power domains which can be - enabled or disabled via the SCP firmware - config ARM_SDE_INTERFACE bool "ARM Software Delegated Exception Interface (SDEI)" depends on ARM64 diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 5f9dab82e1a0..944833702ebd 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -3,7 +3,6 @@ # Makefile for the linux kernel. # obj-$(CONFIG_ARM_SCPI_PROTOCOL) += arm_scpi.o -obj-$(CONFIG_ARM_SCPI_POWER_DOMAIN) += scpi_pm_domain.o obj-$(CONFIG_ARM_SDE_INTERFACE) += arm_sdei.o obj-$(CONFIG_DMI) += dmi_scan.o obj-$(CONFIG_DMI_SYSFS) += dmi-sysfs.o diff --git a/drivers/pmdomain/arm/Kconfig b/drivers/pmdomain/arm/Kconfig index acbe4331aaf7..efa139c34e08 100644 --- a/drivers/pmdomain/arm/Kconfig +++ b/drivers/pmdomain/arm/Kconfig @@ -23,3 +23,15 @@ config ARM_SCMI_POWER_DOMAIN This driver can also be built as a module. If so, the module will be called scmi_pm_domain. Note this may needed early in boot before rootfs may be available. + +config ARM_SCPI_POWER_DOMAIN + tristate "SCPI power domain driver" + depends on ARM_SCPI_PROTOCOL || (COMPILE_TEST && OF) + default y + select PM_GENERIC_DOMAINS if PM + help + This enables support for the SCPI power domains which can be + enabled or disabled via the SCP firmware + + This driver can also be built as a module. If so, the module will be + called scpi_pm_domain. diff --git a/drivers/pmdomain/arm/Makefile b/drivers/pmdomain/arm/Makefile index cfcb1f6cdd90..502fe4d0a83e 100644 --- a/drivers/pmdomain/arm/Makefile +++ b/drivers/pmdomain/arm/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_ARM_SCMI_PERF_DOMAIN) += scmi_perf_domain.o obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o +obj-$(CONFIG_ARM_SCPI_POWER_DOMAIN) += scpi_pm_domain.o diff --git a/drivers/firmware/scpi_pm_domain.c b/drivers/pmdomain/arm/scpi_pm_domain.c similarity index 100% rename from drivers/firmware/scpi_pm_domain.c rename to drivers/pmdomain/arm/scpi_pm_domain.c From f32f977fa8ab1d2fde0cd7136e0d0393fce31d84 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 23 Nov 2023 17:17:41 +0100 Subject: [PATCH 05/19] dt-bindings: power: meson-g12a-power: document ISP power domain Add MIPI ISP power domain ID to the G12A Power domains bindings header Signed-off-by: Neil Armstrong Reviewed-by: Daniel Scally Tested-by: Daniel Scally Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231123-topic-amlogic-upstream-isp-pmdomain-v2-1-61f2fcf709e5@linaro.org Signed-off-by: Ulf Hansson --- include/dt-bindings/power/meson-g12a-power.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dt-bindings/power/meson-g12a-power.h b/include/dt-bindings/power/meson-g12a-power.h index 44ec0c50e340..01fd0ac4dd08 100644 --- a/include/dt-bindings/power/meson-g12a-power.h +++ b/include/dt-bindings/power/meson-g12a-power.h @@ -10,5 +10,6 @@ #define PWRC_G12A_VPU_ID 0 #define PWRC_G12A_ETH_ID 1 #define PWRC_G12A_NNA_ID 2 +#define PWRC_G12A_ISP_ID 3 #endif From 6341e97b52b6238ed06dddc7ec22d025a9346a1e Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 23 Nov 2023 17:17:42 +0100 Subject: [PATCH 06/19] pmdomain: amlogic: meson-ee-pwrc: add support for G12A ISP power domain Add entries for the ISP power domain found in the Amlogic G12B SoC Signed-off-by: Neil Armstrong Reviewed-by: Daniel Scally Tested-by: Daniel Scally Link: https://lore.kernel.org/r/20231123-topic-amlogic-upstream-isp-pmdomain-v2-2-61f2fcf709e5@linaro.org Signed-off-by: Ulf Hansson --- drivers/pmdomain/amlogic/meson-ee-pwrc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c index 0dd71cd814c5..fcec6eb610e4 100644 --- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c +++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c @@ -47,6 +47,8 @@ #define G12A_HHI_NANOQ_MEM_PD_REG0 (0x43 << 2) #define G12A_HHI_NANOQ_MEM_PD_REG1 (0x44 << 2) +#define G12A_HHI_ISP_MEM_PD_REG0 (0x45 << 2) +#define G12A_HHI_ISP_MEM_PD_REG1 (0x46 << 2) struct meson_ee_pwrc; struct meson_ee_pwrc_domain; @@ -115,6 +117,13 @@ static struct meson_ee_pwrc_top_domain g12a_pwrc_nna = { .iso_mask = BIT(16) | BIT(17), }; +static struct meson_ee_pwrc_top_domain g12a_pwrc_isp = { + .sleep_reg = GX_AO_RTI_GEN_PWR_SLEEP0, + .sleep_mask = BIT(18) | BIT(19), + .iso_reg = GX_AO_RTI_GEN_PWR_ISO0, + .iso_mask = BIT(18) | BIT(19), +}; + /* Memory PD Domains */ #define VPU_MEMPD(__reg) \ @@ -231,6 +240,11 @@ static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = { { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(31, 0) }, }; +static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_isp[] = { + { G12A_HHI_ISP_MEM_PD_REG0, GENMASK(31, 0) }, + { G12A_HHI_ISP_MEM_PD_REG1, GENMASK(31, 0) }, +}; + #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks) \ { \ .name = __name, \ @@ -269,6 +283,8 @@ static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = { [PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth), [PWRC_G12A_NNA_ID] = TOP_PD("NNA", &g12a_pwrc_nna, g12a_pwrc_mem_nna, pwrc_ee_is_powered_off), + [PWRC_G12A_ISP_ID] = TOP_PD("ISP", &g12a_pwrc_isp, g12a_pwrc_mem_isp, + pwrc_ee_is_powered_off), }; static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = { From b3dff2e97c614c1b60083898ffb42010ca16992e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:25 +0100 Subject: [PATCH 07/19] pmdomain: imx-pgc: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-2-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/imx/gpc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c index 7d81e3171d39..d6cf3759570b 100644 --- a/drivers/pmdomain/imx/gpc.c +++ b/drivers/pmdomain/imx/gpc.c @@ -212,7 +212,7 @@ genpd_err: return ret; } -static int imx_pgc_power_domain_remove(struct platform_device *pdev) +static void imx_pgc_power_domain_remove(struct platform_device *pdev) { struct imx_pm_domain *domain = pdev->dev.platform_data; @@ -221,8 +221,6 @@ static int imx_pgc_power_domain_remove(struct platform_device *pdev) pm_genpd_remove(&domain->base); imx_pgc_put_clocks(domain); } - - return 0; } static const struct platform_device_id imx_pgc_power_domain_id[] = { @@ -235,7 +233,7 @@ static struct platform_driver imx_pgc_power_domain_driver = { .name = "imx-pgc-pd", }, .probe = imx_pgc_power_domain_probe, - .remove = imx_pgc_power_domain_remove, + .remove_new = imx_pgc_power_domain_remove, .id_table = imx_pgc_power_domain_id, }; builtin_platform_driver(imx_pgc_power_domain_driver) From da07c5871d18157608a0d0702cb093168d79080a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:26 +0100 Subject: [PATCH 08/19] pmdomain: imx-gpc: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). In the error path emit an error message replacing the (less useful) message by the core. Apart from the improved error message there is no change in behaviour. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-3-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/imx/gpc.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c index d6cf3759570b..9517cce93d8a 100644 --- a/drivers/pmdomain/imx/gpc.c +++ b/drivers/pmdomain/imx/gpc.c @@ -509,7 +509,7 @@ static int imx_gpc_probe(struct platform_device *pdev) return 0; } -static int imx_gpc_remove(struct platform_device *pdev) +static void imx_gpc_remove(struct platform_device *pdev) { struct device_node *pgc_node; int ret; @@ -519,7 +519,7 @@ static int imx_gpc_remove(struct platform_device *pdev) /* bail out if DT too old and doesn't provide the necessary info */ if (!of_property_read_bool(pdev->dev.of_node, "#power-domain-cells") && !pgc_node) - return 0; + return; /* * If the old DT binding is used the toplevel driver needs to @@ -529,16 +529,20 @@ static int imx_gpc_remove(struct platform_device *pdev) of_genpd_del_provider(pdev->dev.of_node); ret = pm_genpd_remove(&imx_gpc_domains[GPC_PGC_DOMAIN_PU].base); - if (ret) - return ret; + if (ret) { + dev_err(&pdev->dev, "Failed to remove PU power domain (%pe)\n", + ERR_PTR(ret)); + return; + } imx_pgc_put_clocks(&imx_gpc_domains[GPC_PGC_DOMAIN_PU]); ret = pm_genpd_remove(&imx_gpc_domains[GPC_PGC_DOMAIN_ARM].base); - if (ret) - return ret; + if (ret) { + dev_err(&pdev->dev, "Failed to remove ARM power domain (%pe)\n", + ERR_PTR(ret)); + return; + } } - - return 0; } static struct platform_driver imx_gpc_driver = { @@ -547,6 +551,6 @@ static struct platform_driver imx_gpc_driver = { .of_match_table = imx_gpc_dt_ids, }, .probe = imx_gpc_probe, - .remove = imx_gpc_remove, + .remove_new = imx_gpc_remove, }; builtin_platform_driver(imx_gpc_driver) From 697bc6c8ab0af49b6ff0244f8ae8380a42898521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:27 +0100 Subject: [PATCH 09/19] pmdomain: imx-gpcv2: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-4-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/imx/gpcv2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/imx/gpcv2.c b/drivers/pmdomain/imx/gpcv2.c index fbd3d92f8cd8..4b828d74a606 100644 --- a/drivers/pmdomain/imx/gpcv2.c +++ b/drivers/pmdomain/imx/gpcv2.c @@ -1373,7 +1373,7 @@ out_domain_unmap: return ret; } -static int imx_pgc_domain_remove(struct platform_device *pdev) +static void imx_pgc_domain_remove(struct platform_device *pdev) { struct imx_pgc_domain *domain = pdev->dev.platform_data; @@ -1385,8 +1385,6 @@ static int imx_pgc_domain_remove(struct platform_device *pdev) domain->bits.map, 0); pm_runtime_disable(domain->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1430,7 +1428,7 @@ static struct platform_driver imx_pgc_domain_driver = { .pm = &imx_pgc_domain_pm_ops, }, .probe = imx_pgc_domain_probe, - .remove = imx_pgc_domain_remove, + .remove_new = imx_pgc_domain_remove, .id_table = imx_pgc_domain_id, }; builtin_platform_driver(imx_pgc_domain_driver) From eeba351945b72da4bc58d842ff9d4a90a39aaf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:28 +0100 Subject: [PATCH 10/19] pmdomain: imx8m-blk-ctrl: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-5-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/imx/imx8m-blk-ctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/imx/imx8m-blk-ctrl.c b/drivers/pmdomain/imx/imx8m-blk-ctrl.c index cc5ef6e2f0a8..1341a707f61b 100644 --- a/drivers/pmdomain/imx/imx8m-blk-ctrl.c +++ b/drivers/pmdomain/imx/imx8m-blk-ctrl.c @@ -330,7 +330,7 @@ cleanup_pds: return ret; } -static int imx8m_blk_ctrl_remove(struct platform_device *pdev) +static void imx8m_blk_ctrl_remove(struct platform_device *pdev) { struct imx8m_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); int i; @@ -347,8 +347,6 @@ static int imx8m_blk_ctrl_remove(struct platform_device *pdev) dev_pm_genpd_remove_notifier(bc->bus_power_dev); dev_pm_domain_detach(bc->bus_power_dev, true); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -888,7 +886,7 @@ MODULE_DEVICE_TABLE(of, imx8m_blk_ctrl_of_match); static struct platform_driver imx8m_blk_ctrl_driver = { .probe = imx8m_blk_ctrl_probe, - .remove = imx8m_blk_ctrl_remove, + .remove_new = imx8m_blk_ctrl_remove, .driver = { .name = "imx8m-blk-ctrl", .pm = &imx8m_blk_ctrl_pm_ops, From 7476ddfd36ac65d2944b40373467c1c8eb0bc467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:29 +0100 Subject: [PATCH 11/19] pmdomain: imx8mp-blk-ctrl: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-6-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c index c6ac32c1a8c1..e3203eb6a022 100644 --- a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c +++ b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c @@ -760,7 +760,7 @@ cleanup_pds: return ret; } -static int imx8mp_blk_ctrl_remove(struct platform_device *pdev) +static void imx8mp_blk_ctrl_remove(struct platform_device *pdev) { struct imx8mp_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); int i; @@ -777,8 +777,6 @@ static int imx8mp_blk_ctrl_remove(struct platform_device *pdev) dev_pm_genpd_remove_notifier(bc->bus_power_dev); dev_pm_domain_detach(bc->bus_power_dev, true); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -856,7 +854,7 @@ MODULE_DEVICE_TABLE(of, imx8mp_blk_ctrl_of_match); static struct platform_driver imx8mp_blk_ctrl_driver = { .probe = imx8mp_blk_ctrl_probe, - .remove = imx8mp_blk_ctrl_remove, + .remove_new = imx8mp_blk_ctrl_remove, .driver = { .name = "imx8mp-blk-ctrl", .pm = &imx8mp_blk_ctrl_pm_ops, From 77647eb5546c01cee08c4716a3a5717f6016b086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:30 +0100 Subject: [PATCH 12/19] pmdomain: imx93-blk-ctrl: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-7-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/imx/imx93-blk-ctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-blk-ctrl.c b/drivers/pmdomain/imx/imx93-blk-ctrl.c index 40bd90f8b977..904ffa55b8f4 100644 --- a/drivers/pmdomain/imx/imx93-blk-ctrl.c +++ b/drivers/pmdomain/imx/imx93-blk-ctrl.c @@ -306,7 +306,7 @@ cleanup_pds: return ret; } -static int imx93_blk_ctrl_remove(struct platform_device *pdev) +static void imx93_blk_ctrl_remove(struct platform_device *pdev) { struct imx93_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); int i; @@ -318,8 +318,6 @@ static int imx93_blk_ctrl_remove(struct platform_device *pdev) pm_genpd_remove(&domain->genpd); } - - return 0; } static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] = { @@ -438,7 +436,7 @@ MODULE_DEVICE_TABLE(of, imx93_blk_ctrl_of_match); static struct platform_driver imx93_blk_ctrl_driver = { .probe = imx93_blk_ctrl_probe, - .remove = imx93_blk_ctrl_remove, + .remove_new = imx93_blk_ctrl_remove, .driver = { .name = "imx93-blk-ctrl", .of_match_table = imx93_blk_ctrl_of_match, From 673c09bc6e134e6277b58e24caf29ed0746ea08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:31 +0100 Subject: [PATCH 13/19] pmdomain: imx93-pd: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-8-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/imx/imx93-pd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c index b9e60d136875..1e94b499c19b 100644 --- a/drivers/pmdomain/imx/imx93-pd.c +++ b/drivers/pmdomain/imx/imx93-pd.c @@ -83,7 +83,7 @@ static int imx93_pd_off(struct generic_pm_domain *genpd) return 0; }; -static int imx93_pd_remove(struct platform_device *pdev) +static void imx93_pd_remove(struct platform_device *pdev) { struct imx93_power_domain *domain = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -94,8 +94,6 @@ static int imx93_pd_remove(struct platform_device *pdev) of_genpd_del_provider(np); pm_genpd_remove(&domain->genpd); - - return 0; } static int imx93_pd_probe(struct platform_device *pdev) @@ -167,7 +165,7 @@ static struct platform_driver imx93_power_domain_driver = { .of_match_table = imx93_pd_ids, }, .probe = imx93_pd_probe, - .remove = imx93_pd_remove, + .remove_new = imx93_pd_remove, }; module_platform_driver(imx93_power_domain_driver); From 4b7599a5e847d4263e25f7e5d7d381792fcb5726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:32 +0100 Subject: [PATCH 14/19] pmdomain: qcom-cpr: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231124080623.564924-9-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/qcom/cpr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/qcom/cpr.c b/drivers/pmdomain/qcom/cpr.c index e9dd42bded6f..c64e84a27cc7 100644 --- a/drivers/pmdomain/qcom/cpr.c +++ b/drivers/pmdomain/qcom/cpr.c @@ -1712,7 +1712,7 @@ err_remove_genpd: return ret; } -static int cpr_remove(struct platform_device *pdev) +static void cpr_remove(struct platform_device *pdev) { struct cpr_drv *drv = platform_get_drvdata(pdev); @@ -1725,8 +1725,6 @@ static int cpr_remove(struct platform_device *pdev) pm_genpd_remove(&drv->pd); debugfs_remove_recursive(drv->debugfs); - - return 0; } static const struct of_device_id cpr_match_table[] = { @@ -1737,7 +1735,7 @@ MODULE_DEVICE_TABLE(of, cpr_match_table); static struct platform_driver cpr_driver = { .probe = cpr_probe, - .remove = cpr_remove, + .remove_new = cpr_remove, .driver = { .name = "qcom-cpr", .of_match_table = cpr_match_table, From 833811353f701421c389f5c4d4bdf06e052fd649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 24 Nov 2023 09:06:33 +0100 Subject: [PATCH 15/19] pmdomain: xilinx/zynqmp: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Michal Simek Link: https://lore.kernel.org/r/20231124080623.564924-10-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson --- drivers/pmdomain/xilinx/zynqmp-pm-domains.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/xilinx/zynqmp-pm-domains.c b/drivers/pmdomain/xilinx/zynqmp-pm-domains.c index 69d03ad4cf1e..6fd514286d82 100644 --- a/drivers/pmdomain/xilinx/zynqmp-pm-domains.c +++ b/drivers/pmdomain/xilinx/zynqmp-pm-domains.c @@ -293,11 +293,9 @@ static int zynqmp_gpd_probe(struct platform_device *pdev) return 0; } -static int zynqmp_gpd_remove(struct platform_device *pdev) +static void zynqmp_gpd_remove(struct platform_device *pdev) { of_genpd_del_provider(pdev->dev.parent->of_node); - - return 0; } static void zynqmp_gpd_sync_state(struct device *dev) @@ -315,7 +313,7 @@ static struct platform_driver zynqmp_power_domain_driver = { .sync_state = zynqmp_gpd_sync_state, }, .probe = zynqmp_gpd_probe, - .remove = zynqmp_gpd_remove, + .remove_new = zynqmp_gpd_remove, }; module_platform_driver(zynqmp_power_domain_driver); From 3b2714c5d2d26d12b759f7cee9a802a9c8c33936 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 5 Dec 2023 14:58:56 -0800 Subject: [PATCH 16/19] PM: domains: fix domain_governor kernel-doc warnings Fix kernel-doc warnings found when using "W=1". domain_governor.c:54: warning: No description found for return value of 'default_suspend_ok' domain_governor.c:266: warning: No description found for return value of '_default_power_down_ok' domain_governor.c:412: warning: cannot understand function prototype: 'struct dev_power_governor pm_domain_always_on_gov = ' Signed-off-by: Randy Dunlap Cc: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/20231205225856.32739-1-rdunlap@infradead.org Signed-off-by: Ulf Hansson --- drivers/base/power/domain_governor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c index cc2c3a5a6d35..d1a10eeebd16 100644 --- a/drivers/base/power/domain_governor.c +++ b/drivers/base/power/domain_governor.c @@ -49,6 +49,8 @@ static int dev_update_qos_constraint(struct device *dev, void *data) /** * default_suspend_ok - Default PM domain governor routine to suspend devices. * @dev: Device to check. + * + * Returns: true if OK to suspend, false if not OK to suspend */ static bool default_suspend_ok(struct device *dev) { @@ -261,6 +263,8 @@ static bool __default_power_down_ok(struct dev_pm_domain *pd, * @now: current ktime. * * This routine must be executed under the PM domain's lock. + * + * Returns: true if OK to power down, false if not OK to power down */ static bool _default_power_down_ok(struct dev_pm_domain *pd, ktime_t now) { @@ -406,8 +410,8 @@ struct dev_power_governor simple_qos_governor = { .power_down_ok = default_power_down_ok, }; -/** - * pm_genpd_gov_always_on - A governor implementing an always-on policy +/* + * pm_domain_always_on_gov - A governor implementing an always-on policy */ struct dev_power_governor pm_domain_always_on_gov = { .suspend_ok = default_suspend_ok, From 05ce71929efc79f5978589e0456a54eb0fe6485e Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Mon, 27 Nov 2023 16:19:31 +0100 Subject: [PATCH 17/19] PM: domains: Drop the unused pm_genpd_opp_to_performance_state() Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> level dance"), there is no longer any users of the pm_genpd_opp_to_performance_state() API. Let's therefore drop it and its corresponding ->opp_to_performance_state() callback, which also no longer has any users. Signed-off-by: Ulf Hansson Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20231127151931.47055-1-ulf.hansson@linaro.org --- drivers/base/power/domain.c | 32 -------------------------------- include/linux/pm_domain.h | 12 ------------ 2 files changed, 44 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index da1777e39eaa..cf65b5a9783c 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -3042,38 +3042,6 @@ int of_genpd_parse_idle_states(struct device_node *dn, } EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); -/** - * pm_genpd_opp_to_performance_state - Gets performance state of the genpd from its OPP node. - * - * @genpd_dev: Genpd's device for which the performance-state needs to be found. - * @opp: struct dev_pm_opp of the OPP for which we need to find performance - * state. - * - * Returns performance state encoded in the OPP of the genpd. This calls - * platform specific genpd->opp_to_performance_state() callback to translate - * power domain OPP to performance state. - * - * Returns performance state on success and 0 on failure. - */ -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, - struct dev_pm_opp *opp) -{ - struct generic_pm_domain *genpd = NULL; - int state; - - genpd = container_of(genpd_dev, struct generic_pm_domain, dev); - - if (unlikely(!genpd->opp_to_performance_state)) - return 0; - - genpd_lock(genpd); - state = genpd->opp_to_performance_state(genpd, opp); - genpd_unlock(genpd); - - return state; -} -EXPORT_SYMBOL_GPL(pm_genpd_opp_to_performance_state); - static int __init genpd_bus_init(void) { return bus_register(&genpd_bus_type); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 34663d0d5c55..b97c5e9820f9 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -118,7 +118,6 @@ struct genpd_power_state { }; struct genpd_lock_ops; -struct dev_pm_opp; struct opp_table; struct generic_pm_domain { @@ -146,8 +145,6 @@ struct generic_pm_domain { int (*power_on)(struct generic_pm_domain *domain); struct raw_notifier_head power_notifiers; /* Power on/off notifiers */ struct opp_table *opp_table; /* OPP table of the genpd */ - unsigned int (*opp_to_performance_state)(struct generic_pm_domain *genpd, - struct dev_pm_opp *opp); int (*set_performance_state)(struct generic_pm_domain *genpd, unsigned int state); struct gpd_dev_ops dev_ops; @@ -348,8 +345,6 @@ int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); int of_genpd_parse_idle_states(struct device_node *dn, struct genpd_power_state **states, int *n); -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, - struct dev_pm_opp *opp); int genpd_dev_pm_attach(struct device *dev); struct device *genpd_dev_pm_attach_by_id(struct device *dev, @@ -395,13 +390,6 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, return -ENODEV; } -static inline unsigned int -pm_genpd_opp_to_performance_state(struct device *genpd_dev, - struct dev_pm_opp *opp) -{ - return 0; -} - static inline int genpd_dev_pm_attach(struct device *dev) { return 0; From f871e716058988ee1f97263f3247a2cf998f9579 Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Wed, 13 Dec 2023 12:32:45 +0100 Subject: [PATCH 18/19] PM: domains: Drop redundant header for genpd The "power.h" is no longer needed by genpd, so let's simply drop the include of it. Signed-off-by: Ulf Hansson Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20231213113245.29075-1-ulf.hansson@linaro.org --- drivers/base/power/domain.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index cf65b5a9783c..9ee1bf2ece10 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -23,8 +23,6 @@ #include #include -#include "power.h" - #define GENPD_RETRY_MAX_MS 250 /* Approximate */ #define GENPD_DEV_CALLBACK(genpd, type, callback, dev) \ From d6948c13b663a284574cb9e502dd663e70d910e8 Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Wed, 13 Dec 2023 12:33:05 +0100 Subject: [PATCH 19/19] PM: domains: Move genpd and its governor to the pmdomain subsystem It seems reasonable to collect the core parts for the generic PM domain, along with its corresponding provider drivers. Therefore let's move the files from drivers/base/power/ to drivers/pmdomain/ and while at it, let's also rename the files accordingly. Moreover, let's also update MAINTAINERS to reflect the update. Cc: Kevin Hilman Signed-off-by: Ulf Hansson Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20231213113305.29098-1-ulf.hansson@linaro.org --- MAINTAINERS | 10 +--------- drivers/base/power/Makefile | 1 - drivers/pmdomain/Makefile | 1 + drivers/{base/power/domain.c => pmdomain/core.c} | 0 .../power/domain_governor.c => pmdomain/governor.c} | 0 5 files changed, 2 insertions(+), 10 deletions(-) rename drivers/{base/power/domain.c => pmdomain/core.c} (100%) rename drivers/{base/power/domain_governor.c => pmdomain/governor.c} (100%) diff --git a/MAINTAINERS b/MAINTAINERS index ea790149af79..ab4b0aed34f9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8878,21 +8878,13 @@ F: Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.yaml F: drivers/i2c/muxes/i2c-demux-pinctrl.c GENERIC PM DOMAINS -M: "Rafael J. Wysocki" -M: Kevin Hilman M: Ulf Hansson L: linux-pm@vger.kernel.org S: Supported F: Documentation/devicetree/bindings/power/power?domain* -F: drivers/base/power/domain*.c -F: include/linux/pm_domain.h - -GENERIC PM DOMAIN PROVIDERS -M: Ulf Hansson -L: linux-pm@vger.kernel.org -S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git F: drivers/pmdomain/ +F: include/linux/pm_domain.h GENERIC RADIX TREE M: Kent Overstreet diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile index 8fdd0073eeeb..01f11629d241 100644 --- a/drivers/base/power/Makefile +++ b/drivers/base/power/Makefile @@ -2,7 +2,6 @@ obj-$(CONFIG_PM) += sysfs.o generic_ops.o common.o qos.o runtime.o wakeirq.o obj-$(CONFIG_PM_SLEEP) += main.o wakeup.o wakeup_stats.o obj-$(CONFIG_PM_TRACE_RTC) += trace.o -obj-$(CONFIG_PM_GENERIC_DOMAINS) += domain.o domain_governor.o obj-$(CONFIG_HAVE_CLK) += clock_ops.o obj-$(CONFIG_PM_QOS_KUNIT_TEST) += qos-test.o diff --git a/drivers/pmdomain/Makefile b/drivers/pmdomain/Makefile index f0326b27b30b..a68ece2f4c68 100644 --- a/drivers/pmdomain/Makefile +++ b/drivers/pmdomain/Makefile @@ -16,3 +16,4 @@ obj-y += sunxi/ obj-y += tegra/ obj-y += ti/ obj-y += xilinx/ +obj-y += core.o governor.o diff --git a/drivers/base/power/domain.c b/drivers/pmdomain/core.c similarity index 100% rename from drivers/base/power/domain.c rename to drivers/pmdomain/core.c diff --git a/drivers/base/power/domain_governor.c b/drivers/pmdomain/governor.c similarity index 100% rename from drivers/base/power/domain_governor.c rename to drivers/pmdomain/governor.c