clocksource/drivers/starfive: Fix shutdown ktime_get call problem 85/301885/2
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 22 Nov 2023 07:41:21 +0000 (16:41 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Mon, 27 Nov 2023 06:16:34 +0000 (15:16 +0900)
commit2c4e4387c1bdecc4adaef767d761ea3e525702d8
tree02582ad101edc8e985cfe04a391ebd952e8bd178
parentd6eafee192960621ee44c480ece6e620207f3f25
clocksource/drivers/starfive: Fix shutdown ktime_get call problem

There is a problem where a warning occurs when ktime_get is called
while in suspend. There is no need to call ktime_get when entering
timer_shutdown. Fix starfive_timer_disable to be called.

[   58.338211] WARNING: CPU: 0 PID: 928 at kernel/time/timekeeping.c:843 ktime_get+0xf4/0x110
[   58.338211] Modules linked in: wave5 videobuf2_dma_contig v4l2_mem2mem starfive_mailbox starfive_mailbox_test
[   58.338211] CPU: 0 PID: 928 Comm: bash Not tainted 6.1.39-00014-g40bc52190beb-dirty #59
[   58.338211] Hardware name: StarFive VisionFive 2 v1.3B (DT)
[   58.338211] epc : ktime_get+0xf4/0x110
[   58.338211]  ra : starfive_timer_suspend+0x5c/0xc6
[   58.338211] epc : ffffffff80098a74 ra : ffffffff809bb316 sp : ffffffc8296e3bc0
[   58.338211]  gp : ffffffff81e6ff10 tp : ffffffd8d3f3de00 t0 : 20646e6570737573
[   58.338211]  t1 : ffffffff81c9b1f8 t2 : 7573205d36363831 s0 : ffffffc8296e3bf0
[   58.338211]  s1 : ffffffd8c3dce880 a0 : ffffffd8c3dce880 a1 : 0000000200000020
[   58.338211]  a2 : 000585b146000000 a3 : 0000000000000000 a4 : 0000000000000000
[   58.338211]  a5 : 0000000000000001 a6 : 0000000010395283 a7 : ffffffffffffffff
[   58.338211]  s2 : ffffffff81228678 s3 : ffffffff81c9b1f8 s4 : ffffffff81eb0ff0
[   58.338211]  s5 : ffffffff81e74040 s6 : 0000000000000000 s7 : 0000003fb94c0d50
[   58.338211]  s8 : 0000000000000001 s9 : 0000003fc2b7d6d0 s10: 000000000000002d
[   58.338211]  s11: 0000002ac45aeb3c t3 : ffffffff81c9b1f8 t4 : ffffffff81e947af
[   58.338211]  t5 : ffffffff81e94788 t6 : ffffffff81eaa8b0
[   58.338211] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
[   58.338211] [<ffffffff80098a74>] ktime_get+0xf4/0x110
[   58.338211] [<ffffffff809bb316>] starfive_timer_suspend+0x5c/0xc6
[   58.338211] [<ffffffff800a2222>] clockevents_suspend+0x30/0x46
[   58.338211] [<ffffffff80deb83e>] timekeeping_suspend+0x236/0x25c
[   58.338211] [<ffffffff8077346c>] syscore_suspend+0x5a/0x1e0
[   58.338211] [<ffffffff80064ea2>] hibernation_snapshot+0x1c8/0x50e
[   58.338211] [<ffffffff800658bc>] hibernate+0xf8/0x29c
[   58.338211] [<ffffffff80063130>] state_store+0xbe/0xc2
[   58.338211] [<ffffffff80dcb836>] kobj_attr_store+0xe/0x1a
[   58.338211] [<ffffffff802708e2>] sysfs_kf_write+0x2a/0x34
[   58.338211] [<ffffffff8026ff1e>] kernfs_fop_write_iter+0xe8/0x16c
[   58.338211] [<ffffffff801f518a>] vfs_write+0x188/0x328
[   58.338211] [<ffffffff801f5468>] ksys_write+0x58/0xd0
[   58.338211] [<ffffffff801f54ee>] sys_write+0xe/0x16
[   58.338211] [<ffffffff80003bee>] ret_from_syscall+0x0/0x2

Change-Id: I3e961637f1204a98b4ea0337dc5ce3a7fc02d191
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/clocksource/timer-starfive.c