From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbcIOOjr convert rfc822-to-8bit (ORCPT ); Thu, 15 Sep 2016 10:39:47 -0400 Received: from gloria.sntech.de ([95.129.55.99]:52501 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbcIOOjn (ORCPT ); Thu, 15 Sep 2016 10:39:43 -0400 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Tomeu Vizoso Cc: linux-kernel@vger.kernel.org, Caesar Wang , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH] soc: rockchip: power-domain: Handle errors from of_genpd_add_provider_onecell Date: Thu, 15 Sep 2016 16:39:34 +0200 Message-ID: <14744126.0kYUlUJ0mc@diego> User-Agent: KMail/4.14.10 (Linux/4.6.0-1-amd64; KDE/4.14.22; x86_64; ; ) In-Reply-To: <1473936221-9248-1-git-send-email-tomeu.vizoso@collabora.com> References: <1473936221-9248-1-git-send-email-tomeu.vizoso@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, 15. September 2016, 12:43:41 schrieb Tomeu Vizoso: > It was a bit surprising that the device was reported to have probed just > fine, but the provider hadn't been registered. > > So handle any errors when registering the provider and fail the probe > accordingly. > > Signed-off-by: Tomeu Vizoso > Cc: Caesar Wang > --- > drivers/soc/rockchip/pm_domains.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/soc/rockchip/pm_domains.c > b/drivers/soc/rockchip/pm_domains.c index 7acd1517dd37..57e920128cb2 100644 > --- a/drivers/soc/rockchip/pm_domains.c > +++ b/drivers/soc/rockchip/pm_domains.c > @@ -627,7 +627,11 @@ static int rockchip_pm_domain_probe(struct > platform_device *pdev) goto err_out; > } > > - of_genpd_add_provider_onecell(np, &pmu->genpd_data); > + error = of_genpd_add_provider_onecell(np, &pmu->genpd_data); > + if (error) { > + dev_err(dev, "failed to add provider: %d\n", error); > + goto err_out; > + } > > return 0; Looks good in itself, but seems to trigger some issue in the genpd code when applied alone on top of linux-next-20160915. Looks like genpd is missing counter-initialization somewhere, as I'm seeing now: [ 1.664744] genpd_poweroff_unused disabling (null) [ 1.669553] ------------[ cut here ]------------ [ 1.674169] WARNING: CPU: 0 PID: 1 at ../kernel/workqueue.c:1440 __queue_work+0x2b8/0x3f8 [ 1.682337] Modules linked in: [ 1.685401] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc6-next-20160915-00001-g7432710-dirty #5 [ 1.694608] Hardware name: Rockchip (Device Tree) [ 1.699312] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 1.707050] [] (show_stack) from [] (dump_stack+0x90/0xa4) [ 1.714267] [] (dump_stack) from [] (__warn+0xe8/0x100) [ 1.721221] [] (__warn) from [] (warn_slowpath_null+0x20/0x28) [ 1.728785] [] (warn_slowpath_null) from [] (__queue_work+0x2b8/0x3f8) [ 1.737041] [] (__queue_work) from [] (queue_work_on+0x40/0x4c) [ 1.744692] [] (queue_work_on) from [] (genpd_poweroff_unused+0x78/0x9c) [ 1.753123] [] (genpd_poweroff_unused) from [] (do_one_initcall+0x40/0x170) [ 1.761815] [] (do_one_initcall) from [] (kernel_init_freeable+0x15c/0x1fc) [ 1.770507] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x114) [ 1.778678] [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) [ 1.786240] ---[ end trace b38c51ace1463add ]--- [ 1.790875] genpd_poweroff_unused disabling ������ [ 1.795856] genpd_poweroff_unused disabling ������ [ 1.800830] ------------[ cut here ]------------ [ 1.805443] WARNING: CPU: 0 PID: 1 at ../kernel/workqueue.c:1440 __queue_work+0x2b8/0x3f8 [ 1.813610] Modules linked in: [ 1.816673] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.8.0-rc6-next-20160915-00001-g7432710-dirty #5 [ 1.827094] Hardware name: Rockchip (Device Tree) [ 1.831795] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 1.839532] [] (show_stack) from [] (dump_stack+0x90/0xa4) [ 1.846747] [] (dump_stack) from [] (__warn+0xe8/0x100) [ 1.853700] [] (__warn) from [] (warn_slowpath_null+0x20/0x28) [ 1.861264] [] (warn_slowpath_null) from [] (__queue_work+0x2b8/0x3f8) [ 1.869521] [] (__queue_work) from [] (queue_work_on+0x40/0x4c) [ 1.877170] [] (queue_work_on) from [] (genpd_poweroff_unused+0x78/0x9c) [ 1.885600] [] (genpd_poweroff_unused) from [] (do_one_initcall+0x40/0x170) [ 1.894290] [] (do_one_initcall) from [] (kernel_init_freeable+0x15c/0x1fc) [ 1.902981] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x114) [ 1.911152] [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) [ 1.918713] ---[ end trace b38c51ace1463ade ]--- [ 1.923338] genpd_poweroff_unused disabling ������ [ 1.928325] genpd_poweroff_unused disabling ������ [+ millions more of those] From mboxrd@z Thu Jan 1 00:00:00 1970 From: heiko@sntech.de (Heiko =?ISO-8859-1?Q?St=FCbner?=) Date: Thu, 15 Sep 2016 16:39:34 +0200 Subject: [PATCH] soc: rockchip: power-domain: Handle errors from of_genpd_add_provider_onecell In-Reply-To: <1473936221-9248-1-git-send-email-tomeu.vizoso@collabora.com> References: <1473936221-9248-1-git-send-email-tomeu.vizoso@collabora.com> Message-ID: <14744126.0kYUlUJ0mc@diego> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Am Donnerstag, 15. September 2016, 12:43:41 schrieb Tomeu Vizoso: > It was a bit surprising that the device was reported to have probed just > fine, but the provider hadn't been registered. > > So handle any errors when registering the provider and fail the probe > accordingly. > > Signed-off-by: Tomeu Vizoso > Cc: Caesar Wang > --- > drivers/soc/rockchip/pm_domains.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/soc/rockchip/pm_domains.c > b/drivers/soc/rockchip/pm_domains.c index 7acd1517dd37..57e920128cb2 100644 > --- a/drivers/soc/rockchip/pm_domains.c > +++ b/drivers/soc/rockchip/pm_domains.c > @@ -627,7 +627,11 @@ static int rockchip_pm_domain_probe(struct > platform_device *pdev) goto err_out; > } > > - of_genpd_add_provider_onecell(np, &pmu->genpd_data); > + error = of_genpd_add_provider_onecell(np, &pmu->genpd_data); > + if (error) { > + dev_err(dev, "failed to add provider: %d\n", error); > + goto err_out; > + } > > return 0; Looks good in itself, but seems to trigger some issue in the genpd code when applied alone on top of linux-next-20160915. Looks like genpd is missing counter-initialization somewhere, as I'm seeing now: [ 1.664744] genpd_poweroff_unused disabling (null) [ 1.669553] ------------[ cut here ]------------ [ 1.674169] WARNING: CPU: 0 PID: 1 at ../kernel/workqueue.c:1440 __queue_work+0x2b8/0x3f8 [ 1.682337] Modules linked in: [ 1.685401] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc6-next-20160915-00001-g7432710-dirty #5 [ 1.694608] Hardware name: Rockchip (Device Tree) [ 1.699312] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 1.707050] [] (show_stack) from [] (dump_stack+0x90/0xa4) [ 1.714267] [] (dump_stack) from [] (__warn+0xe8/0x100) [ 1.721221] [] (__warn) from [] (warn_slowpath_null+0x20/0x28) [ 1.728785] [] (warn_slowpath_null) from [] (__queue_work+0x2b8/0x3f8) [ 1.737041] [] (__queue_work) from [] (queue_work_on+0x40/0x4c) [ 1.744692] [] (queue_work_on) from [] (genpd_poweroff_unused+0x78/0x9c) [ 1.753123] [] (genpd_poweroff_unused) from [] (do_one_initcall+0x40/0x170) [ 1.761815] [] (do_one_initcall) from [] (kernel_init_freeable+0x15c/0x1fc) [ 1.770507] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x114) [ 1.778678] [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) [ 1.786240] ---[ end trace b38c51ace1463add ]--- [ 1.790875] genpd_poweroff_unused disabling ?????? [ 1.795856] genpd_poweroff_unused disabling ?????? [ 1.800830] ------------[ cut here ]------------ [ 1.805443] WARNING: CPU: 0 PID: 1 at ../kernel/workqueue.c:1440 __queue_work+0x2b8/0x3f8 [ 1.813610] Modules linked in: [ 1.816673] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.8.0-rc6-next-20160915-00001-g7432710-dirty #5 [ 1.827094] Hardware name: Rockchip (Device Tree) [ 1.831795] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 1.839532] [] (show_stack) from [] (dump_stack+0x90/0xa4) [ 1.846747] [] (dump_stack) from [] (__warn+0xe8/0x100) [ 1.853700] [] (__warn) from [] (warn_slowpath_null+0x20/0x28) [ 1.861264] [] (warn_slowpath_null) from [] (__queue_work+0x2b8/0x3f8) [ 1.869521] [] (__queue_work) from [] (queue_work_on+0x40/0x4c) [ 1.877170] [] (queue_work_on) from [] (genpd_poweroff_unused+0x78/0x9c) [ 1.885600] [] (genpd_poweroff_unused) from [] (do_one_initcall+0x40/0x170) [ 1.894290] [] (do_one_initcall) from [] (kernel_init_freeable+0x15c/0x1fc) [ 1.902981] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x114) [ 1.911152] [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) [ 1.918713] ---[ end trace b38c51ace1463ade ]--- [ 1.923338] genpd_poweroff_unused disabling ?????? [ 1.928325] genpd_poweroff_unused disabling ?????? [+ millions more of those]