* [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes
@ 2019-11-30 14:58 Martin Blumenstingl
2019-11-30 14:58 ` [PATCH RESEND v1 1/2] soc: amlogic: meson-ee-pwrc: propagate PD provider registration errors Martin Blumenstingl
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Martin Blumenstingl @ 2019-11-30 14:58 UTC (permalink / raw)
To: linux-amlogic, khilman, narmstrong
Cc: Martin Blumenstingl, linux-kernel, linux-arm-kernel
While working on power domain support for the 32-bit SoCs I had some
crashes when trying to actually use the power domains. Turns out I had
a bug in my patches which add support for the older SoCs to
meson-ee-pwrc. However, I didn't notice these because the driver probed
just fine.
This is my attempt to spot "problems" (bugs in my code) earlier.
RESEND: sorry for the noise, I forgot to add the linux-amlogic mailing
list. This is important so patchwork can pick up these patches.
Martin Blumenstingl (2):
soc: amlogic: meson-ee-pwrc: propagate PD provider registration errors
soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init()
drivers/soc/amlogic/meson-ee-pwrc.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
--
2.24.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH RESEND v1 1/2] soc: amlogic: meson-ee-pwrc: propagate PD provider registration errors 2019-11-30 14:58 [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes Martin Blumenstingl @ 2019-11-30 14:58 ` Martin Blumenstingl 2019-11-30 14:58 ` [PATCH RESEND v1 2/2] soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init() Martin Blumenstingl 2019-12-09 22:24 ` [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes Kevin Hilman 2 siblings, 0 replies; 4+ messages in thread From: Martin Blumenstingl @ 2019-11-30 14:58 UTC (permalink / raw) To: linux-amlogic, khilman, narmstrong Cc: Martin Blumenstingl, linux-kernel, linux-arm-kernel of_genpd_add_provider_onecell() can return an error. Propagate the error so the driver registration fails when of_genpd_add_provider_onecell() did not work. Fixes: eef3c2ba0a42a6 ("soc: amlogic: Add support for Everything-Else power domains controller") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/soc/amlogic/meson-ee-pwrc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c index 5823f5b67d16..df734a45da56 100644 --- a/drivers/soc/amlogic/meson-ee-pwrc.c +++ b/drivers/soc/amlogic/meson-ee-pwrc.c @@ -441,9 +441,7 @@ static int meson_ee_pwrc_probe(struct platform_device *pdev) pwrc->xlate.domains[i] = &dom->base; } - of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate); - - return 0; + return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate); } static void meson_ee_pwrc_shutdown(struct platform_device *pdev) -- 2.24.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH RESEND v1 2/2] soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init() 2019-11-30 14:58 [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes Martin Blumenstingl 2019-11-30 14:58 ` [PATCH RESEND v1 1/2] soc: amlogic: meson-ee-pwrc: propagate PD provider registration errors Martin Blumenstingl @ 2019-11-30 14:58 ` Martin Blumenstingl 2019-12-09 22:24 ` [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes Kevin Hilman 2 siblings, 0 replies; 4+ messages in thread From: Martin Blumenstingl @ 2019-11-30 14:58 UTC (permalink / raw) To: linux-amlogic, khilman, narmstrong Cc: Martin Blumenstingl, linux-kernel, linux-arm-kernel pm_genpd_init() can return an error. Propagate the error code to prevent the driver from indicating that it successfully probed while there were errors during pm_genpd_init(). Fixes: eef3c2ba0a42a6 ("soc: amlogic: Add support for Everything-Else power domains controller") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/soc/amlogic/meson-ee-pwrc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c index df734a45da56..3f0261d53ad9 100644 --- a/drivers/soc/amlogic/meson-ee-pwrc.c +++ b/drivers/soc/amlogic/meson-ee-pwrc.c @@ -323,6 +323,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, struct meson_ee_pwrc *pwrc, struct meson_ee_pwrc_domain *dom) { + int ret; + dom->pwrc = pwrc; dom->num_rstc = dom->desc.reset_names_count; dom->num_clks = dom->desc.clk_names_count; @@ -368,15 +370,21 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, * prepare/enable counters won't be in sync. */ if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) { - int ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); + ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); if (ret) return ret; - pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false); - } else - pm_genpd_init(&dom->base, NULL, - (dom->desc.get_power ? - dom->desc.get_power(dom) : true)); + ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov, + false); + if (ret) + return ret; + } else { + ret = pm_genpd_init(&dom->base, NULL, + (dom->desc.get_power ? + dom->desc.get_power(dom) : true)); + if (ret) + return ret; + } return 0; } -- 2.24.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes 2019-11-30 14:58 [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes Martin Blumenstingl 2019-11-30 14:58 ` [PATCH RESEND v1 1/2] soc: amlogic: meson-ee-pwrc: propagate PD provider registration errors Martin Blumenstingl 2019-11-30 14:58 ` [PATCH RESEND v1 2/2] soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init() Martin Blumenstingl @ 2019-12-09 22:24 ` Kevin Hilman 2 siblings, 0 replies; 4+ messages in thread From: Kevin Hilman @ 2019-12-09 22:24 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, narmstrong Cc: Martin Blumenstingl, linux-kernel, linux-arm-kernel Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes: > While working on power domain support for the 32-bit SoCs I had some > crashes when trying to actually use the power domains. Turns out I had > a bug in my patches which add support for the older SoCs to > meson-ee-pwrc. However, I didn't notice these because the driver probed > just fine. > > This is my attempt to spot "problems" (bugs in my code) earlier. > > RESEND: sorry for the noise, I forgot to add the linux-amlogic mailing > list. This is important so patchwork can pick up these patches. Queued as fixes for v5.5, Thanks, Kevin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-12-09 22:25 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-11-30 14:58 [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes Martin Blumenstingl 2019-11-30 14:58 ` [PATCH RESEND v1 1/2] soc: amlogic: meson-ee-pwrc: propagate PD provider registration errors Martin Blumenstingl 2019-11-30 14:58 ` [PATCH RESEND v1 2/2] soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init() Martin Blumenstingl 2019-12-09 22:24 ` [PATCH RESEND v1 0/2] amlogic: meson-ee-pwrc: two small fixes Kevin Hilman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).