Wind River Support Network

HomeDefectsLIN6-14722
Fixed

LIN6-14722 : WARNING: at kernel/time/clockevents.c:241 clockevents_program_event+0x14c/0x15c

Created: Jul 5, 2018    Updated: Jul 5, 2020
Resolved Date: Nov 18, 2018
Found In Version: 6.0.0.20, 6.0.0.36
Fix Version: 6.0.0.38
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Kernel

Description

When use WRlinux6 bcm563xx BSP on bcm56340 board, running the command(date -s 2038.01.19-03:14:06) to set system time, a kernel warning is triggered, and after a while the board reset by hardware watchdog.

Here is the kernel warning log:
----------------
<4>[509469.160000] ------------[ cut here ]------------                                                                             
<4>[509469.160000] WARNING: at kernel/time/clockevents.c:241 clockevents_program_event+0x14c/0x15c()                                
<4>[509469.160000] Modules linked in: vpic(O) lfe(O) tipc(O) ethstate(O) admin_eth(O) linux_user_bde(O) linux_kernel_bde(O) bsp_debu
g(O) flashslot(O) uart8250(O) nls_cp437 nls_iso8859_1 rcw_boot_bak(O) mdio_epld(O) de51sru(O) cpld_update_whole(O) i2c_epld_whole(O)
flash_nvram(O) kbspintf(O) iof_dlog(O) iof_devent(O) iof_iomm(O) vething(O) krunlog(O) kpatch(O) hw_kbredir(O) bsp_common(O) phram 
memenv(O) env(O)                                                                                                                    
<4>[509469.160000] CPU: 1 PID: 1589 Comm: DefSch0600 Tainted: G           O 3.10.62-ltsi-WR6.0.0.20_standard #1                     
<4>[509469.160000] [<c00182f0>] (unwind_backtrace+0x0/0xf8) from [<c0013478>] (show_stack+0x20/0x24)                                
<4>[509469.160000] [<c0013478>] (show_stack+0x20/0x24) from [<c057aa9c>] (dump_stack+0x24/0x28)                                     
<4>[509469.160000] [<c057aa9c>] (dump_stack+0x24/0x28) from [<c0027f58>] (warn_slowpath_common+0x64/0x7c)                           
<4>[509469.160000] [<c0027f58>] (warn_slowpath_common+0x64/0x7c) from [<c002802c>] (warn_slowpath_null+0x2c/0x34)                   
<4>[509469.160000] [<c002802c>] (warn_slowpath_null+0x2c/0x34) from [<c0075fc8>] (clockevents_program_event+0x14c/0x15c)            
<4>[509469.160000] [<c0075fc8>] (clockevents_program_event+0x14c/0x15c) from [<c0077a10>] (tick_program_event+0x44/0x4c)            
<4>[509469.160000] [<c0077a10>] (tick_program_event+0x44/0x4c) from [<c0050c78>] (hrtimer_interrupt+0x248/0x2dc)                    
<4>[509469.160000] [<c0050c78>] (hrtimer_interrupt+0x248/0x2dc) from [<c00162b0>] (twd_handler+0x44/0x54)                           
<4>[509469.160000] [<c00162b0>] (twd_handler+0x44/0x54) from [<c00a0d24>] (handle_percpu_devid_irq+0x90/0x1ac)                      
<4>[509469.160000] [<c00a0d24>] (handle_percpu_devid_irq+0x90/0x1ac) from [<c009ce64>] (generic_handle_irq+0x38/0x48)               
<4>[509469.160000] [<c009ce64>] (generic_handle_irq+0x38/0x48) from [<c000f4f8>] (handle_IRQ+0x50/0xa0)                             
<4>[509469.160000] [<c000f4f8>] (handle_IRQ+0x50/0xa0) from [<c000876c>] (gic_handle_irq+0x3c/0x6c)                                 
<4>[509469.160000] [<c000876c>] (gic_handle_irq+0x3c/0x6c) from [<c057fe80>] (__irq_usr+0x40/0x60)                                  
<4>[509469.160000] Exception stack(0xecab5fb0 to 0xecab5ff8)                                                                        
<4>[509469.160000] 5fa0:                                     00000000 00000128 00000155 b041ea88                                    
<4>[509469.160000] 5fc0: 00000000 a87216c0 a87215b0 0000002f 00000000 a87215b8 b26bc268 a872160c                                    
<4>[509469.160000] 5fe0: a8721538 a8721590 b041eaa4 afa88c84 600e0010 ffffffff                                                      
<4>[509469.160000] ---[ end trace 55b6a76b1ea145bd ]---                                                                             
<4>[509469.160000] hrtimer: interrupt took 3558 ns                                                                                  
<6>[509469.160000] The flag of watch dog is 1   
----------------

After check the related kernel source code, it shoubd be the expires.tv64 overflow and trigger the warning:
------------
int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
                                                      bool force)
{
                unsigned long long clc;
                int64_t delta;
                int rc;

                if (unlikely(expires.tv64 < 0)) {
                                WARN_ON_ONCE(1);
                                return -ETIME;
                }
------------

On WRlinux6 qemuarm BSP, when running this command, we don't see the kernel warning, but the system time becom to 1901. We suspect that it's similar issue that even not triggering the kernel warning, it's also should be caused by some counter overflow.

Steps to Reproduce

1. Project configuration
bcm563xx
/opt/WRLX6/wrlinux-6/wrlinux/configure --enable-board=bcm-563xx --enable-kernel=standard --enable-rootfs=glibc_small --enable-reconfig --enable-rm-oldimgs=yes --enable-parallel-pkgbuilds=8 --enable-jobs=8

qemuarma9
/opt/WRLX6/wrlinux-6/wrlinux/configure --enable-board=qemuarma9 --enable-jobs=8 --enable-parallel-pkgbuilds=8 --enable-rootfs=glibc_small --with-rcpl-version=0036

2. for qemuarma9 (and perhaps qemuarm), run "make start-target", after bootup, run the command:
date -s 2038.01.19-03:14:06  

Then will see the time become to 1901.
----------
root@qemu0:~# date
Fri Jul  6 03:02:44 UTC 2018
root@qemu0:~# date -s 2038.01.19-03:14:06  
Tue Jan 19 03:14:06 UTC 2038
root@qemu0:~# date
Tue Jan 19 03:14:07 UTC 2038
root@qemu0:~# date
Fri Dec 13 20:45:58 UTC 1901
root@qemu0:~# date
Fri Dec 13 20:46:00 UTC 1901
root@qemu0:~# date
Fri Dec 13 20:46:01 UTC 1901
root@qemu0:~# uname -a
Linux qemu0 3.10.62-ltsi-WR6.0.0.35_standard #1 PREEMPT Thu Jul 5 16:12:18 CST 2018 armv5tejl GNU/Linux
----------

On bcm563xx, run the date command to set time to 2038, it will trigger the kernel waarning, and then the board will reset by hardware watchdog.

Other Downloads


Live chat
Online