Skip to contentSkip to conversation

sh_cmt Division by zero in kernel.

bisected Arnd Hannemann 2 participants 6 messages Jul 21, 2010 – Aug 3, 2010 SuperH

lore
Share & tools
lore
#0 lore raw

Hi,

when booting recent genesis-2.6 head on an AP4EVB board a division by zero in kernel is reported:
(Looks identical to: http://thread.gmane.org/gmane.linux.ports.sh.devel/8497)

[    0.000000]  sh_cmt.10: using deprecated clock lookup
[    0.000000]  sh_cmt.10: used for clock events
[    0.000000]  sh_cmt.10: used for periodic clock events
[    0.000000] Division by zero in kernel.
[    0.000000] Backtrace:
[    0.000000] [<c0028f08>] (dump_backtrace+0x0/0x110) from [<c0202ecc>] (dump_stack+0x18/0x1c)
[    0.000000]  r6:c0298978 r5:cf80e600 r4:cf801460 r3:c02a37ac
[    0.000000] [<c0202eb4>] (dump_stack+0x0/0x1c) from [<c002904c>] (__div0+0x18/0x20)
[    0.000000] [<c0029034>] (__div0+0x0/0x20) from [<c01177fc> ](Ldiv0+0x8/0x10)
[    0.000000] [<c0202444>] (sh_cmt_probe+0x0/0x4e4) from [<c0016f40> ](early_platform_driver_probe+0x1c8/0x264)
[    0.000000] [<c0016d78>] (early_platform_driver_probe+0x0/0x264) from[<c000cbb8>] (shmobile_late_time_init+0x24/0x2c)
[    0.000000] [<c000cb94>] (shmobile_late_time_init+0x0/0x2c) from[<c0008978>] (start_kernel+0x208/0x2a8)
[    0.000000] [<c0008770>] (start_kernel+0x0/0x2a8) from [<40008034>](0x40008034)
[    0.000000]  r5:c02bd1f0 r4:10c53c7d
[    0.000000]  sh_cmt.10: used as clock source

and as a result time is running too fast.
For example sleep 60 on bash returns after a few seconds.

Git bisect identified following commit as bad:

commit f4d7c3565c1692c54d9152b52090fe73f0029e37

Author: Paul Mundt <[email protected]>
Date:   Wed Jun 2 17:10:44 2010 +0900

clocksource: sh_cmt: compute mult and shift before registration
Based on the sh_tmu change in 66f49121ffa41a19c59965b31b046d8368fec3c7
("clocksource: sh_tmu: compute mult and shift before registration"). The same issues impact the sh_cmt driver, so we take the same approach here.

Best regards,
Arnd

#1 lore raw

Hi Arnd,

Thanks for reporting and bisecting.

Quoted 23 lines · Arnd Hannemann

Hi,

when booting recent genesis-2.6 head on an AP4EVB board a division by zero in kernel is reported:
(Looks identical to: http://thread.gmane.org/gmane.linux.ports.sh.devel/8497)

[    0.000000]  sh_cmt.10: using deprecated clock lookup
[    0.000000]  sh_cmt.10: used for clock events
[    0.000000]  sh_cmt.10: used for periodic clock events
[    0.000000] Division by zero in kernel.
[    0.000000] Backtrace:
[    0.000000] [<c0028f08>] (dump_backtrace+0x0/0x110) from [<c0202ecc>] (dump_stack+0x18/0x1c)
[    0.000000]  r6:c0298978 r5:cf80e600 r4:cf801460 r3:c02a37ac
[    0.000000] [<c0202eb4>] (dump_stack+0x0/0x1c) from [<c002904c>] (__div0+0x18/0x20)
[    0.000000] [<c0029034>] (__div0+0x0/0x20) from [<c01177fc> ](Ldiv0+0x8/0x10)
[    0.000000] [<c0202444>] (sh_cmt_probe+0x0/0x4e4) from [<c0016f40> ](early_platform_driver_probe+0x1c8/0x264) [    0.000000] [<c0016d78>] (early_platform_driver_probe+0x0/0x264) from[<c000cbb8>] (shmobile_late_time_init+0x24/0x2c) [    0.000000] [<c000cb94>] (shmobile_late_time_init+0x0/0x2c) from[<c0008978>] (start_kernel+0x208/0x2a8) [    0.000000] [<c0008770>] (start_kernel+0x0/0x2a8) from [<40008034>](0x40008034)
[    0.000000]  r5:c02bd1f0 r4:10c53c7d
[    0.000000]  sh_cmt.10: used as clock source

Quoted 2 lines

and as a result time is running too fast.
For example sleep 60 on bash returns after a few seconds.

I suspect 5967d33ce8a030f01a716fc0b25fcb03744a5fda fixes the issue with the time running too fast.

Quoted 6 lines

Git bisect identified following commit as bad:

commit f4d7c3565c1692c54d9152b52090fe73f0029e37
Author: Paul Mundt <[email protected]>
Date:   Wed Jun 2 17:10:44 2010 +0900

Quoted 7 lines

   clocksource: sh_cmt: compute mult and shift before registration Based on the sh_tmu change in 66f49121ffa41a19c59965b31b046d8368fec3c7 ("clocksource: sh_tmu: compute mult and shift before registration"). The same issues impact the sh_cmt driver, so we take the same approach here.

If you revert that one (and perhaps 5967d33ce8a030f01a716fc0b25fcb03744a5fda as well), does it fix your crash?

Thanks,

/ magnus

#2 lore raw
In reply to Arnd Hannemann

Hi Magnus,

Am 22.07.2010 15:55, schrieb Magnus Damm:

Quoted 29 lines

Hi Arnd,

Thanks for reporting and bisecting.

Quoted 23 lines · Arnd Hannemann

Hi,

when booting recent genesis-2.6 head on an AP4EVB board a division by zero in kernel is reported:
(Looks identical to: http://thread.gmane.org/gmane.linux.ports.sh.devel/8497)

[    0.000000]  sh_cmt.10: using deprecated clock lookup
[    0.000000]  sh_cmt.10: used for clock events
[    0.000000]  sh_cmt.10: used for periodic clock events
[    0.000000] Division by zero in kernel.
[    0.000000] Backtrace:
[    0.000000] [<c0028f08>] (dump_backtrace+0x0/0x110) from [<c0202ecc>] (dump_stack+0x18/0x1c)
[    0.000000]  r6:c0298978 r5:cf80e600 r4:cf801460 r3:c02a37ac
[    0.000000] [<c0202eb4>] (dump_stack+0x0/0x1c) from [<c002904c>] (__div0+0x18/0x20)
[    0.000000] [<c0029034>] (__div0+0x0/0x20) from [<c01177fc> ](Ldiv0+0x8/0x10)
[    0.000000] [<c0202444>] (sh_cmt_probe+0x0/0x4e4) from [<c0016f40> ](early_platform_driver_probe+0x1c8/0x264)
[    0.000000] [<c0016d78>] (early_platform_driver_probe+0x0/0x264) from[<c000cbb8>] (shmobile_late_time_init+0x24/0x2c)
[    0.000000] [<c000cb94>] (shmobile_late_time_init+0x0/0x2c) from[<c0008978>] (start_kernel+0x208/0x2a8)
[    0.000000] [<c0008770>] (start_kernel+0x0/0x2a8) from [<40008034>](0x40008034)
[    0.000000]  r5:c02bd1f0 r4:10c53c7d
[    0.000000]  sh_cmt.10: used as clock source
Quoted 6 lines
Quoted 3 lines

and as a result time is running too fast.
For example sleep 60 on bash returns after a few seconds.

I suspect 5967d33ce8a030f01a716fc0b25fcb03744a5fda fixes the issue with the time running too fast.

Not sure what you mean, in the tested tree with the crash above 5967d33ce8a030f01a716fc0b25fcb03744a5fda was already included.

Quoted 15 lines
Quoted 7 lines

Git bisect identified following commit as bad:

commit f4d7c3565c1692c54d9152b52090fe73f0029e37

Author: Paul Mundt <[email protected]>
Date:   Wed Jun 2 17:10:44 2010 +0900
Quoted 8 lines

clocksource: sh_cmt: compute mult and shift before registration

      Based on the sh_tmu change in 66f49121ffa41a19c59965b31b046d8368fec3c7

("clocksource: sh_tmu: compute mult and shift before registration"). The same issues impact the sh_cmt driver, so we take the same approach here.

Quoted 4 lines

If you revert that one (and perhaps 5967d33ce8a030f01a716fc0b25fcb03744a5fda as well), does it fix your crash?

Yes, if I revert both 5967d33ce8a030f01a716fc0b25fcb03744a5fda and f4d7c3565c1692c54d9152b52090fe73f0029e37, this fixes the crash and time is running "normal".

I reverted both mainly because the revert of f4d7c3565c1692c54d9152b52090fe73f0029e37 would not go through cleanly on top of the current tree.

Best regards,
Arnd

#3 lore raw
In reply to Arnd Hannemann

Hi Arnd,

Quoted 21 lines · Arnd Hannemann

Am 22.07.2010 15:55, schrieb Magnus Damm:

Quoted 15 lines · Arnd Hannemann
Quoted 6 lines

Git bisect identified following commit as bad:

commit f4d7c3565c1692c54d9152b52090fe73f0029e37
Author: Paul Mundt <[email protected]>
Date:   Wed Jun 2 17:10:44 2010 +0900

Quoted 8 lines

   clocksource: sh_cmt: compute mult and shift before registration Based on the sh_tmu change in 66f49121ffa41a19c59965b31b046d8368fec3c7 ("clocksource: sh_tmu: compute mult and shift before registration"). The same issues impact the sh_cmt driver, so we take the same approach here.

Quoted 4 lines

If you revert that one (and perhaps 5967d33ce8a030f01a716fc0b25fcb03744a5fda as well), does it fix your crash?

Quoted 7 lines

Yes, if I revert both 5967d33ce8a030f01a716fc0b25fcb03744a5fda and f4d7c3565c1692c54d9152b52090fe73f0029e37, this fixes the crash and time is running "normal".

I reverted both mainly because the revert of f4d7c3565c1692c54d9152b52090fe73f0029e37 would not go through cleanly on top of the current tree.

I think this patch should solve the issue:
http://www.spinics.net/lists/linux-sh/msg05433.html

If you have time, please give it a try.

Thanks,

/ magnus

#4 lore raw
In reply to Arnd Hannemann

Hi Magnus,

Am 02.08.2010 12:35, schrieb Magnus Damm:

Quoted 29 lines
Quoted 26 lines · Arnd Hannemann

Am 22.07.2010 15:55, schrieb Magnus Damm:

Quoted 16 lines
Quoted 6 lines · Arnd Hannemann

Git bisect identified following commit as bad:

commit f4d7c3565c1692c54d9152b52090fe73f0029e37 Author: Paul
Mundt <[email protected]> Date: Wed Jun 2 17:10:44 2010
+0900

Quoted 8 lines

clocksource: sh_cmt: compute mult and shift before registration Based on the sh_tmu change in 66f49121ffa41a19c59965b31b046d8368fec3c7 ("clocksource: sh_tmu:
compute mult and shift before registration"). The same issues impact the sh_cmt driver, so we take the same approach here.
Cc: [email protected] Signed-off-by: Paul Mundt <[email protected]>

Quoted 4 lines

If you revert that one (and perhaps 5967d33ce8a030f01a716fc0b25fcb03744a5fda as well), does it fix your crash?

Yes, if I revert both 5967d33ce8a030f01a716fc0b25fcb03744a5fda and f4d7c3565c1692c54d9152b52090fe73f0029e37, this fixes the crash and time is running "normal".

Quoted 8 lines
Quoted 3 lines

I reverted both mainly because the revert of f4d7c3565c1692c54d9152b52090fe73f0029e37 would not go through cleanly on top of the current tree.

I think this patch should solve the issue:
http://www.spinics.net/lists/linux-sh/msg05433.html

If you have time, please give it a try.

I tried and this actually fixes the bug.

Thanks a lot,
Arnd