Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pmdomain-v6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fixes from Ulf Hansson:

- imx: Fix reference count leak in ->remove()

- samsung: Rework legacy splash-screen handover workaround

- samsung: Fix potential memleak during ->probe()

- arm: Fix genpd leak on provider registration failure for scmi

* tag 'pmdomain-v6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
pmdomain: imx: Fix reference count leak in imx_gpc_remove
pmdomain: samsung: Rework legacy splash-screen handover workaround
pmdomain: arm: scmi: Fix genpd leak on provider registration failure
pmdomain: samsung: plug potential memleak during probe

+27 -17
+11 -2
drivers/pmdomain/arm/scmi_pm_domain.c
··· 41 41 42 42 static int scmi_pm_domain_probe(struct scmi_device *sdev) 43 43 { 44 - int num_domains, i; 44 + int num_domains, i, ret; 45 45 struct device *dev = &sdev->dev; 46 46 struct device_node *np = dev->of_node; 47 47 struct scmi_pm_domain *scmi_pd; ··· 108 108 scmi_pd_data->domains = domains; 109 109 scmi_pd_data->num_domains = num_domains; 110 110 111 + ret = of_genpd_add_provider_onecell(np, scmi_pd_data); 112 + if (ret) 113 + goto err_rm_genpds; 114 + 111 115 dev_set_drvdata(dev, scmi_pd_data); 112 116 113 - return of_genpd_add_provider_onecell(np, scmi_pd_data); 117 + return 0; 118 + err_rm_genpds: 119 + for (i = num_domains - 1; i >= 0; i--) 120 + pm_genpd_remove(domains[i]); 121 + 122 + return ret; 114 123 } 115 124 116 125 static void scmi_pm_domain_remove(struct scmi_device *sdev)
+2
drivers/pmdomain/imx/gpc.c
··· 536 536 return; 537 537 } 538 538 } 539 + 540 + of_node_put(pgc_node); 539 541 } 540 542 541 543 static struct platform_driver imx_gpc_driver = {
+14 -15
drivers/pmdomain/samsung/exynos-pm-domains.c
··· 92 92 { }, 93 93 }; 94 94 95 - static const char *exynos_get_domain_name(struct device_node *node) 95 + static const char *exynos_get_domain_name(struct device *dev, 96 + struct device_node *node) 96 97 { 97 98 const char *name; 98 99 99 100 if (of_property_read_string(node, "label", &name) < 0) 100 101 name = kbasename(node->full_name); 101 - return kstrdup_const(name, GFP_KERNEL); 102 + return devm_kstrdup_const(dev, name, GFP_KERNEL); 102 103 } 103 104 104 105 static int exynos_pd_probe(struct platform_device *pdev) ··· 116 115 if (!pd) 117 116 return -ENOMEM; 118 117 119 - pd->pd.name = exynos_get_domain_name(np); 118 + pd->pd.name = exynos_get_domain_name(dev, np); 120 119 if (!pd->pd.name) 121 120 return -ENOMEM; 122 121 123 122 pd->base = of_iomap(np, 0); 124 - if (!pd->base) { 125 - kfree_const(pd->pd.name); 123 + if (!pd->base) 126 124 return -ENODEV; 127 - } 128 125 129 126 pd->pd.power_off = exynos_pd_power_off; 130 127 pd->pd.power_on = exynos_pd_power_on; 131 128 pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg; 129 + 130 + /* 131 + * Some Samsung platforms with bootloaders turning on the splash-screen 132 + * and handing it over to the kernel, requires the power-domains to be 133 + * reset during boot. 134 + */ 135 + if (IS_ENABLED(CONFIG_ARM) && 136 + of_device_is_compatible(np, "samsung,exynos4210-pd")) 137 + exynos_pd_power_off(&pd->pd); 132 138 133 139 on = readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg; 134 140 ··· 154 146 pr_info("%pOF has as child subdomain: %pOF.\n", 155 147 parent.np, child.np); 156 148 } 157 - 158 - /* 159 - * Some Samsung platforms with bootloaders turning on the splash-screen 160 - * and handing it over to the kernel, requires the power-domains to be 161 - * reset during boot. As a temporary hack to manage this, let's enforce 162 - * a sync_state. 163 - */ 164 - if (!ret) 165 - of_genpd_sync_state(np); 166 149 167 150 pm_runtime_enable(dev); 168 151 return ret;