All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP2+: timer: Fix crash due to wrong arg to __omap_dm_timer_read_counter
@ 2012-01-23  6:48 ` Vaibhav Hiremath
  0 siblings, 0 replies; 4+ messages in thread
From: Vaibhav Hiremath @ 2012-01-23  6:48 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Vaibhav Hiremath, Tony Lindgren

In dmtimer_read_sched_clock(), wrong argument was getting passed to
__omap_dm_timer_read_counter() function call; instead of "&clksrc",
we were passing "clksrc.io_base", which results into kernel crash.

To reproduce kernel crash, just disable the CONFIG_OMAP_32K_TIMER config
option (and DEBUG_LL) and build/boot the kernel.
This will use dmtimer as a kernel clocksource and lead to kernel
crash during boot  -

[    0.000000] OMAP clocksource: GPTIMER2 at 26000000 Hz
[    0.000000] sched_clock: 32 bits at 26MHz, resolution 38ns, wraps every
165191ms
[    0.000000] Unable to handle kernel paging request at virtual address
00030ef1
[    0.000000] pgd = c0004000
[    0.000000] [00030ef1] *pgd=00000000
[    0.000000] Internal error: Oops: 5 [#1] SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0    Not tainted  (3.3.0-rc1-11574-g0c76665-dirty #3)
[    0.000000] PC is at dmtimer_read_sched_clock+0x18/0x4c
[    0.000000] LR is at update_sched_clock+0x10/0x84
[    0.000000] pc : [<c00243b8>]    lr : [<c0018684>]    psr: 200001d3
[    0.000000] sp : c0641f38  ip : c0641e18  fp : 0000000a
[    0.000000] r10: 151c3303  r9 : 00000026  r8 : 76276259
[    0.000000] r7 : 00028547  r6 : c065ac80  r5 : 431bde82  r4 : c0655968
[    0.000000] r3 : 00030ef1  r2 : fb032000  r1 : 00000028  r0 : 00000001


Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 18f7614..5f2873e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -270,7 +270,7 @@ static struct clocksource clocksource_gpt = {
 static u32 notrace dmtimer_read_sched_clock(void)
 {
 	if (clksrc.reserved)
-		return __omap_dm_timer_read_counter(clksrc.io_base, 1);
+		return __omap_dm_timer_read_counter(&clksrc, 1);

 	return 0;
 }
--
1.7.0.4


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

* [PATCH] ARM: OMAP2+: timer: Fix crash due to wrong arg to __omap_dm_timer_read_counter
@ 2012-01-23  6:48 ` Vaibhav Hiremath
  0 siblings, 0 replies; 4+ messages in thread
From: Vaibhav Hiremath @ 2012-01-23  6:48 UTC (permalink / raw)
  To: linux-arm-kernel

In dmtimer_read_sched_clock(), wrong argument was getting passed to
__omap_dm_timer_read_counter() function call; instead of "&clksrc",
we were passing "clksrc.io_base", which results into kernel crash.

To reproduce kernel crash, just disable the CONFIG_OMAP_32K_TIMER config
option (and DEBUG_LL) and build/boot the kernel.
This will use dmtimer as a kernel clocksource and lead to kernel
crash during boot  -

[    0.000000] OMAP clocksource: GPTIMER2 at 26000000 Hz
[    0.000000] sched_clock: 32 bits at 26MHz, resolution 38ns, wraps every
165191ms
[    0.000000] Unable to handle kernel paging request at virtual address
00030ef1
[    0.000000] pgd = c0004000
[    0.000000] [00030ef1] *pgd=00000000
[    0.000000] Internal error: Oops: 5 [#1] SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0    Not tainted  (3.3.0-rc1-11574-g0c76665-dirty #3)
[    0.000000] PC is at dmtimer_read_sched_clock+0x18/0x4c
[    0.000000] LR is at update_sched_clock+0x10/0x84
[    0.000000] pc : [<c00243b8>]    lr : [<c0018684>]    psr: 200001d3
[    0.000000] sp : c0641f38  ip : c0641e18  fp : 0000000a
[    0.000000] r10: 151c3303  r9 : 00000026  r8 : 76276259
[    0.000000] r7 : 00028547  r6 : c065ac80  r5 : 431bde82  r4 : c0655968
[    0.000000] r3 : 00030ef1  r2 : fb032000  r1 : 00000028  r0 : 00000001


Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 18f7614..5f2873e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -270,7 +270,7 @@ static struct clocksource clocksource_gpt = {
 static u32 notrace dmtimer_read_sched_clock(void)
 {
 	if (clksrc.reserved)
-		return __omap_dm_timer_read_counter(clksrc.io_base, 1);
+		return __omap_dm_timer_read_counter(&clksrc, 1);

 	return 0;
 }
--
1.7.0.4

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

* Re: [PATCH] ARM: OMAP2+: timer: Fix crash due to wrong arg to __omap_dm_timer_read_counter
  2012-01-23  6:48 ` Vaibhav Hiremath
@ 2012-01-26 23:30   ` Tony Lindgren
  -1 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2012-01-26 23:30 UTC (permalink / raw)
  To: Vaibhav Hiremath; +Cc: linux-omap, linux-arm-kernel

* Vaibhav Hiremath <hvaibhav@ti.com> [120122 22:17]:
> In dmtimer_read_sched_clock(), wrong argument was getting passed to
> __omap_dm_timer_read_counter() function call; instead of "&clksrc",
> we were passing "clksrc.io_base", which results into kernel crash.
> 
> To reproduce kernel crash, just disable the CONFIG_OMAP_32K_TIMER config
> option (and DEBUG_LL) and build/boot the kernel.
> This will use dmtimer as a kernel clocksource and lead to kernel
> crash during boot  -
> 
> [    0.000000] OMAP clocksource: GPTIMER2 at 26000000 Hz
> [    0.000000] sched_clock: 32 bits at 26MHz, resolution 38ns, wraps every
> 165191ms
> [    0.000000] Unable to handle kernel paging request at virtual address
> 00030ef1
> [    0.000000] pgd = c0004000
> [    0.000000] [00030ef1] *pgd=00000000
> [    0.000000] Internal error: Oops: 5 [#1] SMP
> [    0.000000] Modules linked in:
> [    0.000000] CPU: 0    Not tainted  (3.3.0-rc1-11574-g0c76665-dirty #3)
> [    0.000000] PC is at dmtimer_read_sched_clock+0x18/0x4c
> [    0.000000] LR is at update_sched_clock+0x10/0x84
> [    0.000000] pc : [<c00243b8>]    lr : [<c0018684>]    psr: 200001d3
> [    0.000000] sp : c0641f38  ip : c0641e18  fp : 0000000a
> [    0.000000] r10: 151c3303  r9 : 00000026  r8 : 76276259
> [    0.000000] r7 : 00028547  r6 : c065ac80  r5 : 431bde82  r4 : c0655968
> [    0.000000] r3 : 00030ef1  r2 : fb032000  r1 : 00000028  r0 : 00000001

Thanks, applying into fixes.

Tony
 
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/timer.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index 18f7614..5f2873e 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -270,7 +270,7 @@ static struct clocksource clocksource_gpt = {
>  static u32 notrace dmtimer_read_sched_clock(void)
>  {
>  	if (clksrc.reserved)
> -		return __omap_dm_timer_read_counter(clksrc.io_base, 1);
> +		return __omap_dm_timer_read_counter(&clksrc, 1);
> 
>  	return 0;
>  }
> --
> 1.7.0.4
> 

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

* [PATCH] ARM: OMAP2+: timer: Fix crash due to wrong arg to __omap_dm_timer_read_counter
@ 2012-01-26 23:30   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2012-01-26 23:30 UTC (permalink / raw)
  To: linux-arm-kernel

* Vaibhav Hiremath <hvaibhav@ti.com> [120122 22:17]:
> In dmtimer_read_sched_clock(), wrong argument was getting passed to
> __omap_dm_timer_read_counter() function call; instead of "&clksrc",
> we were passing "clksrc.io_base", which results into kernel crash.
> 
> To reproduce kernel crash, just disable the CONFIG_OMAP_32K_TIMER config
> option (and DEBUG_LL) and build/boot the kernel.
> This will use dmtimer as a kernel clocksource and lead to kernel
> crash during boot  -
> 
> [    0.000000] OMAP clocksource: GPTIMER2 at 26000000 Hz
> [    0.000000] sched_clock: 32 bits at 26MHz, resolution 38ns, wraps every
> 165191ms
> [    0.000000] Unable to handle kernel paging request at virtual address
> 00030ef1
> [    0.000000] pgd = c0004000
> [    0.000000] [00030ef1] *pgd=00000000
> [    0.000000] Internal error: Oops: 5 [#1] SMP
> [    0.000000] Modules linked in:
> [    0.000000] CPU: 0    Not tainted  (3.3.0-rc1-11574-g0c76665-dirty #3)
> [    0.000000] PC is at dmtimer_read_sched_clock+0x18/0x4c
> [    0.000000] LR is at update_sched_clock+0x10/0x84
> [    0.000000] pc : [<c00243b8>]    lr : [<c0018684>]    psr: 200001d3
> [    0.000000] sp : c0641f38  ip : c0641e18  fp : 0000000a
> [    0.000000] r10: 151c3303  r9 : 00000026  r8 : 76276259
> [    0.000000] r7 : 00028547  r6 : c065ac80  r5 : 431bde82  r4 : c0655968
> [    0.000000] r3 : 00030ef1  r2 : fb032000  r1 : 00000028  r0 : 00000001

Thanks, applying into fixes.

Tony
 
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/timer.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index 18f7614..5f2873e 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -270,7 +270,7 @@ static struct clocksource clocksource_gpt = {
>  static u32 notrace dmtimer_read_sched_clock(void)
>  {
>  	if (clksrc.reserved)
> -		return __omap_dm_timer_read_counter(clksrc.io_base, 1);
> +		return __omap_dm_timer_read_counter(&clksrc, 1);
> 
>  	return 0;
>  }
> --
> 1.7.0.4
> 

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

end of thread, other threads:[~2012-01-26 23:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23  6:48 [PATCH] ARM: OMAP2+: timer: Fix crash due to wrong arg to __omap_dm_timer_read_counter Vaibhav Hiremath
2012-01-23  6:48 ` Vaibhav Hiremath
2012-01-26 23:30 ` Tony Lindgren
2012-01-26 23:30   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.