Renesas ARM Based SoC Fixes for v4.18
Make PM domain initialization more robust in Renesas R-Car SYSC driver. This resolves a regression due to re-parenting of PM domains by086b399965
("soc: renesas: r8a77990-sysc: Add workaround for 3DG-{A,B}"). -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE4nzZofWswv9L/nKF189kaWo3T74FAlshAPMACgkQ189kaWo3 T75ZnQ//Vxe+vDAlykVqf21/F8qqYxZtmTulBpPTwtQi1sI9sETvQs/L/YynX5QL kVVXD6gQInbtwVTFSnVq1nh4UbvBBi5uFyBCThU2mei4P8Tnsw5L4ssSf+x1jerx wFk6aWEScbAortcUU+jztDKlLemAV1Z4sIjZvwSMknObOfdsl93/Jf1a35C/IasJ o0mTt6KFd+/X+cIu903jSMoez+ZGPjpS2KZ/1vZ7CoonNUqQdcFith2MGUPa3V/Y kuOHsOl62JaoXc4NmdqwwcviK8YlQL5F0QJ9ilQvZ7twNycY7ICAQ4NgHraU7tmk hANHe4jgwofU1tcdmzmc0lvjP0iJTVoj3Au4ljeZ1nI8P8QEvIfdBzKZfL9nh/JB oeCSyyqRMx8OYNCooH9sj5664e4eVYVcI65KqKX91AY8fXQu+gyy2x3I5eMLDkKZ JC7QjHKybx8Eh5pR6/XPit7I7I2AXl7EQX/DoNhzMRrHG+4zAB39ZiUZLyHFZqjj /dYgdbD4SUciaq+Zmp/dp304k+TrRK0LonfaBvmhMoTez3o2RfaBz+SH0htqI8Ih HASGsPI+gjkrhpSMn5iN5Yu+HOVY2s5lqNJqwvDbBM1rUnRkeoQco1hN+4SpyJR+ ROBzOIyelkRXCumCYj8Pn0OKBtwVTeQJ28s+PRHxqe9+tz1Jb9o= =ujRB -----END PGP SIGNATURE----- Merge tag 'renesas-fixes-for-v4.18' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes Renesas ARM Based SoC Fixes for v4.18 Make PM domain initialization more robust in Renesas R-Car SYSC driver. This resolves a regression due to re-parenting of PM domains by086b399965
("soc: renesas: r8a77990-sysc: Add workaround for 3DG-{A,B}"). * tag 'renesas-fixes-for-v4.18' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: soc: renesas: rcar-sysc: Make PM domain initialization more robust Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
commit
cb04a79445
|
@ -194,11 +194,12 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd)
|
||||||
|
|
||||||
static bool has_cpg_mstp;
|
static bool has_cpg_mstp;
|
||||||
|
|
||||||
static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
|
static int __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
|
||||||
{
|
{
|
||||||
struct generic_pm_domain *genpd = &pd->genpd;
|
struct generic_pm_domain *genpd = &pd->genpd;
|
||||||
const char *name = pd->genpd.name;
|
const char *name = pd->genpd.name;
|
||||||
struct dev_power_governor *gov = &simple_qos_governor;
|
struct dev_power_governor *gov = &simple_qos_governor;
|
||||||
|
int error;
|
||||||
|
|
||||||
if (pd->flags & PD_CPU) {
|
if (pd->flags & PD_CPU) {
|
||||||
/*
|
/*
|
||||||
|
@ -251,7 +252,11 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
|
||||||
rcar_sysc_power_up(&pd->ch);
|
rcar_sysc_power_up(&pd->ch);
|
||||||
|
|
||||||
finalize:
|
finalize:
|
||||||
pm_genpd_init(genpd, gov, false);
|
error = pm_genpd_init(genpd, gov, false);
|
||||||
|
if (error)
|
||||||
|
pr_err("Failed to init PM domain %s: %d\n", name, error);
|
||||||
|
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id rcar_sysc_matches[] __initconst = {
|
static const struct of_device_id rcar_sysc_matches[] __initconst = {
|
||||||
|
@ -375,6 +380,9 @@ static int __init rcar_sysc_pd_init(void)
|
||||||
pr_debug("%pOF: syscier = 0x%08x\n", np, syscier);
|
pr_debug("%pOF: syscier = 0x%08x\n", np, syscier);
|
||||||
iowrite32(syscier, base + SYSCIER);
|
iowrite32(syscier, base + SYSCIER);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* First, create all PM domains
|
||||||
|
*/
|
||||||
for (i = 0; i < info->num_areas; i++) {
|
for (i = 0; i < info->num_areas; i++) {
|
||||||
const struct rcar_sysc_area *area = &info->areas[i];
|
const struct rcar_sysc_area *area = &info->areas[i];
|
||||||
struct rcar_sysc_pd *pd;
|
struct rcar_sysc_pd *pd;
|
||||||
|
@ -397,14 +405,29 @@ static int __init rcar_sysc_pd_init(void)
|
||||||
pd->ch.isr_bit = area->isr_bit;
|
pd->ch.isr_bit = area->isr_bit;
|
||||||
pd->flags = area->flags;
|
pd->flags = area->flags;
|
||||||
|
|
||||||
rcar_sysc_pd_setup(pd);
|
error = rcar_sysc_pd_setup(pd);
|
||||||
if (area->parent >= 0)
|
if (error)
|
||||||
pm_genpd_add_subdomain(domains->domains[area->parent],
|
goto out_put;
|
||||||
&pd->genpd);
|
|
||||||
|
|
||||||
domains->domains[area->isr_bit] = &pd->genpd;
|
domains->domains[area->isr_bit] = &pd->genpd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Second, link all PM domains to their parents
|
||||||
|
*/
|
||||||
|
for (i = 0; i < info->num_areas; i++) {
|
||||||
|
const struct rcar_sysc_area *area = &info->areas[i];
|
||||||
|
|
||||||
|
if (!area->name || area->parent < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
error = pm_genpd_add_subdomain(domains->domains[area->parent],
|
||||||
|
domains->domains[area->isr_bit]);
|
||||||
|
if (error)
|
||||||
|
pr_warn("Failed to add PM subdomain %s to parent %u\n",
|
||||||
|
area->name, area->parent);
|
||||||
|
}
|
||||||
|
|
||||||
error = of_genpd_add_provider_onecell(np, &domains->onecell_data);
|
error = of_genpd_add_provider_onecell(np, &domains->onecell_data);
|
||||||
|
|
||||||
out_put:
|
out_put:
|
||||||
|
|
Loading…
Reference in New Issue