* [PATCH] CLK: TI: consider the fact that of_clk_get() might return an error
@ 2014-09-11 16:01 Sebastian Andrzej Siewior
2014-09-17 12:52 ` Nishanth Menon
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-09-11 16:01 UTC (permalink / raw)
To: Tero Kristo; +Cc: Mike Turquette, linux-omap, Sebastian Andrzej Siewior
I "forgot" to update the dtb and the kernel crashed:
|Unable to handle kernel NULL pointer dereference at virtual address 0000002e
|PC is at __clk_get_flags+0x4/0xc
|LR is at ti_dt_clockdomains_setup+0x70/0xe8
because I did not have the clock nodes. of_clk_get() returns an error
pointer which is not checked here.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/clk/ti/clockdomain.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
index f1e0038d76ac..fdd458600c2c 100644
--- a/drivers/clk/ti/clockdomain.c
+++ b/drivers/clk/ti/clockdomain.c
@@ -36,6 +36,11 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
for (i = 0; i < num_clks; i++) {
clk = of_clk_get(node, i);
+ if (IS_ERR(clk)) {
+ pr_err("Failed get %s' clock nr %d (%ld)\n",
+ node->full_name, i, PTR_ERR(clk));
+ continue;
+ }
if (__clk_get_flags(clk) & CLK_IS_BASIC) {
pr_warn("can't setup clkdm for basic clk %s\n",
__clk_get_name(clk));
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] CLK: TI: consider the fact that of_clk_get() might return an error
2014-09-11 16:01 [PATCH] CLK: TI: consider the fact that of_clk_get() might return an error Sebastian Andrzej Siewior
@ 2014-09-17 12:52 ` Nishanth Menon
2014-09-17 15:56 ` [PATCH v2] " Sebastian Andrzej Siewior
0 siblings, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2014-09-17 12:52 UTC (permalink / raw)
To: Sebastian Andrzej Siewior, Tero Kristo; +Cc: Mike Turquette, linux-omap
On 09/11/2014 11:01 AM, Sebastian Andrzej Siewior wrote:
> I "forgot" to update the dtb and the kernel crashed:
> |Unable to handle kernel NULL pointer dereference at virtual address 0000002e
> |PC is at __clk_get_flags+0x4/0xc
> |LR is at ti_dt_clockdomains_setup+0x70/0xe8
>
> because I did not have the clock nodes. of_clk_get() returns an error
> pointer which is not checked here.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/clk/ti/clockdomain.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
> index f1e0038d76ac..fdd458600c2c 100644
> --- a/drivers/clk/ti/clockdomain.c
> +++ b/drivers/clk/ti/clockdomain.c
> @@ -36,6 +36,11 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
>
> for (i = 0; i < num_clks; i++) {
> clk = of_clk_get(node, i);
> + if (IS_ERR(clk)) {
> + pr_err("Failed get %s' clock nr %d (%ld)\n",
> + node->full_name, i, PTR_ERR(clk));
Could you add %s: __func__ as well - it kinda helps understand this is
part of clockdomain setup and not some driver cribbing that it did not
get some clock.
> + continue;
> + }
> if (__clk_get_flags(clk) & CLK_IS_BASIC) {
> pr_warn("can't setup clkdm for basic clk %s\n",
> __clk_get_name(clk));
>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2] CLK: TI: consider the fact that of_clk_get() might return an error
2014-09-17 12:52 ` Nishanth Menon
@ 2014-09-17 15:56 ` Sebastian Andrzej Siewior
2014-09-17 16:35 ` Nishanth Menon
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-09-17 15:56 UTC (permalink / raw)
To: Nishanth Menon; +Cc: Tero Kristo, Mike Turquette, linux-omap
I "forgot" to update the dtb and the kernel crashed:
|Unable to handle kernel NULL pointer dereference at virtual address 0000002e
|PC is at __clk_get_flags+0x4/0xc
|LR is at ti_dt_clockdomains_setup+0x70/0xe8
because I did not have the clock nodes. of_clk_get() returns an error
pointer which is not checked here.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
v1…v2:
add "%s __func__" to the added pr_err
* Nishanth Menon | 2014-09-17 07:52:33 [-0500]:
>
>Could you add %s: __func__ as well - it kinda helps understand this
>is part of clockdomain setup and not some driver cribbing that it did
>not get some clock.
As you wish.
drivers/clk/ti/clockdomain.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
index f1e0038d76ac..446481166ce9 100644
--- a/drivers/clk/ti/clockdomain.c
+++ b/drivers/clk/ti/clockdomain.c
@@ -36,6 +36,12 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
for (i = 0; i < num_clks; i++) {
clk = of_clk_get(node, i);
+ if (IS_ERR(clk)) {
+ pr_err("%s: Failed get %s' clock nr %d (%ld)\n",
+ __func__, node->full_name, i,
+ PTR_ERR(clk));
+ continue;
+ }
if (__clk_get_flags(clk) & CLK_IS_BASIC) {
pr_warn("can't setup clkdm for basic clk %s\n",
__clk_get_name(clk));
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2] CLK: TI: consider the fact that of_clk_get() might return an error
2014-09-17 15:56 ` [PATCH v2] " Sebastian Andrzej Siewior
@ 2014-09-17 16:35 ` Nishanth Menon
2014-09-18 14:33 ` [PATCH v3] " Sebastian Andrzej Siewior
0 siblings, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2014-09-17 16:35 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: Tero Kristo, Mike Turquette, linux-omap
On 17:56-20140917, Sebastian Andrzej Siewior wrote:
> I "forgot" to update the dtb and the kernel crashed:
> |Unable to handle kernel NULL pointer dereference at virtual address 0000002e
> |PC is at __clk_get_flags+0x4/0xc
> |LR is at ti_dt_clockdomains_setup+0x70/0xe8
>
> because I did not have the clock nodes. of_clk_get() returns an error
> pointer which is not checked here.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> v1…v2:
> add "%s __func__" to the added pr_err
>
> * Nishanth Menon | 2014-09-17 07:52:33 [-0500]:
> >
> >Could you add %s: __func__ as well - it kinda helps understand this
> >is part of clockdomain setup and not some driver cribbing that it did
> >not get some clock.
>
> As you wish.
>
> drivers/clk/ti/clockdomain.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
> index f1e0038d76ac..446481166ce9 100644
> --- a/drivers/clk/ti/clockdomain.c
> +++ b/drivers/clk/ti/clockdomain.c
> @@ -36,6 +36,12 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
>
> for (i = 0; i < num_clks; i++) {
> clk = of_clk_get(node, i);
> + if (IS_ERR(clk)) {
> + pr_err("%s: Failed get %s' clock nr %d (%ld)\n",
> + __func__, node->full_name, i,
> + PTR_ERR(clk));
> + continue;
> + }
Once the following is fixed (checkpatch --strict) feel free to add:
Acked-by: Nishanth Menon <nm@ti.com>
#65: FILE: drivers/clk/ti/clockdomain.c:35:
_node *node)
CHECK: Alignment should match open parenthesis
#71: FILE: drivers/clk/ti/clockdomain.c:40:
+ pr_err("%s: Failed get %s' clock nr %d (%ld)\n",
+ __func__, node->full_name, i,
total: 1 errors, 0 warnings, 1 checks, 16 lines checked
If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v3] CLK: TI: consider the fact that of_clk_get() might return an error
2014-09-17 16:35 ` Nishanth Menon
@ 2014-09-18 14:33 ` Sebastian Andrzej Siewior
2014-09-29 8:56 ` Tero Kristo
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-09-18 14:33 UTC (permalink / raw)
To: Tero Kristo, Mike Turquette; +Cc: linux-omap, Nishanth Menon, linux-arm-kernel
I "forgot" to update the dtb and the kernel crashed:
|Unable to handle kernel NULL pointer dereference at virtual address 0000002e
|PC is at __clk_get_flags+0x4/0xc
|LR is at ti_dt_clockdomains_setup+0x70/0xe8
because I did not have the clock nodes. of_clk_get() returns an error
pointer which is not checked here.
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
v2…v3:
- added acked by
- fixed "CHECK: Alignment should match open parenthesis"
v1…v2:
add "%s __func__" to the added pr_err
drivers/clk/ti/clockdomain.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
index f1e0038d76ac..b4c5faccaece 100644
--- a/drivers/clk/ti/clockdomain.c
+++ b/drivers/clk/ti/clockdomain.c
@@ -36,6 +36,11 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
for (i = 0; i < num_clks; i++) {
clk = of_clk_get(node, i);
+ if (IS_ERR(clk)) {
+ pr_err("%s: Failed get %s' clock nr %d (%ld)\n",
+ __func__, node->full_name, i, PTR_ERR(clk));
+ continue;
+ }
if (__clk_get_flags(clk) & CLK_IS_BASIC) {
pr_warn("can't setup clkdm for basic clk %s\n",
__clk_get_name(clk));
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v3] CLK: TI: consider the fact that of_clk_get() might return an error
2014-09-18 14:33 ` [PATCH v3] " Sebastian Andrzej Siewior
@ 2014-09-29 8:56 ` Tero Kristo
0 siblings, 0 replies; 6+ messages in thread
From: Tero Kristo @ 2014-09-29 8:56 UTC (permalink / raw)
To: Sebastian Andrzej Siewior, Mike Turquette
Cc: linux-omap, Nishanth Menon, linux-arm-kernel
On 09/18/2014 05:33 PM, Sebastian Andrzej Siewior wrote:
> I "forgot" to update the dtb and the kernel crashed:
> |Unable to handle kernel NULL pointer dereference at virtual address 0000002e
> |PC is at __clk_get_flags+0x4/0xc
> |LR is at ti_dt_clockdomains_setup+0x70/0xe8
>
> because I did not have the clock nodes. of_clk_get() returns an error
> pointer which is not checked here.
>
> Acked-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Thanks, v3 applied to for-v3.18/ti-clk-drv.
-Tero
> ---
> v2…v3:
> - added acked by
> - fixed "CHECK: Alignment should match open parenthesis"
>
> v1…v2:
> add "%s __func__" to the added pr_err
>
> drivers/clk/ti/clockdomain.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
> index f1e0038d76ac..b4c5faccaece 100644
> --- a/drivers/clk/ti/clockdomain.c
> +++ b/drivers/clk/ti/clockdomain.c
> @@ -36,6 +36,11 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
>
> for (i = 0; i < num_clks; i++) {
> clk = of_clk_get(node, i);
> + if (IS_ERR(clk)) {
> + pr_err("%s: Failed get %s' clock nr %d (%ld)\n",
> + __func__, node->full_name, i, PTR_ERR(clk));
> + continue;
> + }
> if (__clk_get_flags(clk) & CLK_IS_BASIC) {
> pr_warn("can't setup clkdm for basic clk %s\n",
> __clk_get_name(clk));
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-09-29 8:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 16:01 [PATCH] CLK: TI: consider the fact that of_clk_get() might return an error Sebastian Andrzej Siewior
2014-09-17 12:52 ` Nishanth Menon
2014-09-17 15:56 ` [PATCH v2] " Sebastian Andrzej Siewior
2014-09-17 16:35 ` Nishanth Menon
2014-09-18 14:33 ` [PATCH v3] " Sebastian Andrzej Siewior
2014-09-29 8:56 ` Tero Kristo
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).