public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init
@ 2012-02-17 10:34 Tero Kristo
  2012-02-17 10:47 ` Shilimkar, Santosh
  2012-02-18 15:56 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Tero Kristo @ 2012-02-17 10:34 UTC (permalink / raw)
  To: linux-arm-kernel

Non-smp platforms don't have local timer support, but the twd_cpufreq_init
only checks for IS_ERR during init. Check against null also, to avoid
crashes during cpufreq transitions on non-smp platforms.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/kernel/smp_twd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 4285daa..dae8902 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = {
 
 static int twd_cpufreq_init(void)
 {
-	if (!IS_ERR(twd_clk))
+	if (twd_clk && !IS_ERR(twd_clk))
 		return cpufreq_register_notifier(&twd_cpufreq_nb,
 			CPUFREQ_TRANSITION_NOTIFIER);
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init
  2012-02-17 10:34 [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init Tero Kristo
@ 2012-02-17 10:47 ` Shilimkar, Santosh
  2012-02-17 11:09   ` Tero Kristo
  2012-02-18 15:56 ` Sergei Shtylyov
  1 sibling, 1 reply; 4+ messages in thread
From: Shilimkar, Santosh @ 2012-02-17 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 17, 2012 at 4:04 PM, Tero Kristo <t-kristo@ti.com> wrote:
> Non-smp platforms don't have local timer support, but the twd_cpufreq_init
> only checks for IS_ERR during init. Check against null also, to avoid
> crashes during cpufreq transitions on non-smp platforms.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
I sent a patch for the same issue which Kevin reported.

Thread.
http://www.spinics.net/lists/arm-kernel/msg160275.html

> ?arch/arm/kernel/smp_twd.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> index 4285daa..dae8902 100644
> --- a/arch/arm/kernel/smp_twd.c
> +++ b/arch/arm/kernel/smp_twd.c
> @@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = {
>
> ?static int twd_cpufreq_init(void)
> ?{
> - ? ? ? if (!IS_ERR(twd_clk))
> + ? ? ? if (twd_clk && !IS_ERR(twd_clk))

Checking the clock node is not enoough because you can
not have clock node and rely on calibration..
Testing twd_evt is safe to avoid the issue.

Regards
santosh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init
  2012-02-17 10:47 ` Shilimkar, Santosh
@ 2012-02-17 11:09   ` Tero Kristo
  0 siblings, 0 replies; 4+ messages in thread
From: Tero Kristo @ 2012-02-17 11:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2012-02-17 at 16:17 +0530, Shilimkar, Santosh wrote:
> On Fri, Feb 17, 2012 at 4:04 PM, Tero Kristo <t-kristo@ti.com> wrote:
> > Non-smp platforms don't have local timer support, but the twd_cpufreq_init
> > only checks for IS_ERR during init. Check against null also, to avoid
> > crashes during cpufreq transitions on non-smp platforms.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> I sent a patch for the same issue which Kevin reported.

Oh sorry for the noise then. I did a quick search for a similar patch
but didn't find one. This patch can be ignored.

-Tero

> 
> Thread.
> http://www.spinics.net/lists/arm-kernel/msg160275.html
> 
> >  arch/arm/kernel/smp_twd.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> > index 4285daa..dae8902 100644
> > --- a/arch/arm/kernel/smp_twd.c
> > +++ b/arch/arm/kernel/smp_twd.c
> > @@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = {
> >
> >  static int twd_cpufreq_init(void)
> >  {
> > -       if (!IS_ERR(twd_clk))
> > +       if (twd_clk && !IS_ERR(twd_clk))
> 
> Checking the clock node is not enoough because you can
> not have clock node and rely on calibration..
> Testing twd_evt is safe to avoid the issue.
> 
> Regards
> santosh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init
  2012-02-17 10:34 [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init Tero Kristo
  2012-02-17 10:47 ` Shilimkar, Santosh
@ 2012-02-18 15:56 ` Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2012-02-18 15:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 17-02-2012 14:34, Tero Kristo wrote:

> Non-smp platforms don't have local timer support, but the twd_cpufreq_init
> only checks for IS_ERR during init. Check against null also, to avoid
> crashes during cpufreq transitions on non-smp platforms.

> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>   arch/arm/kernel/smp_twd.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)

> diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> index 4285daa..dae8902 100644
> --- a/arch/arm/kernel/smp_twd.c
> +++ b/arch/arm/kernel/smp_twd.c
> @@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = {
>
>   static int twd_cpufreq_init(void)
>   {
> -	if (!IS_ERR(twd_clk))
> +	if (twd_clk&&  !IS_ERR(twd_clk))

    Why not !IS_ERR_OR_NULL(twd_clk)?

WBR, Sergei

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-18 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17 10:34 [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init Tero Kristo
2012-02-17 10:47 ` Shilimkar, Santosh
2012-02-17 11:09   ` Tero Kristo
2012-02-18 15:56 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox