You can subscribe to this list here.
| 1999 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(15) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2000 |
Jan
(6) |
Feb
(1) |
Mar
(39) |
Apr
(13) |
May
(24) |
Jun
(11) |
Jul
(23) |
Aug
(85) |
Sep
(12) |
Oct
(103) |
Nov
(79) |
Dec
(112) |
| 2001 |
Jan
(52) |
Feb
(82) |
Mar
(84) |
Apr
(65) |
May
(105) |
Jun
(188) |
Jul
(174) |
Aug
(182) |
Sep
(103) |
Oct
(137) |
Nov
(143) |
Dec
(98) |
| 2002 |
Jan
(258) |
Feb
(236) |
Mar
(386) |
Apr
(307) |
May
(238) |
Jun
(170) |
Jul
(252) |
Aug
(230) |
Sep
(278) |
Oct
(394) |
Nov
(336) |
Dec
(194) |
| 2003 |
Jan
(290) |
Feb
(182) |
Mar
(175) |
Apr
(220) |
May
(209) |
Jun
(286) |
Jul
(279) |
Aug
(164) |
Sep
(208) |
Oct
(324) |
Nov
(204) |
Dec
(380) |
| 2004 |
Jan
(344) |
Feb
(332) |
Mar
(395) |
Apr
(357) |
May
(349) |
Jun
(352) |
Jul
(279) |
Aug
(269) |
Sep
(374) |
Oct
(442) |
Nov
(428) |
Dec
(253) |
| 2005 |
Jan
(225) |
Feb
(219) |
Mar
(245) |
Apr
(249) |
May
(203) |
Jun
(157) |
Jul
(171) |
Aug
(194) |
Sep
(200) |
Oct
(232) |
Nov
(190) |
Dec
(195) |
| 2006 |
Jan
(158) |
Feb
(190) |
Mar
(235) |
Apr
(161) |
May
(134) |
Jun
(169) |
Jul
(117) |
Aug
(161) |
Sep
(170) |
Oct
(297) |
Nov
(230) |
Dec
(205) |
| 2007 |
Jan
(197) |
Feb
(132) |
Mar
(151) |
Apr
(97) |
May
(109) |
Jun
(99) |
Jul
(57) |
Aug
(110) |
Sep
(56) |
Oct
(119) |
Nov
(39) |
Dec
(45) |
| 2008 |
Jan
(101) |
Feb
(116) |
Mar
(141) |
Apr
(98) |
May
(133) |
Jun
(61) |
Jul
(43) |
Aug
(76) |
Sep
(20) |
Oct
(32) |
Nov
(22) |
Dec
(41) |
| 2009 |
Jan
(35) |
Feb
(15) |
Mar
(18) |
Apr
(13) |
May
(13) |
Jun
(26) |
Jul
(12) |
Aug
(32) |
Sep
(21) |
Oct
(41) |
Nov
(35) |
Dec
(12) |
| 2010 |
Jan
(3) |
Feb
(35) |
Mar
(28) |
Apr
(20) |
May
(5) |
Jun
(14) |
Jul
(6) |
Aug
(8) |
Sep
(20) |
Oct
(20) |
Nov
(10) |
Dec
(12) |
| 2011 |
Jan
(14) |
Feb
(10) |
Mar
(14) |
Apr
(14) |
May
(13) |
Jun
(43) |
Jul
(13) |
Aug
(50) |
Sep
(30) |
Oct
(23) |
Nov
(15) |
Dec
(49) |
| 2012 |
Jan
(15) |
Feb
(28) |
Mar
(7) |
Apr
|
May
(12) |
Jun
(13) |
Jul
(28) |
Aug
(11) |
Sep
(19) |
Oct
(27) |
Nov
(5) |
Dec
(25) |
| 2013 |
Jan
(18) |
Feb
(19) |
Mar
(56) |
Apr
(26) |
May
(38) |
Jun
(24) |
Jul
(42) |
Aug
(24) |
Sep
(4) |
Oct
(3) |
Nov
(18) |
Dec
(4) |
| 2014 |
Jan
(10) |
Feb
(9) |
Mar
(3) |
Apr
|
May
(12) |
Jun
(34) |
Jul
(8) |
Aug
(18) |
Sep
(3) |
Oct
(27) |
Nov
(2) |
Dec
(1) |
| 2015 |
Jan
|
Feb
(10) |
Mar
(49) |
Apr
(2) |
May
(4) |
Jun
(7) |
Jul
(1) |
Aug
(17) |
Sep
(7) |
Oct
(35) |
Nov
(40) |
Dec
(4) |
| 2016 |
Jan
(9) |
Feb
|
Mar
(6) |
Apr
|
May
(10) |
Jun
(2) |
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
(1) |
| 2017 |
Jan
(2) |
Feb
(4) |
Mar
(1) |
Apr
(4) |
May
(31) |
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(2) |
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Richard W. <ri...@no...> - 2014-05-26 14:36:46
|
Am 20.05.2014 16:32, schrieb Jonathan Rudenberg: > On 2014-03-16, 11:09 AM, Richard Weinberger wrote: >> Am 14.03.2014 15:57, schrieb Thomas Meyer: >>> >>> only some processes get stuck. >>> >>> After enabling hung task detection in the kernel I see this in the logs: >>> >>> [ 8040.100000] INFO: task jbd2/ubda-8:308 blocked for more than 120 >>> seconds. > ... >>> >>> any ideas? some synchronisation error in ext4? >> >> Hmm, maybe you suffer from the same issue this patch tries to address: >> https://lkml.org/lkml/2014/2/14/733 > > I'm running into a very similar issue on vanilla 3.14.4 and 3.15-rc5, both appear to have that patch already applied. > > I've tested ext4, ext3, btrfs, all with the same issue: processes writing to disk in the guest randomly hang permanently after a few minutes of uptime. The guest reports 100% > iowait, the host has no load and is totally fine. Can you share your UML disk image? Maybe your userspace triggers some odds. What distro is it? Does it only happen with ubd disks? IOW does NFS or hostfs work? Thanks, //richard |
|
From: Thomas M. <th...@m3...> - 2014-05-20 17:06:24
|
>> On May 20, 2014, at 12:10 PM, Thomas Meyer <th...@m3...> wrote: >> >> I still run into this error, too! >> >> My previous statement that this issue is fixed was wrong. >> >> With kind regards >> Thomas >> >> Am 20.05.2014 16:32 schrieb Jonathan Rudenberg <jon...@ti...>: >>> >>> On 2014-03-16, 11:09 AM, Richard Weinberger wrote: >>>> Am 14.03.2014 15:57, schrieb Thomas Meyer: >>>>> >>>>> only some processes get stuck. >>>>> >>>>> After enabling hung task detection in the kernel I see this in the logs: >>>>> >>>>> [ 8040.100000] INFO: task jbd2/ubda-8:308 blocked for more than 120 >>>>> seconds. >>> ... >>>>> >>>>> any ideas? some synchronisation error in ext4? >>>> >>>> Hmm, maybe you suffer from the same issue this patch tries to address: >>>> https://lkml.org/lkml/2014/2/14/733 >>> >>> I'm running into a very similar issue on vanilla 3.14.4 and 3.15-rc5, >>> both appear to have that patch already applied. >>> >>> I've tested ext4, ext3, btrfs, all with the same issue: processes >>> writing to disk in the guest randomly hang permanently after a few >>> minutes of uptime. The guest reports 100% iowait, the host has no load >>> and is totally fine. >>> >>> Any suggestions would be appreciated. >>> >>> Thanks, >>> >>> Jonathan >>> >>> >>> INFO: task jbd2/ubda-8:347 blocked for more than 120 seconds. >>> Not tainted 3.14.4 #5 >>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. >>> jbd2/ubda-8 D 000000000042fc13 0 347 2 0x00000000 >>> Stack: >>> 60538e60 7fb14820 8044dba0 80d2a4d0 >>> 7fa5a480 60021e1f 60038290 6007db40 >>> 80d2a1c0 6042adf2 00000000 6006d120 >>> Call Trace: >>> [<60021e1f>] ? __switch_to+0x4f/0x90 >>> [<60038290>] ? block_signals+0x0/0x20 >>> [<6007db40>] ? rcu_sched_qs+0x0/0xb0 >>> [<6042adf2>] ? __schedule+0x1c2/0x510 >>> [<6006d120>] ? pick_next_task_fair+0x0/0x190 >>> [<60119d50>] ? sleep_on_buffer+0x0/0x20 >>> [<60023340>] ? itimer_read+0x10/0x40 >>> [<60119d50>] ? sleep_on_buffer+0x0/0x20 >>> [<6042b173>] ? schedule+0x33/0x80 >>> [<60234023>] ? submit_bio+0xa3/0x1d0 >>> [<6042b692>] ? io_schedule+0xb2/0x130 >>> [<6006fc00>] ? prepare_to_wait+0x0/0x90 >>> [<60119d60>] ? sleep_on_buffer+0x10/0x20 >>> [<6042b8b0>] ? __wait_on_bit+0x60/0xa0 >>> [<60119d50>] ? sleep_on_buffer+0x0/0x20 >>> [<6042ba2b>] ? out_of_line_wait_on_bit+0x8b/0xa0 >>> [<601d1061>] ? journal_submit_commit_record.isra.25+0x181/0x240 >>> [<6006f940>] ? wake_bit_function+0x0/0x40 >>> [<6011b090>] ? __brelse+0x0/0x20 >>> [<6011b090>] ? __brelse+0x0/0x20 >>> [<6042b350>] ? _cond_resched+0x0/0x50 >>> [<601d25a1>] ? jbd2_journal_commit_transaction+0x1481/0x1770 >>> [<60038290>] ? block_signals+0x0/0x20 >>> [<6004cb1f>] ? lock_timer_base.isra.37+0x3f/0x80 >>> [<6004d6f0>] ? del_timer+0x0/0x60 >>> [<6006fae0>] ? __wake_up+0x0/0x60 >>> [<601d5b74>] ? kjournald2+0xd4/0x2b0 >>> [<6042ae0b>] ? __schedule+0x1db/0x510 >>> [<6006d120>] ? pick_next_task_fair+0x0/0x190 >>> [<6006f900>] ? autoremove_wake_function+0x0/0x40 >>> [<6006f9b0>] ? __init_waitqueue_head+0x0/0x10 >>> [<601d5aa0>] ? kjournald2+0x0/0x2b0 >>> [<6006f9b0>] ? __init_waitqueue_head+0x0/0x10 >>> [<600609ef>] ? kthread+0x10f/0x140 >>> [<6006817d>] ? finish_task_switch.isra.78+0x2d/0x90 >>> [<60069612>] ? schedule_tail+0x22/0xd0 >>> [<60021c02>] ? new_thread_handler+0x82/0xb0 >>> >>> INFO: task git:1150 blocked for more than 120 seconds. >>> Not tainted 3.14.4 #5 >>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. >>> git D 000000000042fc13 0 1150 1146 0x00000000 >>> Stack: >>> 60538e60 6052b1e0 7e801ce0 7fb9b750 >>> 807ddc00 60021e1f 60038290 6007db40 >>> 7fb9b440 6042adf2 604324c0 6006d120 >>> Call Trace: >>> [<60021e1f>] ? __switch_to+0x4f/0x90 >>> [<60038290>] ? block_signals+0x0/0x20 >>> [<6007db40>] ? rcu_sched_qs+0x0/0xb0 >>> [<6042adf2>] ? __schedule+0x1c2/0x510 >>> [<6006d120>] ? pick_next_task_fair+0x0/0x190 >>> [<600385dc>] ? set_signals+0x3c/0x50 >>> [<6006fd20>] ? prepare_to_wait_event+0x0/0x110 >>> [<6042b140>] ? schedule+0x0/0x80 >>> [<6042b173>] ? schedule+0x33/0x80 >>> [<601d6693>] ? jbd2_log_wait_commit+0x93/0x100 >>> [<6006f900>] ? autoremove_wake_function+0x0/0x40 >>> [<6018b942>] ? ext4_sync_file+0x282/0x310 >>> [<601187aa>] ? do_fsync+0x4a/0x80 >>> [<60118b12>] ? SyS_fsync+0x12/0x20 >>> [<600256a0>] ? handle_syscall+0x60/0x80 >>> [<6003be9b>] ? userspace+0x49b/0x5a0 >>> [<600256f0>] ? copy_chunk_to_user+0x0/0x30 >>> [<60025985>] ? do_op_one_page+0x145/0x210 >>> [<60025c71>] ? copy_to_user+0x61/0xb0 >>> [<60036f5f>] ? save_registers+0x1f/0x40 >>> [<6003ec40>] ? arch_prctl+0x190/0x1c0 >>> [<60021cb5>] ? fork_handler+0x85/0x90 >>> >>> $ ps -eo pid,user,wchan=WIDE-WCHAN-COLUMN0000000000000 -o s,cmd >>> PID USER WIDE-WCHAN-COLUMN0000000000000 S CMD >>> 1 root pick_next_task_fair S /sbin/init >>> 2 root pick_next_task_fair S [kthreadd] >>> 3 root pick_next_task_fair S [ksoftirqd/0] >>> 4 root pick_next_task_fair S [kworker/0:0] >>> 5 root pick_next_task_fair S [kworker/0:0H] >>> 6 root pick_next_task_fair S [kworker/u2:0] >>> 7 root pick_next_task_fair S [watchdog/0] >>> 8 root pick_next_task_fair S [khelper] >>> 9 root pick_next_task_fair S [kdevtmpfs] >>> 10 root pick_next_task_fair S [netns] >>> 91 root pick_next_task_fair S [writeback] >>> 93 root pick_next_task_fair S [bioset] >>> 95 root pick_next_task_fair S [kblockd] >>> 113 root pick_next_task_fair S [kworker/0:1] >>> 123 root pick_next_task_fair S [khungtaskd] >>> 124 root pick_next_task_fair S [kswapd0] >>> 125 root pick_next_task_fair S [fsnotify_mark] >>> 249 root pick_next_task_fair S [ipv6_addrconf] >>> 346 root pick_next_task_fair S [deferwq] >>> 347 root pick_next_task_fair D [jbd2/ubda-8] >>> 348 root pick_next_task_fair S [ext4-rsv-conver] >>> 366 root pick_next_task_fair S [kworker/0:1H] >>> 468 root pick_next_task_fair S upstart-udev-bridge >>> 472 root pick_next_task_fair S /lib/systemd >>> 741 root pick_next_task_fair S [jbd2/ubdb-8] >>> 742 root pick_next_task_fair S [ext4-rsv-conver] >>> 890 root pick_next_task_fair S /usr/bin/docker -d >>> 967 syslog pick_next_task_fair S rsyslogd >>> 1006 root pick_next_task_fair S [kworker/u2:2] >>> 1036 root pick_next_task_fair S /sbin/getty -8 38400 >>> 1037 root pick_next_task_fair S /sbin/getty -8 38400 >>> 1040 root pick_next_task_fair S /sbin/getty -8 38400 >>> 1041 root pick_next_task_fair S /bin/login -- >>> 1043 root pick_next_task_fair S /sbin/getty -8 38400 >>> 1089 root pick_next_task_fair S /usr/sbin/sshd -D >>> 1090 root pick_next_task_fair S cron >>> 1092 root pick_next_task_fair S sshd: ubuntu [priv] >>> 1096 root pick_next_task_fair S [kauditd] >>> 1106 ubuntu pick_next_task_fair S sshd: ubuntu@notty >>> 1107 ubuntu pick_next_task_fair S bash >>> 1112 root pick_next_task_fair S /sbin/getty -8 38400 >>> 1132 root pick_next_task_fair S upstart-socket-bridge >>> 1133 root pick_next_task_fair S upstart-file-bridge >>> 1138 ubuntu pick_next_task_fair S /bin/bash >>> 1141 ubuntu pick_next_task_fair S git clone >>> 1142 ubuntu pick_next_task_fair S git-remote-https origin >>> 1146 ubuntu pick_next_task_fair S git fetch-pack >>> 1150 ubuntu pick_next_task_fair D git index-pack --stdin >>> 1160 ubuntu pick_next_task_fair S -bash > |
|
From: Jonathan R. <jon...@ti...> - 2014-05-20 14:52:42
|
On 2014-03-16, 11:09 AM, Richard Weinberger wrote: > Am 14.03.2014 15:57, schrieb Thomas Meyer: >> >> only some processes get stuck. >> >> After enabling hung task detection in the kernel I see this in the logs: >> >> [ 8040.100000] INFO: task jbd2/ubda-8:308 blocked for more than 120 >> seconds. ... >> >> any ideas? some synchronisation error in ext4? > > Hmm, maybe you suffer from the same issue this patch tries to address: > https://lkml.org/lkml/2014/2/14/733 I'm running into a very similar issue on vanilla 3.14.4 and 3.15-rc5, both appear to have that patch already applied. I've tested ext4, ext3, btrfs, all with the same issue: processes writing to disk in the guest randomly hang permanently after a few minutes of uptime. The guest reports 100% iowait, the host has no load and is totally fine. Any suggestions would be appreciated. Thanks, Jonathan INFO: task jbd2/ubda-8:347 blocked for more than 120 seconds. Not tainted 3.14.4 #5 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. jbd2/ubda-8 D 000000000042fc13 0 347 2 0x00000000 Stack: 60538e60 7fb14820 8044dba0 80d2a4d0 7fa5a480 60021e1f 60038290 6007db40 80d2a1c0 6042adf2 00000000 6006d120 Call Trace: [<60021e1f>] ? __switch_to+0x4f/0x90 [<60038290>] ? block_signals+0x0/0x20 [<6007db40>] ? rcu_sched_qs+0x0/0xb0 [<6042adf2>] ? __schedule+0x1c2/0x510 [<6006d120>] ? pick_next_task_fair+0x0/0x190 [<60119d50>] ? sleep_on_buffer+0x0/0x20 [<60023340>] ? itimer_read+0x10/0x40 [<60119d50>] ? sleep_on_buffer+0x0/0x20 [<6042b173>] ? schedule+0x33/0x80 [<60234023>] ? submit_bio+0xa3/0x1d0 [<6042b692>] ? io_schedule+0xb2/0x130 [<6006fc00>] ? prepare_to_wait+0x0/0x90 [<60119d60>] ? sleep_on_buffer+0x10/0x20 [<6042b8b0>] ? __wait_on_bit+0x60/0xa0 [<60119d50>] ? sleep_on_buffer+0x0/0x20 [<6042ba2b>] ? out_of_line_wait_on_bit+0x8b/0xa0 [<601d1061>] ? journal_submit_commit_record.isra.25+0x181/0x240 [<6006f940>] ? wake_bit_function+0x0/0x40 [<6011b090>] ? __brelse+0x0/0x20 [<6011b090>] ? __brelse+0x0/0x20 [<6042b350>] ? _cond_resched+0x0/0x50 [<601d25a1>] ? jbd2_journal_commit_transaction+0x1481/0x1770 [<60038290>] ? block_signals+0x0/0x20 [<6004cb1f>] ? lock_timer_base.isra.37+0x3f/0x80 [<6004d6f0>] ? del_timer+0x0/0x60 [<6006fae0>] ? __wake_up+0x0/0x60 [<601d5b74>] ? kjournald2+0xd4/0x2b0 [<6042ae0b>] ? __schedule+0x1db/0x510 [<6006d120>] ? pick_next_task_fair+0x0/0x190 [<6006f900>] ? autoremove_wake_function+0x0/0x40 [<6006f9b0>] ? __init_waitqueue_head+0x0/0x10 [<601d5aa0>] ? kjournald2+0x0/0x2b0 [<6006f9b0>] ? __init_waitqueue_head+0x0/0x10 [<600609ef>] ? kthread+0x10f/0x140 [<6006817d>] ? finish_task_switch.isra.78+0x2d/0x90 [<60069612>] ? schedule_tail+0x22/0xd0 [<60021c02>] ? new_thread_handler+0x82/0xb0 INFO: task git:1150 blocked for more than 120 seconds. Not tainted 3.14.4 #5 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. git D 000000000042fc13 0 1150 1146 0x00000000 Stack: 60538e60 6052b1e0 7e801ce0 7fb9b750 807ddc00 60021e1f 60038290 6007db40 7fb9b440 6042adf2 604324c0 6006d120 Call Trace: [<60021e1f>] ? __switch_to+0x4f/0x90 [<60038290>] ? block_signals+0x0/0x20 [<6007db40>] ? rcu_sched_qs+0x0/0xb0 [<6042adf2>] ? __schedule+0x1c2/0x510 [<6006d120>] ? pick_next_task_fair+0x0/0x190 [<600385dc>] ? set_signals+0x3c/0x50 [<6006fd20>] ? prepare_to_wait_event+0x0/0x110 [<6042b140>] ? schedule+0x0/0x80 [<6042b173>] ? schedule+0x33/0x80 [<601d6693>] ? jbd2_log_wait_commit+0x93/0x100 [<6006f900>] ? autoremove_wake_function+0x0/0x40 [<6018b942>] ? ext4_sync_file+0x282/0x310 [<601187aa>] ? do_fsync+0x4a/0x80 [<60118b12>] ? SyS_fsync+0x12/0x20 [<600256a0>] ? handle_syscall+0x60/0x80 [<6003be9b>] ? userspace+0x49b/0x5a0 [<600256f0>] ? copy_chunk_to_user+0x0/0x30 [<60025985>] ? do_op_one_page+0x145/0x210 [<60025c71>] ? copy_to_user+0x61/0xb0 [<60036f5f>] ? save_registers+0x1f/0x40 [<6003ec40>] ? arch_prctl+0x190/0x1c0 [<60021cb5>] ? fork_handler+0x85/0x90 $ ps -eo pid,user,wchan=WIDE-WCHAN-COLUMN0000000000000 -o s,cmd PID USER WIDE-WCHAN-COLUMN0000000000000 S CMD 1 root pick_next_task_fair S /sbin/init 2 root pick_next_task_fair S [kthreadd] 3 root pick_next_task_fair S [ksoftirqd/0] 4 root pick_next_task_fair S [kworker/0:0] 5 root pick_next_task_fair S [kworker/0:0H] 6 root pick_next_task_fair S [kworker/u2:0] 7 root pick_next_task_fair S [watchdog/0] 8 root pick_next_task_fair S [khelper] 9 root pick_next_task_fair S [kdevtmpfs] 10 root pick_next_task_fair S [netns] 91 root pick_next_task_fair S [writeback] 93 root pick_next_task_fair S [bioset] 95 root pick_next_task_fair S [kblockd] 113 root pick_next_task_fair S [kworker/0:1] 123 root pick_next_task_fair S [khungtaskd] 124 root pick_next_task_fair S [kswapd0] 125 root pick_next_task_fair S [fsnotify_mark] 249 root pick_next_task_fair S [ipv6_addrconf] 346 root pick_next_task_fair S [deferwq] 347 root pick_next_task_fair D [jbd2/ubda-8] 348 root pick_next_task_fair S [ext4-rsv-conver] 366 root pick_next_task_fair S [kworker/0:1H] 468 root pick_next_task_fair S upstart-udev-bridge 472 root pick_next_task_fair S /lib/systemd 741 root pick_next_task_fair S [jbd2/ubdb-8] 742 root pick_next_task_fair S [ext4-rsv-conver] 890 root pick_next_task_fair S /usr/bin/docker -d 967 syslog pick_next_task_fair S rsyslogd 1006 root pick_next_task_fair S [kworker/u2:2] 1036 root pick_next_task_fair S /sbin/getty -8 38400 1037 root pick_next_task_fair S /sbin/getty -8 38400 1040 root pick_next_task_fair S /sbin/getty -8 38400 1041 root pick_next_task_fair S /bin/login -- 1043 root pick_next_task_fair S /sbin/getty -8 38400 1089 root pick_next_task_fair S /usr/sbin/sshd -D 1090 root pick_next_task_fair S cron 1092 root pick_next_task_fair S sshd: ubuntu [priv] 1096 root pick_next_task_fair S [kauditd] 1106 ubuntu pick_next_task_fair S sshd: ubuntu@notty 1107 ubuntu pick_next_task_fair S bash 1112 root pick_next_task_fair S /sbin/getty -8 38400 1132 root pick_next_task_fair S upstart-socket-bridge 1133 root pick_next_task_fair S upstart-file-bridge 1138 ubuntu pick_next_task_fair S /bin/bash 1141 ubuntu pick_next_task_fair S git clone 1142 ubuntu pick_next_task_fair S git-remote-https origin 1146 ubuntu pick_next_task_fair S git fetch-pack 1150 ubuntu pick_next_task_fair D git index-pack --stdin 1160 ubuntu pick_next_task_fair S -bash |
|
From: Thomas M. <th...@m3...> - 2014-03-18 14:17:08
|
Am Sonntag, den 16.03.2014, 16:09 +0100 schrieb Richard Weinberger: > > Am 14.03.2014 15:57, schrieb Thomas Meyer: > > Am Mittwoch, den 06.11.2013, 20:59 +0100 schrieb Richard Weinberger: > >> Am 06.11.2013 20:52, schrieb Thomas Meyer: > >>> Am Mittwoch, den 06.11.2013, 13:40 +0100 schrieb Richard Weinberger: > >>>> On Tue, Nov 5, 2013 at 9:21 PM, Thomas Meyer <th...@m3...> wrote: > >>>>> Hi, > >>>>> > >>>>> I'm running Fedora 20 inside a 3.12 UML kernel and the "yum upgrade -y" > >>>>> command seems to get stuck after a while/few minutes. > >>>>> > >>>>> Any ideas what's going one here? How to debug this? > >>>>> > >>>>> It looks like the process running yum is in state ptrace stopped, but > >>>>> doesn't continue. > >>>> > >>>> Got only yum stuck or the whole UML kernel? > >>> > > > > only some processes get stuck. > > > > After enabling hung task detection in the kernel I see this in the logs: > > > > [ 8040.100000] INFO: task jbd2/ubda-8:308 blocked for more than 120 > > seconds. > > [ 8040.100000] Not tainted 3.13.6 #24 > > [ 8040.100000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" > > disables this message. > > [ 8040.100000] jbd2/ubda-8 D 0000000040aa1c83 0 308 2 > > 0x00000000 > > [ 8040.100000] Stack: > > [ 8040.100000] 600795a0 603f3120 b066db70 6006476d > > [ 8040.100000] 1b066dbb0 b0631040 b066db80 6001c0a3 > > [ 8040.100000] 600795a0 b066b380 b066dbe0 60314b4e > > [ 8040.100000] Call Trace: > > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > > [ 8040.100000] [<6006476d>] ? dequeue_task+0x1d/0x50 > > [ 8040.100000] [<6001c0a3>] __switch_to+0x53/0x90 > > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > > [ 8040.100000] [<60314b4e>] __schedule+0x1ae/0x470 > > [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 > > [ 8040.100000] [<6006aa70>] ? prepare_to_wait+0x0/0x90 > > [ 8040.100000] [<60314e43>] schedule+0x33/0x80 > > [ 8040.100000] [<6020b9d4>] ? submit_bio+0xa4/0x1c0 > > [ 8040.100000] [<60315030>] io_schedule+0x60/0x90 > > [ 8040.100000] [<6010b7b0>] sleep_on_buffer+0x10/0x20 > > [ 8040.100000] [<603153a3>] __wait_on_bit+0x63/0xa0 > > [ 8040.100000] [<6010b7a0>] ? sleep_on_buffer+0x0/0x20 > > [ 8040.100000] [<6010b7a0>] ? sleep_on_buffer+0x0/0x20 > > [ 8040.100000] [<60315466>] out_of_line_wait_on_bit+0x86/0xa0 > > [ 8040.100000] [<6010e312>] ? submit_bh+0x12/0x20 > > [ 8040.100000] [<6006aed0>] ? wake_bit_function+0x0/0x40 > > [ 8040.100000] [<600645e3>] ? __might_sleep+0x153/0x170 > > [ 8040.100000] [<60064490>] ? __might_sleep+0x0/0x170 > > [ 8040.100000] [<6010b890>] ? __wait_on_buffer+0x0/0x40 > > [ 8040.100000] [<6010b8c4>] __wait_on_buffer+0x34/0x40 > > [ 8040.100000] [<6019a166>] jbd2_journal_commit_transaction > > +0x1696/0x19a0 > > [ 8040.100000] [<60315060>] ? _cond_resched+0x0/0x50 > > [ 8040.100000] [<6010d200>] ? __brelse+0x0/0x30 > > [ 8040.100000] [<600330c0>] ? block_signals+0x0/0x20 > > [ 8040.100000] [<6006abff>] ? finish_wait+0x6f/0x90 > > [ 8040.100000] [<6006a950>] ? __wake_up+0x0/0x70 > > [ 8040.100000] [<600487c0>] ? del_timer+0x0/0x60 > > [ 8040.100000] [<6006a950>] ? __wake_up+0x0/0x70 > > [ 8040.100000] [<6019dd5f>] kjournald2+0xdf/0x2d0 > > [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 > > [ 8040.100000] [<6006ae90>] ? autoremove_wake_function+0x0/0x40 > > [ 8040.100000] [<6019dc80>] ? kjournald2+0x0/0x2d0 > > [ 8040.100000] [<6006a670>] ? __init_waitqueue_head+0x0/0x10 > > [ 8040.100000] [<6019dc80>] ? kjournald2+0x0/0x2d0 > > [ 8040.100000] [<6006a670>] ? __init_waitqueue_head+0x0/0x10 > > [ 8040.100000] [<6005ce44>] kthread+0x114/0x140 > > [ 8040.100000] [<6006442d>] ? finish_task_switch.isra.72+0x2d/0x90 > > [ 8040.100000] [<600656a2>] ? schedule_tail+0x22/0xd0 > > [ 8040.100000] [<6001be21>] new_thread_handler+0x81/0xb0 > > [ 8040.100000] > > [ 8040.100000] INFO: task yum:1082 blocked for more than 120 seconds. > > [ 8040.100000] Not tainted 3.13.6 #24 > > [ 8040.100000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" > > disables this message. > > [ 8040.100000] yum D 0000000040aa1c83 0 1082 1073 > > 0x00000000 > > [ 8040.100000] Stack: > > [ 8040.100000] 600795a0 603f3120 aae3fc80 6006476d > > [ 8040.100000] 162b83078 b0631040 aae3fc90 6001c0a3 > > [ 8040.100000] 600795a0 aadeab40 aae3fcf0 60314b4e > > [ 8040.100000] Call Trace: > > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > > [ 8040.100000] [<6006476d>] ? dequeue_task+0x1d/0x50 > > [ 8040.100000] [<6001c0a3>] __switch_to+0x53/0x90 > > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > > [ 8040.100000] [<60314b4e>] __schedule+0x1ae/0x470 > > [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 > > [ 8040.100000] [<6003344f>] ? set_signals+0x3f/0x50 > > [ 8040.100000] [<6006ace0>] ? prepare_to_wait_event+0x0/0x110 > > [ 8040.100000] [<60314e10>] ? schedule+0x0/0x80 > > [ 8040.100000] [<60314e43>] schedule+0x33/0x80 > > [ 8040.100000] [<6006ace0>] ? prepare_to_wait_event+0x0/0x110 > > [ 8040.100000] [<6019d3a3>] jbd2_log_wait_commit+0xa3/0x110 > > [ 8040.100000] [<6006ae90>] ? autoremove_wake_function+0x0/0x40 > > [ 8040.100000] [<6019f228>] jbd2_complete_transaction+0x48/0x90 > > [ 8040.100000] [<6015162b>] ext4_sync_file+0x28b/0x320 > > [ 8040.100000] [<600dba2a>] ? vfs_read+0x13a/0x190 > > [ 8040.100000] [<6010a133>] do_fsync+0x53/0x80 > > [ 8040.100000] [<600db73d>] ? SyS_lseek+0x7d/0x90 > > [ 8040.100000] [<6010a442>] SyS_fsync+0x12/0x20 > > [ 8040.100000] [<6001fa68>] handle_syscall+0x68/0x90 > > [ 8040.100000] [<600370fd>] userspace+0x4fd/0x600 > > [ 8040.100000] [<60031e0f>] ? save_registers+0x1f/0x40 > > [ 8040.100000] [<6003a2c7>] ? arch_prctl+0x177/0x1b0 > > [ 8040.100000] [<6001bed5>] fork_handler+0x85/0x90 > > [ 8040.100000] > > > > any ideas? some synchronisation error in ext4? > > Hmm, maybe you suffer from the same issue this patch tries to address: > https://lkml.org/lkml/2014/2/14/733 Hi, many thanks for this tip. After applying above patch, the hung tasks don't appear any more! But I get a similar backtraces of hung tasks when suspending the host kernel and resuming after 8 hours or so. But this is probably a different error. > > Thanks, > //richard |
|
From: Richard W. <ri...@no...> - 2014-03-16 15:10:08
|
Am 14.03.2014 15:57, schrieb Thomas Meyer: > Am Mittwoch, den 06.11.2013, 20:59 +0100 schrieb Richard Weinberger: >> Am 06.11.2013 20:52, schrieb Thomas Meyer: >>> Am Mittwoch, den 06.11.2013, 13:40 +0100 schrieb Richard Weinberger: >>>> On Tue, Nov 5, 2013 at 9:21 PM, Thomas Meyer <th...@m3...> wrote: >>>>> Hi, >>>>> >>>>> I'm running Fedora 20 inside a 3.12 UML kernel and the "yum upgrade -y" >>>>> command seems to get stuck after a while/few minutes. >>>>> >>>>> Any ideas what's going one here? How to debug this? >>>>> >>>>> It looks like the process running yum is in state ptrace stopped, but >>>>> doesn't continue. >>>> >>>> Got only yum stuck or the whole UML kernel? >>> > > only some processes get stuck. > > After enabling hung task detection in the kernel I see this in the logs: > > [ 8040.100000] INFO: task jbd2/ubda-8:308 blocked for more than 120 > seconds. > [ 8040.100000] Not tainted 3.13.6 #24 > [ 8040.100000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" > disables this message. > [ 8040.100000] jbd2/ubda-8 D 0000000040aa1c83 0 308 2 > 0x00000000 > [ 8040.100000] Stack: > [ 8040.100000] 600795a0 603f3120 b066db70 6006476d > [ 8040.100000] 1b066dbb0 b0631040 b066db80 6001c0a3 > [ 8040.100000] 600795a0 b066b380 b066dbe0 60314b4e > [ 8040.100000] Call Trace: > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > [ 8040.100000] [<6006476d>] ? dequeue_task+0x1d/0x50 > [ 8040.100000] [<6001c0a3>] __switch_to+0x53/0x90 > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > [ 8040.100000] [<60314b4e>] __schedule+0x1ae/0x470 > [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 > [ 8040.100000] [<6006aa70>] ? prepare_to_wait+0x0/0x90 > [ 8040.100000] [<60314e43>] schedule+0x33/0x80 > [ 8040.100000] [<6020b9d4>] ? submit_bio+0xa4/0x1c0 > [ 8040.100000] [<60315030>] io_schedule+0x60/0x90 > [ 8040.100000] [<6010b7b0>] sleep_on_buffer+0x10/0x20 > [ 8040.100000] [<603153a3>] __wait_on_bit+0x63/0xa0 > [ 8040.100000] [<6010b7a0>] ? sleep_on_buffer+0x0/0x20 > [ 8040.100000] [<6010b7a0>] ? sleep_on_buffer+0x0/0x20 > [ 8040.100000] [<60315466>] out_of_line_wait_on_bit+0x86/0xa0 > [ 8040.100000] [<6010e312>] ? submit_bh+0x12/0x20 > [ 8040.100000] [<6006aed0>] ? wake_bit_function+0x0/0x40 > [ 8040.100000] [<600645e3>] ? __might_sleep+0x153/0x170 > [ 8040.100000] [<60064490>] ? __might_sleep+0x0/0x170 > [ 8040.100000] [<6010b890>] ? __wait_on_buffer+0x0/0x40 > [ 8040.100000] [<6010b8c4>] __wait_on_buffer+0x34/0x40 > [ 8040.100000] [<6019a166>] jbd2_journal_commit_transaction > +0x1696/0x19a0 > [ 8040.100000] [<60315060>] ? _cond_resched+0x0/0x50 > [ 8040.100000] [<6010d200>] ? __brelse+0x0/0x30 > [ 8040.100000] [<600330c0>] ? block_signals+0x0/0x20 > [ 8040.100000] [<6006abff>] ? finish_wait+0x6f/0x90 > [ 8040.100000] [<6006a950>] ? __wake_up+0x0/0x70 > [ 8040.100000] [<600487c0>] ? del_timer+0x0/0x60 > [ 8040.100000] [<6006a950>] ? __wake_up+0x0/0x70 > [ 8040.100000] [<6019dd5f>] kjournald2+0xdf/0x2d0 > [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 > [ 8040.100000] [<6006ae90>] ? autoremove_wake_function+0x0/0x40 > [ 8040.100000] [<6019dc80>] ? kjournald2+0x0/0x2d0 > [ 8040.100000] [<6006a670>] ? __init_waitqueue_head+0x0/0x10 > [ 8040.100000] [<6019dc80>] ? kjournald2+0x0/0x2d0 > [ 8040.100000] [<6006a670>] ? __init_waitqueue_head+0x0/0x10 > [ 8040.100000] [<6005ce44>] kthread+0x114/0x140 > [ 8040.100000] [<6006442d>] ? finish_task_switch.isra.72+0x2d/0x90 > [ 8040.100000] [<600656a2>] ? schedule_tail+0x22/0xd0 > [ 8040.100000] [<6001be21>] new_thread_handler+0x81/0xb0 > [ 8040.100000] > [ 8040.100000] INFO: task yum:1082 blocked for more than 120 seconds. > [ 8040.100000] Not tainted 3.13.6 #24 > [ 8040.100000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" > disables this message. > [ 8040.100000] yum D 0000000040aa1c83 0 1082 1073 > 0x00000000 > [ 8040.100000] Stack: > [ 8040.100000] 600795a0 603f3120 aae3fc80 6006476d > [ 8040.100000] 162b83078 b0631040 aae3fc90 6001c0a3 > [ 8040.100000] 600795a0 aadeab40 aae3fcf0 60314b4e > [ 8040.100000] Call Trace: > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > [ 8040.100000] [<6006476d>] ? dequeue_task+0x1d/0x50 > [ 8040.100000] [<6001c0a3>] __switch_to+0x53/0x90 > [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 > [ 8040.100000] [<60314b4e>] __schedule+0x1ae/0x470 > [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 > [ 8040.100000] [<6003344f>] ? set_signals+0x3f/0x50 > [ 8040.100000] [<6006ace0>] ? prepare_to_wait_event+0x0/0x110 > [ 8040.100000] [<60314e10>] ? schedule+0x0/0x80 > [ 8040.100000] [<60314e43>] schedule+0x33/0x80 > [ 8040.100000] [<6006ace0>] ? prepare_to_wait_event+0x0/0x110 > [ 8040.100000] [<6019d3a3>] jbd2_log_wait_commit+0xa3/0x110 > [ 8040.100000] [<6006ae90>] ? autoremove_wake_function+0x0/0x40 > [ 8040.100000] [<6019f228>] jbd2_complete_transaction+0x48/0x90 > [ 8040.100000] [<6015162b>] ext4_sync_file+0x28b/0x320 > [ 8040.100000] [<600dba2a>] ? vfs_read+0x13a/0x190 > [ 8040.100000] [<6010a133>] do_fsync+0x53/0x80 > [ 8040.100000] [<600db73d>] ? SyS_lseek+0x7d/0x90 > [ 8040.100000] [<6010a442>] SyS_fsync+0x12/0x20 > [ 8040.100000] [<6001fa68>] handle_syscall+0x68/0x90 > [ 8040.100000] [<600370fd>] userspace+0x4fd/0x600 > [ 8040.100000] [<60031e0f>] ? save_registers+0x1f/0x40 > [ 8040.100000] [<6003a2c7>] ? arch_prctl+0x177/0x1b0 > [ 8040.100000] [<6001bed5>] fork_handler+0x85/0x90 > [ 8040.100000] > > any ideas? some synchronisation error in ext4? Hmm, maybe you suffer from the same issue this patch tries to address: https://lkml.org/lkml/2014/2/14/733 Thanks, //richard |
|
From: Thomas M. <th...@m3...> - 2014-03-14 15:29:42
|
Am Mittwoch, den 06.11.2013, 20:59 +0100 schrieb Richard Weinberger: > Am 06.11.2013 20:52, schrieb Thomas Meyer: > > Am Mittwoch, den 06.11.2013, 13:40 +0100 schrieb Richard Weinberger: > >> On Tue, Nov 5, 2013 at 9:21 PM, Thomas Meyer <th...@m3...> wrote: > >>> Hi, > >>> > >>> I'm running Fedora 20 inside a 3.12 UML kernel and the "yum upgrade -y" > >>> command seems to get stuck after a while/few minutes. > >>> > >>> Any ideas what's going one here? How to debug this? > >>> > >>> It looks like the process running yum is in state ptrace stopped, but > >>> doesn't continue. > >> > >> Got only yum stuck or the whole UML kernel? > > only some processes get stuck. After enabling hung task detection in the kernel I see this in the logs: [ 8040.100000] INFO: task jbd2/ubda-8:308 blocked for more than 120 seconds. [ 8040.100000] Not tainted 3.13.6 #24 [ 8040.100000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 8040.100000] jbd2/ubda-8 D 0000000040aa1c83 0 308 2 0x00000000 [ 8040.100000] Stack: [ 8040.100000] 600795a0 603f3120 b066db70 6006476d [ 8040.100000] 1b066dbb0 b0631040 b066db80 6001c0a3 [ 8040.100000] 600795a0 b066b380 b066dbe0 60314b4e [ 8040.100000] Call Trace: [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 [ 8040.100000] [<6006476d>] ? dequeue_task+0x1d/0x50 [ 8040.100000] [<6001c0a3>] __switch_to+0x53/0x90 [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 [ 8040.100000] [<60314b4e>] __schedule+0x1ae/0x470 [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 [ 8040.100000] [<6006aa70>] ? prepare_to_wait+0x0/0x90 [ 8040.100000] [<60314e43>] schedule+0x33/0x80 [ 8040.100000] [<6020b9d4>] ? submit_bio+0xa4/0x1c0 [ 8040.100000] [<60315030>] io_schedule+0x60/0x90 [ 8040.100000] [<6010b7b0>] sleep_on_buffer+0x10/0x20 [ 8040.100000] [<603153a3>] __wait_on_bit+0x63/0xa0 [ 8040.100000] [<6010b7a0>] ? sleep_on_buffer+0x0/0x20 [ 8040.100000] [<6010b7a0>] ? sleep_on_buffer+0x0/0x20 [ 8040.100000] [<60315466>] out_of_line_wait_on_bit+0x86/0xa0 [ 8040.100000] [<6010e312>] ? submit_bh+0x12/0x20 [ 8040.100000] [<6006aed0>] ? wake_bit_function+0x0/0x40 [ 8040.100000] [<600645e3>] ? __might_sleep+0x153/0x170 [ 8040.100000] [<60064490>] ? __might_sleep+0x0/0x170 [ 8040.100000] [<6010b890>] ? __wait_on_buffer+0x0/0x40 [ 8040.100000] [<6010b8c4>] __wait_on_buffer+0x34/0x40 [ 8040.100000] [<6019a166>] jbd2_journal_commit_transaction +0x1696/0x19a0 [ 8040.100000] [<60315060>] ? _cond_resched+0x0/0x50 [ 8040.100000] [<6010d200>] ? __brelse+0x0/0x30 [ 8040.100000] [<600330c0>] ? block_signals+0x0/0x20 [ 8040.100000] [<6006abff>] ? finish_wait+0x6f/0x90 [ 8040.100000] [<6006a950>] ? __wake_up+0x0/0x70 [ 8040.100000] [<600487c0>] ? del_timer+0x0/0x60 [ 8040.100000] [<6006a950>] ? __wake_up+0x0/0x70 [ 8040.100000] [<6019dd5f>] kjournald2+0xdf/0x2d0 [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 [ 8040.100000] [<6006ae90>] ? autoremove_wake_function+0x0/0x40 [ 8040.100000] [<6019dc80>] ? kjournald2+0x0/0x2d0 [ 8040.100000] [<6006a670>] ? __init_waitqueue_head+0x0/0x10 [ 8040.100000] [<6019dc80>] ? kjournald2+0x0/0x2d0 [ 8040.100000] [<6006a670>] ? __init_waitqueue_head+0x0/0x10 [ 8040.100000] [<6005ce44>] kthread+0x114/0x140 [ 8040.100000] [<6006442d>] ? finish_task_switch.isra.72+0x2d/0x90 [ 8040.100000] [<600656a2>] ? schedule_tail+0x22/0xd0 [ 8040.100000] [<6001be21>] new_thread_handler+0x81/0xb0 [ 8040.100000] [ 8040.100000] INFO: task yum:1082 blocked for more than 120 seconds. [ 8040.100000] Not tainted 3.13.6 #24 [ 8040.100000] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 8040.100000] yum D 0000000040aa1c83 0 1082 1073 0x00000000 [ 8040.100000] Stack: [ 8040.100000] 600795a0 603f3120 aae3fc80 6006476d [ 8040.100000] 162b83078 b0631040 aae3fc90 6001c0a3 [ 8040.100000] 600795a0 aadeab40 aae3fcf0 60314b4e [ 8040.100000] Call Trace: [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 [ 8040.100000] [<6006476d>] ? dequeue_task+0x1d/0x50 [ 8040.100000] [<6001c0a3>] __switch_to+0x53/0x90 [ 8040.100000] [<600795a0>] ? rcu_sched_qs+0x0/0xd0 [ 8040.100000] [<60314b4e>] __schedule+0x1ae/0x470 [ 8040.100000] [<60068900>] ? pick_next_task_fair+0x0/0x1a0 [ 8040.100000] [<6003344f>] ? set_signals+0x3f/0x50 [ 8040.100000] [<6006ace0>] ? prepare_to_wait_event+0x0/0x110 [ 8040.100000] [<60314e10>] ? schedule+0x0/0x80 [ 8040.100000] [<60314e43>] schedule+0x33/0x80 [ 8040.100000] [<6006ace0>] ? prepare_to_wait_event+0x0/0x110 [ 8040.100000] [<6019d3a3>] jbd2_log_wait_commit+0xa3/0x110 [ 8040.100000] [<6006ae90>] ? autoremove_wake_function+0x0/0x40 [ 8040.100000] [<6019f228>] jbd2_complete_transaction+0x48/0x90 [ 8040.100000] [<6015162b>] ext4_sync_file+0x28b/0x320 [ 8040.100000] [<600dba2a>] ? vfs_read+0x13a/0x190 [ 8040.100000] [<6010a133>] do_fsync+0x53/0x80 [ 8040.100000] [<600db73d>] ? SyS_lseek+0x7d/0x90 [ 8040.100000] [<6010a442>] SyS_fsync+0x12/0x20 [ 8040.100000] [<6001fa68>] handle_syscall+0x68/0x90 [ 8040.100000] [<600370fd>] userspace+0x4fd/0x600 [ 8040.100000] [<60031e0f>] ? save_registers+0x1f/0x40 [ 8040.100000] [<6003a2c7>] ? arch_prctl+0x177/0x1b0 [ 8040.100000] [<6001bed5>] fork_handler+0x85/0x90 [ 8040.100000] any ideas? some synchronisation error in ext4? > > Thanks, > //richard |
|
From: Michael E. <mp...@el...> - 2014-02-26 12:31:49
|
On Tue, 2014-02-25 at 18:16 +0900, AKASHI Takahiro wrote: > Currently AUDITSYSCALL has a long list of architecture depencency: > depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || > SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA) > The purpose of this patch is to replace it with HAVE_ARCH_AUDITSYSCALL > for simplicity. > > Signed-off-by: AKASHI Takahiro <tak...@li...> > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 957bf34..7b3b8fe 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -141,6 +141,7 @@ config PPC > select HAVE_DEBUG_STACKOVERFLOW > select HAVE_IRQ_EXIT_ON_IRQ_STACK > select ARCH_USE_CMPXCHG_LOCKREF if PPC64 > + select HAVE_ARCH_AUDITSYSCALL > > config GENERIC_CSUM > def_bool CPU_LITTLE_ENDIAN Looks good for powerpc. Acked-by: Michael Ellerman <mp...@el...> cheers |
|
From: Matt T. <mat...@gm...> - 2014-02-25 17:40:42
|
On Tue, Feb 25, 2014 at 1:16 AM, AKASHI Takahiro <tak...@li...> wrote: > Currently AUDITSYSCALL has a long list of architecture depencency: > depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || > SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA) > The purpose of this patch is to replace it with HAVE_ARCH_AUDITSYSCALL > for simplicity. > > Signed-off-by: AKASHI Takahiro <tak...@li...> > --- > arch/alpha/Kconfig | 1 + > arch/arm/Kconfig | 1 + > arch/ia64/Kconfig | 1 + > arch/parisc/Kconfig | 1 + > arch/powerpc/Kconfig | 1 + > arch/s390/Kconfig | 1 + > arch/sh/Kconfig | 1 + > arch/sparc/Kconfig | 1 + > arch/um/Kconfig.common | 1 + > arch/x86/Kconfig | 1 + > init/Kconfig | 5 ++++- > 11 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig > index f6c6b34..b7ff9a3 100644 > --- a/arch/alpha/Kconfig > +++ b/arch/alpha/Kconfig > @@ -22,6 +22,7 @@ config ALPHA > select GENERIC_SMP_IDLE_THREAD > select GENERIC_STRNCPY_FROM_USER > select GENERIC_STRNLEN_USER > + select HAVE_ARCH_AUDITSYSCALL > select HAVE_MOD_ARCH_SPECIFIC > select MODULES_USE_ELF_RELA > select ODD_RT_SIGACTION Thanks. Acked-by: Matt Turner <mat...@gm...> |
|
From: Richard G. B. <rg...@re...> - 2014-02-25 15:26:24
|
On 14/02/25, AKASHI Takahiro wrote: > Currently AUDITSYSCALL has a long list of architecture depencency: > depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || > SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA) > The purpose of this patch is to replace it with HAVE_ARCH_AUDITSYSCALL > for simplicity. > > Signed-off-by: AKASHI Takahiro <tak...@li...> Acked-by: Richard Guy Briggs <rg...@re...> > --- > arch/alpha/Kconfig | 1 + > arch/arm/Kconfig | 1 + > arch/ia64/Kconfig | 1 + > arch/parisc/Kconfig | 1 + > arch/powerpc/Kconfig | 1 + > arch/s390/Kconfig | 1 + > arch/sh/Kconfig | 1 + > arch/sparc/Kconfig | 1 + > arch/um/Kconfig.common | 1 + > arch/x86/Kconfig | 1 + > init/Kconfig | 5 ++++- > 11 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig > index f6c6b34..b7ff9a3 100644 > --- a/arch/alpha/Kconfig > +++ b/arch/alpha/Kconfig > @@ -22,6 +22,7 @@ config ALPHA > select GENERIC_SMP_IDLE_THREAD > select GENERIC_STRNCPY_FROM_USER > select GENERIC_STRNLEN_USER > + select HAVE_ARCH_AUDITSYSCALL > select HAVE_MOD_ARCH_SPECIFIC > select MODULES_USE_ELF_RELA > select ODD_RT_SIGACTION > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index e254198..ca79340 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -24,6 +24,7 @@ config ARM > select GENERIC_STRNCPY_FROM_USER > select GENERIC_STRNLEN_USER > select HARDIRQS_SW_RESEND > + select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT) > select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL > select HAVE_ARCH_KGDB > select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) > diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig > index 0c8e553..5409bf4 100644 > --- a/arch/ia64/Kconfig > +++ b/arch/ia64/Kconfig > @@ -44,6 +44,7 @@ config IA64 > select HAVE_MOD_ARCH_SPECIFIC > select MODULES_USE_ELF_RELA > select ARCH_USE_CMPXCHG_LOCKREF > + select HAVE_ARCH_AUDITSYSCALL > default y > help > The Itanium Processor Family is Intel's 64-bit successor to > diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig > index bb2a8ec..1faefed 100644 > --- a/arch/parisc/Kconfig > +++ b/arch/parisc/Kconfig > @@ -28,6 +28,7 @@ config PARISC > select CLONE_BACKWARDS > select TTY # Needed for pdc_cons.c > select HAVE_DEBUG_STACKOVERFLOW > + select HAVE_ARCH_AUDITSYSCALL > > help > The PA-RISC microprocessor is designed by Hewlett-Packard and used > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 957bf34..7b3b8fe 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -141,6 +141,7 @@ config PPC > select HAVE_DEBUG_STACKOVERFLOW > select HAVE_IRQ_EXIT_ON_IRQ_STACK > select ARCH_USE_CMPXCHG_LOCKREF if PPC64 > + select HAVE_ARCH_AUDITSYSCALL > > config GENERIC_CSUM > def_bool CPU_LITTLE_ENDIAN > diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig > index 65a0775..1b58568 100644 > --- a/arch/s390/Kconfig > +++ b/arch/s390/Kconfig > @@ -103,6 +103,7 @@ config S390 > select GENERIC_SMP_IDLE_THREAD > select GENERIC_TIME_VSYSCALL > select HAVE_ALIGNED_STRUCT_PAGE if SLUB > + select HAVE_ARCH_AUDITSYSCALL > select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 > select HAVE_ARCH_SECCOMP_FILTER > select HAVE_ARCH_TRACEHOOK > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig > index 6357710..4addd87 100644 > --- a/arch/sh/Kconfig > +++ b/arch/sh/Kconfig > @@ -42,6 +42,7 @@ config SUPERH > select MODULES_USE_ELF_RELA > select OLD_SIGSUSPEND > select OLD_SIGACTION > + select HAVE_ARCH_AUDITSYSCALL > help > The SuperH is a RISC processor targeted for use in embedded systems > and consumer electronics; it was also used in the Sega Dreamcast > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > index c51efdc..9c74d6b 100644 > --- a/arch/sparc/Kconfig > +++ b/arch/sparc/Kconfig > @@ -77,6 +77,7 @@ config SPARC64 > select ARCH_HAVE_NMI_SAFE_CMPXCHG > select HAVE_C_RECORDMCOUNT > select NO_BOOTMEM > + select HAVE_ARCH_AUDITSYSCALL > > config ARCH_DEFCONFIG > string > diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common > index 21ca44c..6915d28 100644 > --- a/arch/um/Kconfig.common > +++ b/arch/um/Kconfig.common > @@ -1,6 +1,7 @@ > config UML > bool > default y > + select HAVE_ARCH_AUDITSYSCALL > select HAVE_UID16 > select GENERIC_IRQ_SHOW > select GENERIC_CPU_DEVICES > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 0af5250..2938365 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -127,6 +127,7 @@ config X86 > select HAVE_DEBUG_STACKOVERFLOW > select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64 > select HAVE_CC_STACKPROTECTOR > + select HAVE_ARCH_AUDITSYSCALL > > config INSTRUCTION_DECODER > def_bool y > diff --git a/init/Kconfig b/init/Kconfig > index 009a797..d4ec53d 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -282,9 +282,12 @@ config AUDIT > logging of avc messages output). Does not do system-call > auditing without CONFIG_AUDITSYSCALL. > > +config HAVE_ARCH_AUDITSYSCALL > + bool > + > config AUDITSYSCALL > bool "Enable system-call auditing support" > - depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA) > + depends on AUDIT && HAVE_ARCH_AUDITSYSCALL > default y if SECURITY_SELINUX > help > Enable low-overhead system-call auditing infrastructure that > -- > 1.7.9.5 > - RGB -- Richard Guy Briggs <rb...@re...> Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545 |
|
From: Will D. <wil...@ar...> - 2014-02-25 14:54:33
|
On Tue, Feb 25, 2014 at 09:16:24AM +0000, AKASHI Takahiro wrote: > Currently AUDITSYSCALL has a long list of architecture depencency: > depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || > SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA) > The purpose of this patch is to replace it with HAVE_ARCH_AUDITSYSCALL > for simplicity. Looks sensible to me: Acked-by: Will Deacon <wil...@ar...> Will |
|
From: AKASHI T. <tak...@li...> - 2014-02-25 09:17:43
|
Currently AUDITSYSCALL has a long list of architecture depencency:
depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML ||
SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA)
The purpose of this patch is to replace it with HAVE_ARCH_AUDITSYSCALL
for simplicity.
Signed-off-by: AKASHI Takahiro <tak...@li...>
---
arch/alpha/Kconfig | 1 +
arch/arm/Kconfig | 1 +
arch/ia64/Kconfig | 1 +
arch/parisc/Kconfig | 1 +
arch/powerpc/Kconfig | 1 +
arch/s390/Kconfig | 1 +
arch/sh/Kconfig | 1 +
arch/sparc/Kconfig | 1 +
arch/um/Kconfig.common | 1 +
arch/x86/Kconfig | 1 +
init/Kconfig | 5 ++++-
11 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index f6c6b34..b7ff9a3 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -22,6 +22,7 @@ config ALPHA
select GENERIC_SMP_IDLE_THREAD
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
+ select HAVE_ARCH_AUDITSYSCALL
select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA
select ODD_RT_SIGACTION
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e254198..ca79340 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -24,6 +24,7 @@ config ARM
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select HARDIRQS_SW_RESEND
+ select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
select HAVE_ARCH_KGDB
select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 0c8e553..5409bf4 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -44,6 +44,7 @@ config IA64
select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA
select ARCH_USE_CMPXCHG_LOCKREF
+ select HAVE_ARCH_AUDITSYSCALL
default y
help
The Itanium Processor Family is Intel's 64-bit successor to
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index bb2a8ec..1faefed 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -28,6 +28,7 @@ config PARISC
select CLONE_BACKWARDS
select TTY # Needed for pdc_cons.c
select HAVE_DEBUG_STACKOVERFLOW
+ select HAVE_ARCH_AUDITSYSCALL
help
The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf34..7b3b8fe 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -141,6 +141,7 @@ config PPC
select HAVE_DEBUG_STACKOVERFLOW
select HAVE_IRQ_EXIT_ON_IRQ_STACK
select ARCH_USE_CMPXCHG_LOCKREF if PPC64
+ select HAVE_ARCH_AUDITSYSCALL
config GENERIC_CSUM
def_bool CPU_LITTLE_ENDIAN
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 65a0775..1b58568 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -103,6 +103,7 @@ config S390
select GENERIC_SMP_IDLE_THREAD
select GENERIC_TIME_VSYSCALL
select HAVE_ALIGNED_STRUCT_PAGE if SLUB
+ select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
select HAVE_ARCH_SECCOMP_FILTER
select HAVE_ARCH_TRACEHOOK
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 6357710..4addd87 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -42,6 +42,7 @@ config SUPERH
select MODULES_USE_ELF_RELA
select OLD_SIGSUSPEND
select OLD_SIGACTION
+ select HAVE_ARCH_AUDITSYSCALL
help
The SuperH is a RISC processor targeted for use in embedded systems
and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c51efdc..9c74d6b 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -77,6 +77,7 @@ config SPARC64
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select HAVE_C_RECORDMCOUNT
select NO_BOOTMEM
+ select HAVE_ARCH_AUDITSYSCALL
config ARCH_DEFCONFIG
string
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index 21ca44c..6915d28 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -1,6 +1,7 @@
config UML
bool
default y
+ select HAVE_ARCH_AUDITSYSCALL
select HAVE_UID16
select GENERIC_IRQ_SHOW
select GENERIC_CPU_DEVICES
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0af5250..2938365 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -127,6 +127,7 @@ config X86
select HAVE_DEBUG_STACKOVERFLOW
select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
select HAVE_CC_STACKPROTECTOR
+ select HAVE_ARCH_AUDITSYSCALL
config INSTRUCTION_DECODER
def_bool y
diff --git a/init/Kconfig b/init/Kconfig
index 009a797..d4ec53d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -282,9 +282,12 @@ config AUDIT
logging of avc messages output). Does not do system-call
auditing without CONFIG_AUDITSYSCALL.
+config HAVE_ARCH_AUDITSYSCALL
+ bool
+
config AUDITSYSCALL
bool "Enable system-call auditing support"
- depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA)
+ depends on AUDIT && HAVE_ARCH_AUDITSYSCALL
default y if SECURITY_SELINUX
help
Enable low-overhead system-call auditing infrastructure that
--
1.7.9.5
|
|
From: AKASHI T. <tak...@li...> - 2014-02-25 09:17:29
|
Currently AUDITSYSCALL has a long list of architecture depencency:
depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML ||
SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT) || ALPHA)
The purpose of this patch is to replace it with HAVE_ARCH_AUDITSYSCALL
for simplicity.
Changes v1 -> v2:
* rebased to 3.14-rcX, and so added a change on ALPHA
AKASHI Takahiro (1):
audit: Add CONFIG_HAVE_ARCH_AUDITSYSCALL
arch/alpha/Kconfig | 1 +
arch/arm/Kconfig | 1 +
arch/ia64/Kconfig | 1 +
arch/parisc/Kconfig | 1 +
arch/powerpc/Kconfig | 1 +
arch/s390/Kconfig | 1 +
arch/sh/Kconfig | 1 +
arch/sparc/Kconfig | 1 +
arch/um/Kconfig.common | 1 +
arch/x86/Kconfig | 1 +
init/Kconfig | 5 ++++-
11 files changed, 14 insertions(+), 1 deletion(-)
--
1.7.9.5
|
|
From: Yijing W. <wan...@hu...> - 2014-02-10 01:19:08
|
On 2014/2/6 4:40, Thomas Gleixner wrote:
> Yijing,
>
> On Thu, 23 Jan 2014, David Laight wrote:
>
>> From: Linuxppc-dev Tony Prisk
>>> On 23/01/14 20:12, Yijing Wang wrote:
>>>> Currently, clocksource_register() and __clocksource_register_scale()
>>>> functions always return 0, it's pointless, make functions void.
>>>> And remove the dead code that check the clocksource_register_hz()
>>>> return value.
>>> ......
>>>> -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
>>>> +static inline void clocksource_register_hz(struct clocksource *cs, u32 hz)
>>>> {
>>>> return __clocksource_register_scale(cs, 1, hz);
>>>> }
>>>
>>> This doesn't make sense - you are still returning a value on a function
>>> declared void, and the return is now from a function that doesn't return
>>> anything either ?!?!
>>> Doesn't this throw a compile-time warning??
>>
>> It depends on the compiler.
>> Recent gcc allow it.
>> I don't know if it is actually valid C though.
>>
>> There is no excuse for it on lines like the above though.
>
> Can you please resend with that fixed against 3.14-rc1 ?
OK, I will resend later.
Thanks!
Yijing.
>
> .
>
--
Thanks!
Yijing
|
|
From: Thomas G. <tg...@li...> - 2014-02-05 21:00:16
|
Yijing,
On Thu, 23 Jan 2014, David Laight wrote:
> From: Linuxppc-dev Tony Prisk
> > On 23/01/14 20:12, Yijing Wang wrote:
> > > Currently, clocksource_register() and __clocksource_register_scale()
> > > functions always return 0, it's pointless, make functions void.
> > > And remove the dead code that check the clocksource_register_hz()
> > > return value.
> > ......
> > > -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
> > > +static inline void clocksource_register_hz(struct clocksource *cs, u32 hz)
> > > {
> > > return __clocksource_register_scale(cs, 1, hz);
> > > }
> >
> > This doesn't make sense - you are still returning a value on a function
> > declared void, and the return is now from a function that doesn't return
> > anything either ?!?!
> > Doesn't this throw a compile-time warning??
>
> It depends on the compiler.
> Recent gcc allow it.
> I don't know if it is actually valid C though.
>
> There is no excuse for it on lines like the above though.
Can you please resend with that fixed against 3.14-rc1 ?
Thanks,
tglx
|
|
From: Thomas G. <tg...@li...> - 2014-02-05 20:59:24
|
On Thu, 23 Jan 2014, Daniel Lezcano wrote: > On 01/23/2014 08:12 AM, Yijing Wang wrote: > > Currently, clocksource_register() and __clocksource_register_scale() > > functions always return 0, it's pointless, make functions void. > > And remove the dead code that check the clocksource_register_hz() > > return value. > > > > Signed-off-by: Yijing Wang <wan...@hu...> > > Well, do we really want to change all these files to not take care of a return > value ? What about is we have to check it again later ? > > I would recommend to investigate __clocksource_register_scale and the > underneath functions if there is not an error to be returned in the call stack > somewhere which is ignored today. > > The same applies for clocksource_register. There is really no point in making it fail. It's so low level that anything more than a proper printk/BUG/WARN is overkill. Thanks, tglx |
|
From: David L. <Dav...@AC...> - 2014-01-23 12:07:29
|
From: Linuxppc-dev Tony Prisk
> On 23/01/14 20:12, Yijing Wang wrote:
> > Currently, clocksource_register() and __clocksource_register_scale()
> > functions always return 0, it's pointless, make functions void.
> > And remove the dead code that check the clocksource_register_hz()
> > return value.
> ......
> > -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
> > +static inline void clocksource_register_hz(struct clocksource *cs, u32 hz)
> > {
> > return __clocksource_register_scale(cs, 1, hz);
> > }
>
> This doesn't make sense - you are still returning a value on a function
> declared void, and the return is now from a function that doesn't return
> anything either ?!?!
> Doesn't this throw a compile-time warning??
It depends on the compiler.
Recent gcc allow it.
I don't know if it is actually valid C though.
There is no excuse for it on lines like the above though.
David
|
|
From: Yijing W. <wan...@hu...> - 2014-01-23 09:12:19
|
On 2014/1/23 16:40, Daniel Lezcano wrote:
> On 01/23/2014 08:12 AM, Yijing Wang wrote:
>> Currently, clocksource_register() and __clocksource_register_scale()
>> functions always return 0, it's pointless, make functions void.
>> And remove the dead code that check the clocksource_register_hz()
>> return value.
>>
>> Signed-off-by: Yijing Wang <wan...@hu...>
>
> Well, do we really want to change all these files to not take care of a return value ? What about is we have to check it again later ?
>
> I would recommend to investigate __clocksource_register_scale and the underneath functions if there is not an error to be returned in the call stack somewhere which is ignored today.
>
> The same applies for clocksource_register.
Hi Daniel, thanks for your comment, all functions type under __clocksource_register_scale() are void.
This just is trivial cleanup patch, I don't know whether we will check these function return value again later.
If there is some possibility to check it again, I agree to keep them. Of course, this is all determined by Thomas.
Thanks!
Yijing.
>
>> ---
>> arch/arm/mach-davinci/time.c | 5 ++---
>> arch/arm/mach-msm/timer.c | 4 +---
>> arch/arm/mach-omap2/timer.c | 8 +++-----
>> arch/avr32/kernel/time.c | 4 +---
>> arch/blackfin/kernel/time-ts.c | 6 ++----
>> arch/microblaze/kernel/timer.c | 3 +--
>> arch/mips/jz4740/time.c | 6 +-----
>> arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | 3 ++-
>> arch/openrisc/kernel/time.c | 3 +--
>> arch/powerpc/kernel/time.c | 6 +-----
>> arch/um/kernel/time.c | 6 +-----
>> arch/x86/platform/uv/uv_time.c | 14 ++++++--------
>> drivers/clocksource/acpi_pm.c | 3 ++-
>> drivers/clocksource/cadence_ttc_timer.c | 6 +-----
>> drivers/clocksource/exynos_mct.c | 4 +---
>> drivers/clocksource/i8253.c | 3 ++-
>> drivers/clocksource/mmio.c | 3 ++-
>> drivers/clocksource/samsung_pwm_timer.c | 5 +----
>> drivers/clocksource/scx200_hrt.c | 3 ++-
>> drivers/clocksource/tcb_clksrc.c | 8 +-------
>> drivers/clocksource/timer-marco.c | 2 +-
>> drivers/clocksource/timer-prima2.c | 2 +-
>> drivers/clocksource/vt8500_timer.c | 4 +---
>> include/linux/clocksource.h | 8 ++++----
>> kernel/time/clocksource.c | 6 ++----
>> kernel/time/jiffies.c | 3 ++-
>> 26 files changed, 45 insertions(+), 83 deletions(-)
>>
>> diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
>> index 56c6eb5..9536f85 100644
>> --- a/arch/arm/mach-davinci/time.c
>> +++ b/arch/arm/mach-davinci/time.c
>> @@ -387,9 +387,8 @@ void __init davinci_timer_init(void)
>>
>> /* setup clocksource */
>> clocksource_davinci.name = id_to_name[clocksource_id];
>> - if (clocksource_register_hz(&clocksource_davinci,
>> - davinci_clock_tick_rate))
>> - printk(err, clocksource_davinci.name);
>> + clocksource_register_hz(&clocksource_davinci,
>> + davinci_clock_tick_rate);
>>
>> setup_sched_clock(davinci_read_sched_clock, 32,
>> davinci_clock_tick_rate);
>> diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
>> index 1e9c338..c96e034 100644
>> --- a/arch/arm/mach-msm/timer.c
>> +++ b/arch/arm/mach-msm/timer.c
>> @@ -226,9 +226,7 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
>>
>> err:
>> writel_relaxed(TIMER_ENABLE_EN, source_base + TIMER_ENABLE);
>> - res = clocksource_register_hz(cs, dgt_hz);
>> - if (res)
>> - pr_err("clocksource_register failed\n");
>> + clocksource_register_hz(cs, dgt_hz);
>> setup_sched_clock(msm_sched_clock_read, sched_bits, dgt_hz);
>> }
>>
>> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
>> index 3ca81e0..beaf7c7 100644
>> --- a/arch/arm/mach-omap2/timer.c
>> +++ b/arch/arm/mach-omap2/timer.c
>> @@ -473,11 +473,9 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
>> OMAP_TIMER_NONPOSTED);
>> setup_sched_clock(dmtimer_read_sched_clock, 32, clksrc.rate);
>>
>> - if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
>> - pr_err("Could not register clocksource %s\n",
>> - clocksource_gpt.name);
>> - else
>> - pr_info("OMAP clocksource: %s at %lu Hz\n",
>> + clocksource_register_hz(&clocksource_gpt, clksrc.rate);
>> +
>> + pr_info("OMAP clocksource: %s at %lu Hz\n",
>> clocksource_gpt.name, clksrc.rate);
>> }
>>
>> diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
>> index d0f771b..51b4a66 100644
>> --- a/arch/avr32/kernel/time.c
>> +++ b/arch/avr32/kernel/time.c
>> @@ -134,9 +134,7 @@ void __init time_init(void)
>>
>> /* figure rate for counter */
>> counter_hz = clk_get_rate(boot_cpu_data.clk);
>> - ret = clocksource_register_hz(&counter, counter_hz);
>> - if (ret)
>> - pr_debug("timer: could not register clocksource: %d\n", ret);
>> + clocksource_register_hz(&counter, counter_hz);
>>
>> /* setup COMPARE clockevent */
>> comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift);
>> diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
>> index cb0a484..df3bb08 100644
>> --- a/arch/blackfin/kernel/time-ts.c
>> +++ b/arch/blackfin/kernel/time-ts.c
>> @@ -51,8 +51,7 @@ static inline unsigned long long bfin_cs_cycles_sched_clock(void)
>>
>> static int __init bfin_cs_cycles_init(void)
>> {
>> - if (clocksource_register_hz(&bfin_cs_cycles, get_cclk()))
>> - panic("failed to register clocksource");
>> + clocksource_register_hz(&bfin_cs_cycles, get_cclk());
>>
>> return 0;
>> }
>> @@ -103,8 +102,7 @@ static int __init bfin_cs_gptimer0_init(void)
>> {
>> setup_gptimer0();
>>
>> - if (clocksource_register_hz(&bfin_cs_gptimer0, get_sclk()))
>> - panic("failed to register clocksource");
>> + clocksource_register_hz(&bfin_cs_gptimer0, get_sclk());
>>
>> return 0;
>> }
>> diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
>> index 3e39b10..6a2417e 100644
>> --- a/arch/microblaze/kernel/timer.c
>> +++ b/arch/microblaze/kernel/timer.c
>> @@ -208,8 +208,7 @@ static struct clocksource clocksource_microblaze = {
>>
>> static int __init xilinx_clocksource_init(void)
>> {
>> - if (clocksource_register_hz(&clocksource_microblaze, timer_clock_freq))
>> - panic("failed to register clocksource");
>> + clocksource_register_hz(&clocksource_microblaze, timer_clock_freq);
>>
>> /* stop timer1 */
>> out_be32(timer_baseaddr + TCSR1,
>> diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c
>> index 5e430ce..041cdff 100644
>> --- a/arch/mips/jz4740/time.c
>> +++ b/arch/mips/jz4740/time.c
>> @@ -105,7 +105,6 @@ static struct irqaction timer_irqaction = {
>>
>> void __init plat_time_init(void)
>> {
>> - int ret;
>> uint32_t clk_rate;
>> uint16_t ctrl;
>>
>> @@ -121,10 +120,7 @@ void __init plat_time_init(void)
>>
>> clockevents_register_device(&jz4740_clockevent);
>>
>> - ret = clocksource_register_hz(&jz4740_clocksource, clk_rate);
>> -
>> - if (ret)
>> - printk(KERN_ERR "Failed to register clocksource: %d\n", ret);
>> + clocksource_register_hz(&jz4740_clocksource, clk_rate);
>>
>> setup_irq(JZ4740_IRQ_TCU0, &timer_irqaction);
>>
>> diff --git a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
>> index c639b9d..9fa6d99 100644
>> --- a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
>> +++ b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
>> @@ -208,7 +208,8 @@ int __init init_mfgpt_clocksource(void)
>> if (num_possible_cpus() > 1) /* MFGPT does not scale! */
>> return 0;
>>
>> - return clocksource_register_hz(&clocksource_mfgpt, MFGPT_TICK_RATE);
>> + clocksource_register_hz(&clocksource_mfgpt, MFGPT_TICK_RATE);
>> + return 0;
>> }
>>
>> arch_initcall(init_mfgpt_clocksource);
>> diff --git a/arch/openrisc/kernel/time.c b/arch/openrisc/kernel/time.c
>> index 7c52e94..3f789aa 100644
>> --- a/arch/openrisc/kernel/time.c
>> +++ b/arch/openrisc/kernel/time.c
>> @@ -156,8 +156,7 @@ static struct clocksource openrisc_timer = {
>>
>> static int __init openrisc_timer_init(void)
>> {
>> - if (clocksource_register_hz(&openrisc_timer, cpuinfo.clock_frequency))
>> - panic("failed to register clocksource");
>> + clocksource_register_hz(&openrisc_timer, cpuinfo.clock_frequency);
>>
>> /* Enable the incrementer: 'continuous' mode with interrupt disabled */
>> mtspr(SPR_TTMR, SPR_TTMR_CR);
>> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
>> index b3b1441..27c0627 100644
>> --- a/arch/powerpc/kernel/time.c
>> +++ b/arch/powerpc/kernel/time.c
>> @@ -788,11 +788,7 @@ static void __init clocksource_init(void)
>> else
>> clock = &clocksource_timebase;
>>
>> - if (clocksource_register_hz(clock, tb_ticks_per_sec)) {
>> - printk(KERN_ERR "clocksource: %s is already registered\n",
>> - clock->name);
>> - return;
>> - }
>> + clocksource_register_hz(clock, tb_ticks_per_sec);
>>
>> printk(KERN_INFO "clocksource: %s mult[%x] shift[%d] registered\n",
>> clock->name, clock->mult, clock->shift);
>> diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
>> index 117568d..2034b58 100644
>> --- a/arch/um/kernel/time.c
>> +++ b/arch/um/kernel/time.c
>> @@ -92,11 +92,7 @@ static void __init setup_itimer(void)
>> clockevent_delta2ns(60 * HZ, &itimer_clockevent);
>> itimer_clockevent.min_delta_ns =
>> clockevent_delta2ns(1, &itimer_clockevent);
>> - err = clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
>> - if (err) {
>> - printk(KERN_ERR "clocksource_register_hz returned %d\n", err);
>> - return;
>> - }
>> + clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
>> clockevents_register_device(&itimer_clockevent);
>> }
>>
>> diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c
>> index 5c86786..b963774 100644
>> --- a/arch/x86/platform/uv/uv_time.c
>> +++ b/arch/x86/platform/uv/uv_time.c
>> @@ -379,15 +379,13 @@ static __init int uv_rtc_setup_clock(void)
>> if (!is_uv_system())
>> return -ENODEV;
>>
>> - rc = clocksource_register_hz(&clocksource_uv, sn_rtc_cycles_per_second);
>> - if (rc)
>> - printk(KERN_INFO "UV RTC clocksource failed rc %d\n", rc);
>> - else
>> - printk(KERN_INFO "UV RTC clocksource registered freq %lu MHz\n",
>> - sn_rtc_cycles_per_second/(unsigned long)1E6);
>> + clocksource_register_hz(&clocksource_uv, sn_rtc_cycles_per_second);
>> +
>> + pr_info("UV RTC clocksource registered freq %lu MHz\n",
>> + sn_rtc_cycles_per_second/(unsigned long)1E6);
>>
>> - if (rc || !uv_rtc_evt_enable || x86_platform_ipi_callback)
>> - return rc;
>> + if (!uv_rtc_evt_enable || x86_platform_ipi_callback)
>> + return 0;
>>
>> /* Setup and register clockevents */
>> rc = uv_rtc_allocate_timers();
>> diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
>> index 6eab889..ab1dc63 100644
>> --- a/drivers/clocksource/acpi_pm.c
>> +++ b/drivers/clocksource/acpi_pm.c
>> @@ -218,8 +218,9 @@ static int __init init_acpi_pm_clocksource(void)
>> return -ENODEV;
>> }
>>
>> - return clocksource_register_hz(&clocksource_acpi_pm,
>> + clocksource_register_hz(&clocksource_acpi_pm,
>> PMTMR_TICKS_PER_SEC);
>> + return 0;
>> }
>>
>> /* We use fs_initcall because we want the PCI fixups to have run
>> diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c
>> index 63f176d..b9b56ed 100644
>> --- a/drivers/clocksource/cadence_ttc_timer.c
>> +++ b/drivers/clocksource/cadence_ttc_timer.c
>> @@ -301,11 +301,7 @@ static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base)
>> __raw_writel(CNT_CNTRL_RESET,
>> ttccs->ttc.base_addr + TTC_CNT_CNTRL_OFFSET);
>>
>> - err = clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE);
>> - if (WARN_ON(err)) {
>> - kfree(ttccs);
>> - return;
>> - }
>> + clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE);
>>
>> ttc_sched_clock_val_reg = base + TTC_COUNT_VAL_OFFSET;
>> sched_clock_register(ttc_sched_clock_read, 16, ttccs->ttc.freq / PRESCALE);
>> diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
>> index 62b0de6..98649c7 100644
>> --- a/drivers/clocksource/exynos_mct.c
>> +++ b/drivers/clocksource/exynos_mct.c
>> @@ -193,9 +193,7 @@ struct clocksource mct_frc = {
>> static void __init exynos4_clocksource_init(void)
>> {
>> exynos4_mct_frc_start(0, 0);
>> -
>> - if (clocksource_register_hz(&mct_frc, clk_rate))
>> - panic("%s: can't register clocksource\n", mct_frc.name);
>> + clocksource_register_hz(&mct_frc, clk_rate);
>> }
>>
>> static void exynos4_mct_comp0_stop(void)
>> diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
>> index 14ee3ef..9c45f0a 100644
>> --- a/drivers/clocksource/i8253.c
>> +++ b/drivers/clocksource/i8253.c
>> @@ -95,7 +95,8 @@ static struct clocksource i8253_cs = {
>>
>> int __init clocksource_i8253_init(void)
>> {
>> - return clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
>> + clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
>> + return 0;
>> }
>> #endif
>>
>> diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c
>> index c0e2512..6e0b530 100644
>> --- a/drivers/clocksource/mmio.c
>> +++ b/drivers/clocksource/mmio.c
>> @@ -69,5 +69,6 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name,
>> cs->clksrc.mask = CLOCKSOURCE_MASK(bits);
>> cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
>>
>> - return clocksource_register_hz(&cs->clksrc, hz);
>> + clocksource_register_hz(&cs->clksrc, hz);
>> + return 0;
>> }
>> diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
>> index 5645cfc..c59292f 100644
>> --- a/drivers/clocksource/samsung_pwm_timer.c
>> +++ b/drivers/clocksource/samsung_pwm_timer.c
>> @@ -340,7 +340,6 @@ static void __init samsung_clocksource_init(void)
>> {
>> unsigned long pclk;
>> unsigned long clock_rate;
>> - int ret;
>>
>> pclk = clk_get_rate(pwm.timerclk);
>>
>> @@ -361,9 +360,7 @@ static void __init samsung_clocksource_init(void)
>> pwm.variant.bits, clock_rate);
>>
>> samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
>> - ret = clocksource_register_hz(&samsung_clocksource, clock_rate);
>> - if (ret)
>> - panic("samsung_clocksource_timer: can't register clocksource\n");
>> + clocksource_register_hz(&samsung_clocksource, clock_rate);
>> }
>>
>> static void __init samsung_timer_resources(void)
>> diff --git a/drivers/clocksource/scx200_hrt.c b/drivers/clocksource/scx200_hrt.c
>> index 64f9e82..57bdc04 100644
>> --- a/drivers/clocksource/scx200_hrt.c
>> +++ b/drivers/clocksource/scx200_hrt.c
>> @@ -83,7 +83,8 @@ static int __init init_hrt_clocksource(void)
>>
>> pr_info("enabling scx200 high-res timer (%s MHz +%d ppm)\n", mhz27 ? "27":"1", ppm);
>>
>> - return clocksource_register_hz(&cs_hrt, freq);
>> + clocksource_register_hz(&cs_hrt, freq);
>> + return 0;
>> }
>>
>> module_init(init_hrt_clocksource);
>> diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
>> index 00fdd11..805245d 100644
>> --- a/drivers/clocksource/tcb_clksrc.c
>> +++ b/drivers/clocksource/tcb_clksrc.c
>> @@ -340,9 +340,7 @@ static int __init tcb_clksrc_init(void)
>> }
>>
>> /* and away we go! */
>> - ret = clocksource_register_hz(&clksrc, divided_rate);
>> - if (ret)
>> - goto err_disable_t1;
>> + clocksource_register_hz(&clksrc, divided_rate);
>>
>> /* channel 2: periodic and oneshot timer support */
>> ret = setup_clkevents(tc, clk32k_divisor_idx);
>> @@ -354,10 +352,6 @@ static int __init tcb_clksrc_init(void)
>> err_unregister_clksrc:
>> clocksource_unregister(&clksrc);
>>
>> -err_disable_t1:
>> - if (!tc->tcb_config || tc->tcb_config->counter_width != 32)
>> - clk_disable_unprepare(tc->clk[1]);
>> -
>> err_disable_t0:
>> clk_disable_unprepare(t0_clk);
>>
>> diff --git a/drivers/clocksource/timer-marco.c b/drivers/clocksource/timer-marco.c
>> index 09a17d9..ae78ce0 100644
>> --- a/drivers/clocksource/timer-marco.c
>> +++ b/drivers/clocksource/timer-marco.c
>> @@ -283,7 +283,7 @@ static void __init sirfsoc_marco_timer_init(void)
>> /* Clear all interrupts */
>> writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
>>
>> - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
>> + clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE);
>>
>> sirfsoc_clockevent_init();
>> }
>> diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c
>> index 8a492d3..c9cc307 100644
>> --- a/drivers/clocksource/timer-prima2.c
>> +++ b/drivers/clocksource/timer-prima2.c
>> @@ -204,7 +204,7 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
>> writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
>> writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
>>
>> - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
>> + clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE);
>>
>> sched_clock_register(sirfsoc_read_sched_clock, 64, CLOCK_TICK_RATE);
>>
>> diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
>> index 1098ed3..13f5fa4 100644
>> --- a/drivers/clocksource/vt8500_timer.c
>> +++ b/drivers/clocksource/vt8500_timer.c
>> @@ -150,9 +150,7 @@ static void __init vt8500_timer_init(struct device_node *np)
>> writel(0xf, regbase + TIMER_STATUS_VAL);
>> writel(~0, regbase + TIMER_MATCH_VAL);
>>
>> - if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
>> - pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n",
>> - __func__, clocksource.name);
>> + clocksource_register_hz(&clocksource, VT8500_TIMER_HZ);
>>
>> clockevent.cpumask = cpumask_of(0);
>>
>> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
>> index 67301a4..5a17c5e 100644
>> --- a/include/linux/clocksource.h
>> +++ b/include/linux/clocksource.h
>> @@ -282,7 +282,7 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
>> }
>>
>>
>> -extern int clocksource_register(struct clocksource*);
>> +extern void clocksource_register(struct clocksource *);
>> extern int clocksource_unregister(struct clocksource*);
>> extern void clocksource_touch_watchdog(void);
>> extern struct clocksource* clocksource_get_next(void);
>> @@ -301,17 +301,17 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
>> * Don't call __clocksource_register_scale directly, use
>> * clocksource_register_hz/khz
>> */
>> -extern int
>> +extern void
>> __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
>> extern void
>> __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq);
>>
>> -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
>> +static inline void clocksource_register_hz(struct clocksource *cs, u32 hz)
>> {
>> return __clocksource_register_scale(cs, 1, hz);
>> }
>>
>> -static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
>> +static inline void clocksource_register_khz(struct clocksource *cs, u32 khz)
>> {
>> return __clocksource_register_scale(cs, 1000, khz);
>> }
>> diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
>> index 9951575..686ff72 100644
>> --- a/kernel/time/clocksource.c
>> +++ b/kernel/time/clocksource.c
>> @@ -782,7 +782,7 @@ EXPORT_SYMBOL_GPL(__clocksource_updatefreq_scale);
>> * This *SHOULD NOT* be called directly! Please use the
>> * clocksource_register_hz() or clocksource_register_khz helper functions.
>> */
>> -int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
>> +void __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
>> {
>>
>> /* Initialize mult/shift and max_idle_ns */
>> @@ -794,7 +794,6 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
>> clocksource_enqueue_watchdog(cs);
>> clocksource_select();
>> mutex_unlock(&clocksource_mutex);
>> - return 0;
>> }
>> EXPORT_SYMBOL_GPL(__clocksource_register_scale);
>>
>> @@ -804,7 +803,7 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
>> * @cs: clocksource to be registered
>> *
>> */
>> -int clocksource_register(struct clocksource *cs)
>> +void clocksource_register(struct clocksource *cs)
>> {
>> /* calculate max adjustment for given mult/shift */
>> cs->maxadj = clocksource_max_adjustment(cs);
>> @@ -820,7 +819,6 @@ int clocksource_register(struct clocksource *cs)
>> clocksource_enqueue_watchdog(cs);
>> clocksource_select();
>> mutex_unlock(&clocksource_mutex);
>> - return 0;
>> }
>> EXPORT_SYMBOL(clocksource_register);
>>
>> diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
>> index 7a925ba..ae4c534 100644
>> --- a/kernel/time/jiffies.c
>> +++ b/kernel/time/jiffies.c
>> @@ -88,7 +88,8 @@ EXPORT_SYMBOL(jiffies);
>>
>> static int __init init_jiffies_clocksource(void)
>> {
>> - return clocksource_register(&clocksource_jiffies);
>> + clocksource_register(&clocksource_jiffies);
>> + return 0;
>> }
>>
>> core_initcall(init_jiffies_clocksource);
>>
>
>
--
Thanks!
Yijing
|
|
From: Daniel L. <dan...@li...> - 2014-01-23 08:40:32
|
On 01/23/2014 08:12 AM, Yijing Wang wrote:
> Currently, clocksource_register() and __clocksource_register_scale()
> functions always return 0, it's pointless, make functions void.
> And remove the dead code that check the clocksource_register_hz()
> return value.
>
> Signed-off-by: Yijing Wang <wan...@hu...>
Well, do we really want to change all these files to not take care of a
return value ? What about is we have to check it again later ?
I would recommend to investigate __clocksource_register_scale and the
underneath functions if there is not an error to be returned in the call
stack somewhere which is ignored today.
The same applies for clocksource_register.
Thanks
-- Daniel
> ---
> arch/arm/mach-davinci/time.c | 5 ++---
> arch/arm/mach-msm/timer.c | 4 +---
> arch/arm/mach-omap2/timer.c | 8 +++-----
> arch/avr32/kernel/time.c | 4 +---
> arch/blackfin/kernel/time-ts.c | 6 ++----
> arch/microblaze/kernel/timer.c | 3 +--
> arch/mips/jz4740/time.c | 6 +-----
> arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | 3 ++-
> arch/openrisc/kernel/time.c | 3 +--
> arch/powerpc/kernel/time.c | 6 +-----
> arch/um/kernel/time.c | 6 +-----
> arch/x86/platform/uv/uv_time.c | 14 ++++++--------
> drivers/clocksource/acpi_pm.c | 3 ++-
> drivers/clocksource/cadence_ttc_timer.c | 6 +-----
> drivers/clocksource/exynos_mct.c | 4 +---
> drivers/clocksource/i8253.c | 3 ++-
> drivers/clocksource/mmio.c | 3 ++-
> drivers/clocksource/samsung_pwm_timer.c | 5 +----
> drivers/clocksource/scx200_hrt.c | 3 ++-
> drivers/clocksource/tcb_clksrc.c | 8 +-------
> drivers/clocksource/timer-marco.c | 2 +-
> drivers/clocksource/timer-prima2.c | 2 +-
> drivers/clocksource/vt8500_timer.c | 4 +---
> include/linux/clocksource.h | 8 ++++----
> kernel/time/clocksource.c | 6 ++----
> kernel/time/jiffies.c | 3 ++-
> 26 files changed, 45 insertions(+), 83 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
> index 56c6eb5..9536f85 100644
> --- a/arch/arm/mach-davinci/time.c
> +++ b/arch/arm/mach-davinci/time.c
> @@ -387,9 +387,8 @@ void __init davinci_timer_init(void)
>
> /* setup clocksource */
> clocksource_davinci.name = id_to_name[clocksource_id];
> - if (clocksource_register_hz(&clocksource_davinci,
> - davinci_clock_tick_rate))
> - printk(err, clocksource_davinci.name);
> + clocksource_register_hz(&clocksource_davinci,
> + davinci_clock_tick_rate);
>
> setup_sched_clock(davinci_read_sched_clock, 32,
> davinci_clock_tick_rate);
> diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
> index 1e9c338..c96e034 100644
> --- a/arch/arm/mach-msm/timer.c
> +++ b/arch/arm/mach-msm/timer.c
> @@ -226,9 +226,7 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
>
> err:
> writel_relaxed(TIMER_ENABLE_EN, source_base + TIMER_ENABLE);
> - res = clocksource_register_hz(cs, dgt_hz);
> - if (res)
> - pr_err("clocksource_register failed\n");
> + clocksource_register_hz(cs, dgt_hz);
> setup_sched_clock(msm_sched_clock_read, sched_bits, dgt_hz);
> }
>
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index 3ca81e0..beaf7c7 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -473,11 +473,9 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
> OMAP_TIMER_NONPOSTED);
> setup_sched_clock(dmtimer_read_sched_clock, 32, clksrc.rate);
>
> - if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
> - pr_err("Could not register clocksource %s\n",
> - clocksource_gpt.name);
> - else
> - pr_info("OMAP clocksource: %s at %lu Hz\n",
> + clocksource_register_hz(&clocksource_gpt, clksrc.rate);
> +
> + pr_info("OMAP clocksource: %s at %lu Hz\n",
> clocksource_gpt.name, clksrc.rate);
> }
>
> diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
> index d0f771b..51b4a66 100644
> --- a/arch/avr32/kernel/time.c
> +++ b/arch/avr32/kernel/time.c
> @@ -134,9 +134,7 @@ void __init time_init(void)
>
> /* figure rate for counter */
> counter_hz = clk_get_rate(boot_cpu_data.clk);
> - ret = clocksource_register_hz(&counter, counter_hz);
> - if (ret)
> - pr_debug("timer: could not register clocksource: %d\n", ret);
> + clocksource_register_hz(&counter, counter_hz);
>
> /* setup COMPARE clockevent */
> comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift);
> diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
> index cb0a484..df3bb08 100644
> --- a/arch/blackfin/kernel/time-ts.c
> +++ b/arch/blackfin/kernel/time-ts.c
> @@ -51,8 +51,7 @@ static inline unsigned long long bfin_cs_cycles_sched_clock(void)
>
> static int __init bfin_cs_cycles_init(void)
> {
> - if (clocksource_register_hz(&bfin_cs_cycles, get_cclk()))
> - panic("failed to register clocksource");
> + clocksource_register_hz(&bfin_cs_cycles, get_cclk());
>
> return 0;
> }
> @@ -103,8 +102,7 @@ static int __init bfin_cs_gptimer0_init(void)
> {
> setup_gptimer0();
>
> - if (clocksource_register_hz(&bfin_cs_gptimer0, get_sclk()))
> - panic("failed to register clocksource");
> + clocksource_register_hz(&bfin_cs_gptimer0, get_sclk());
>
> return 0;
> }
> diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
> index 3e39b10..6a2417e 100644
> --- a/arch/microblaze/kernel/timer.c
> +++ b/arch/microblaze/kernel/timer.c
> @@ -208,8 +208,7 @@ static struct clocksource clocksource_microblaze = {
>
> static int __init xilinx_clocksource_init(void)
> {
> - if (clocksource_register_hz(&clocksource_microblaze, timer_clock_freq))
> - panic("failed to register clocksource");
> + clocksource_register_hz(&clocksource_microblaze, timer_clock_freq);
>
> /* stop timer1 */
> out_be32(timer_baseaddr + TCSR1,
> diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c
> index 5e430ce..041cdff 100644
> --- a/arch/mips/jz4740/time.c
> +++ b/arch/mips/jz4740/time.c
> @@ -105,7 +105,6 @@ static struct irqaction timer_irqaction = {
>
> void __init plat_time_init(void)
> {
> - int ret;
> uint32_t clk_rate;
> uint16_t ctrl;
>
> @@ -121,10 +120,7 @@ void __init plat_time_init(void)
>
> clockevents_register_device(&jz4740_clockevent);
>
> - ret = clocksource_register_hz(&jz4740_clocksource, clk_rate);
> -
> - if (ret)
> - printk(KERN_ERR "Failed to register clocksource: %d\n", ret);
> + clocksource_register_hz(&jz4740_clocksource, clk_rate);
>
> setup_irq(JZ4740_IRQ_TCU0, &timer_irqaction);
>
> diff --git a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
> index c639b9d..9fa6d99 100644
> --- a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
> +++ b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
> @@ -208,7 +208,8 @@ int __init init_mfgpt_clocksource(void)
> if (num_possible_cpus() > 1) /* MFGPT does not scale! */
> return 0;
>
> - return clocksource_register_hz(&clocksource_mfgpt, MFGPT_TICK_RATE);
> + clocksource_register_hz(&clocksource_mfgpt, MFGPT_TICK_RATE);
> + return 0;
> }
>
> arch_initcall(init_mfgpt_clocksource);
> diff --git a/arch/openrisc/kernel/time.c b/arch/openrisc/kernel/time.c
> index 7c52e94..3f789aa 100644
> --- a/arch/openrisc/kernel/time.c
> +++ b/arch/openrisc/kernel/time.c
> @@ -156,8 +156,7 @@ static struct clocksource openrisc_timer = {
>
> static int __init openrisc_timer_init(void)
> {
> - if (clocksource_register_hz(&openrisc_timer, cpuinfo.clock_frequency))
> - panic("failed to register clocksource");
> + clocksource_register_hz(&openrisc_timer, cpuinfo.clock_frequency);
>
> /* Enable the incrementer: 'continuous' mode with interrupt disabled */
> mtspr(SPR_TTMR, SPR_TTMR_CR);
> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
> index b3b1441..27c0627 100644
> --- a/arch/powerpc/kernel/time.c
> +++ b/arch/powerpc/kernel/time.c
> @@ -788,11 +788,7 @@ static void __init clocksource_init(void)
> else
> clock = &clocksource_timebase;
>
> - if (clocksource_register_hz(clock, tb_ticks_per_sec)) {
> - printk(KERN_ERR "clocksource: %s is already registered\n",
> - clock->name);
> - return;
> - }
> + clocksource_register_hz(clock, tb_ticks_per_sec);
>
> printk(KERN_INFO "clocksource: %s mult[%x] shift[%d] registered\n",
> clock->name, clock->mult, clock->shift);
> diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
> index 117568d..2034b58 100644
> --- a/arch/um/kernel/time.c
> +++ b/arch/um/kernel/time.c
> @@ -92,11 +92,7 @@ static void __init setup_itimer(void)
> clockevent_delta2ns(60 * HZ, &itimer_clockevent);
> itimer_clockevent.min_delta_ns =
> clockevent_delta2ns(1, &itimer_clockevent);
> - err = clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
> - if (err) {
> - printk(KERN_ERR "clocksource_register_hz returned %d\n", err);
> - return;
> - }
> + clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
> clockevents_register_device(&itimer_clockevent);
> }
>
> diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c
> index 5c86786..b963774 100644
> --- a/arch/x86/platform/uv/uv_time.c
> +++ b/arch/x86/platform/uv/uv_time.c
> @@ -379,15 +379,13 @@ static __init int uv_rtc_setup_clock(void)
> if (!is_uv_system())
> return -ENODEV;
>
> - rc = clocksource_register_hz(&clocksource_uv, sn_rtc_cycles_per_second);
> - if (rc)
> - printk(KERN_INFO "UV RTC clocksource failed rc %d\n", rc);
> - else
> - printk(KERN_INFO "UV RTC clocksource registered freq %lu MHz\n",
> - sn_rtc_cycles_per_second/(unsigned long)1E6);
> + clocksource_register_hz(&clocksource_uv, sn_rtc_cycles_per_second);
> +
> + pr_info("UV RTC clocksource registered freq %lu MHz\n",
> + sn_rtc_cycles_per_second/(unsigned long)1E6);
>
> - if (rc || !uv_rtc_evt_enable || x86_platform_ipi_callback)
> - return rc;
> + if (!uv_rtc_evt_enable || x86_platform_ipi_callback)
> + return 0;
>
> /* Setup and register clockevents */
> rc = uv_rtc_allocate_timers();
> diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
> index 6eab889..ab1dc63 100644
> --- a/drivers/clocksource/acpi_pm.c
> +++ b/drivers/clocksource/acpi_pm.c
> @@ -218,8 +218,9 @@ static int __init init_acpi_pm_clocksource(void)
> return -ENODEV;
> }
>
> - return clocksource_register_hz(&clocksource_acpi_pm,
> + clocksource_register_hz(&clocksource_acpi_pm,
> PMTMR_TICKS_PER_SEC);
> + return 0;
> }
>
> /* We use fs_initcall because we want the PCI fixups to have run
> diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c
> index 63f176d..b9b56ed 100644
> --- a/drivers/clocksource/cadence_ttc_timer.c
> +++ b/drivers/clocksource/cadence_ttc_timer.c
> @@ -301,11 +301,7 @@ static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base)
> __raw_writel(CNT_CNTRL_RESET,
> ttccs->ttc.base_addr + TTC_CNT_CNTRL_OFFSET);
>
> - err = clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE);
> - if (WARN_ON(err)) {
> - kfree(ttccs);
> - return;
> - }
> + clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE);
>
> ttc_sched_clock_val_reg = base + TTC_COUNT_VAL_OFFSET;
> sched_clock_register(ttc_sched_clock_read, 16, ttccs->ttc.freq / PRESCALE);
> diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
> index 62b0de6..98649c7 100644
> --- a/drivers/clocksource/exynos_mct.c
> +++ b/drivers/clocksource/exynos_mct.c
> @@ -193,9 +193,7 @@ struct clocksource mct_frc = {
> static void __init exynos4_clocksource_init(void)
> {
> exynos4_mct_frc_start(0, 0);
> -
> - if (clocksource_register_hz(&mct_frc, clk_rate))
> - panic("%s: can't register clocksource\n", mct_frc.name);
> + clocksource_register_hz(&mct_frc, clk_rate);
> }
>
> static void exynos4_mct_comp0_stop(void)
> diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
> index 14ee3ef..9c45f0a 100644
> --- a/drivers/clocksource/i8253.c
> +++ b/drivers/clocksource/i8253.c
> @@ -95,7 +95,8 @@ static struct clocksource i8253_cs = {
>
> int __init clocksource_i8253_init(void)
> {
> - return clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
> + clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
> + return 0;
> }
> #endif
>
> diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c
> index c0e2512..6e0b530 100644
> --- a/drivers/clocksource/mmio.c
> +++ b/drivers/clocksource/mmio.c
> @@ -69,5 +69,6 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name,
> cs->clksrc.mask = CLOCKSOURCE_MASK(bits);
> cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
>
> - return clocksource_register_hz(&cs->clksrc, hz);
> + clocksource_register_hz(&cs->clksrc, hz);
> + return 0;
> }
> diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
> index 5645cfc..c59292f 100644
> --- a/drivers/clocksource/samsung_pwm_timer.c
> +++ b/drivers/clocksource/samsung_pwm_timer.c
> @@ -340,7 +340,6 @@ static void __init samsung_clocksource_init(void)
> {
> unsigned long pclk;
> unsigned long clock_rate;
> - int ret;
>
> pclk = clk_get_rate(pwm.timerclk);
>
> @@ -361,9 +360,7 @@ static void __init samsung_clocksource_init(void)
> pwm.variant.bits, clock_rate);
>
> samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
> - ret = clocksource_register_hz(&samsung_clocksource, clock_rate);
> - if (ret)
> - panic("samsung_clocksource_timer: can't register clocksource\n");
> + clocksource_register_hz(&samsung_clocksource, clock_rate);
> }
>
> static void __init samsung_timer_resources(void)
> diff --git a/drivers/clocksource/scx200_hrt.c b/drivers/clocksource/scx200_hrt.c
> index 64f9e82..57bdc04 100644
> --- a/drivers/clocksource/scx200_hrt.c
> +++ b/drivers/clocksource/scx200_hrt.c
> @@ -83,7 +83,8 @@ static int __init init_hrt_clocksource(void)
>
> pr_info("enabling scx200 high-res timer (%s MHz +%d ppm)\n", mhz27 ? "27":"1", ppm);
>
> - return clocksource_register_hz(&cs_hrt, freq);
> + clocksource_register_hz(&cs_hrt, freq);
> + return 0;
> }
>
> module_init(init_hrt_clocksource);
> diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
> index 00fdd11..805245d 100644
> --- a/drivers/clocksource/tcb_clksrc.c
> +++ b/drivers/clocksource/tcb_clksrc.c
> @@ -340,9 +340,7 @@ static int __init tcb_clksrc_init(void)
> }
>
> /* and away we go! */
> - ret = clocksource_register_hz(&clksrc, divided_rate);
> - if (ret)
> - goto err_disable_t1;
> + clocksource_register_hz(&clksrc, divided_rate);
>
> /* channel 2: periodic and oneshot timer support */
> ret = setup_clkevents(tc, clk32k_divisor_idx);
> @@ -354,10 +352,6 @@ static int __init tcb_clksrc_init(void)
> err_unregister_clksrc:
> clocksource_unregister(&clksrc);
>
> -err_disable_t1:
> - if (!tc->tcb_config || tc->tcb_config->counter_width != 32)
> - clk_disable_unprepare(tc->clk[1]);
> -
> err_disable_t0:
> clk_disable_unprepare(t0_clk);
>
> diff --git a/drivers/clocksource/timer-marco.c b/drivers/clocksource/timer-marco.c
> index 09a17d9..ae78ce0 100644
> --- a/drivers/clocksource/timer-marco.c
> +++ b/drivers/clocksource/timer-marco.c
> @@ -283,7 +283,7 @@ static void __init sirfsoc_marco_timer_init(void)
> /* Clear all interrupts */
> writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
>
> - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
> + clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE);
>
> sirfsoc_clockevent_init();
> }
> diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c
> index 8a492d3..c9cc307 100644
> --- a/drivers/clocksource/timer-prima2.c
> +++ b/drivers/clocksource/timer-prima2.c
> @@ -204,7 +204,7 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
> writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
> writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
>
> - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
> + clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE);
>
> sched_clock_register(sirfsoc_read_sched_clock, 64, CLOCK_TICK_RATE);
>
> diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
> index 1098ed3..13f5fa4 100644
> --- a/drivers/clocksource/vt8500_timer.c
> +++ b/drivers/clocksource/vt8500_timer.c
> @@ -150,9 +150,7 @@ static void __init vt8500_timer_init(struct device_node *np)
> writel(0xf, regbase + TIMER_STATUS_VAL);
> writel(~0, regbase + TIMER_MATCH_VAL);
>
> - if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
> - pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n",
> - __func__, clocksource.name);
> + clocksource_register_hz(&clocksource, VT8500_TIMER_HZ);
>
> clockevent.cpumask = cpumask_of(0);
>
> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
> index 67301a4..5a17c5e 100644
> --- a/include/linux/clocksource.h
> +++ b/include/linux/clocksource.h
> @@ -282,7 +282,7 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
> }
>
>
> -extern int clocksource_register(struct clocksource*);
> +extern void clocksource_register(struct clocksource *);
> extern int clocksource_unregister(struct clocksource*);
> extern void clocksource_touch_watchdog(void);
> extern struct clocksource* clocksource_get_next(void);
> @@ -301,17 +301,17 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
> * Don't call __clocksource_register_scale directly, use
> * clocksource_register_hz/khz
> */
> -extern int
> +extern void
> __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
> extern void
> __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq);
>
> -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
> +static inline void clocksource_register_hz(struct clocksource *cs, u32 hz)
> {
> return __clocksource_register_scale(cs, 1, hz);
> }
>
> -static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
> +static inline void clocksource_register_khz(struct clocksource *cs, u32 khz)
> {
> return __clocksource_register_scale(cs, 1000, khz);
> }
> diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
> index 9951575..686ff72 100644
> --- a/kernel/time/clocksource.c
> +++ b/kernel/time/clocksource.c
> @@ -782,7 +782,7 @@ EXPORT_SYMBOL_GPL(__clocksource_updatefreq_scale);
> * This *SHOULD NOT* be called directly! Please use the
> * clocksource_register_hz() or clocksource_register_khz helper functions.
> */
> -int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
> +void __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
> {
>
> /* Initialize mult/shift and max_idle_ns */
> @@ -794,7 +794,6 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
> clocksource_enqueue_watchdog(cs);
> clocksource_select();
> mutex_unlock(&clocksource_mutex);
> - return 0;
> }
> EXPORT_SYMBOL_GPL(__clocksource_register_scale);
>
> @@ -804,7 +803,7 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
> * @cs: clocksource to be registered
> *
> */
> -int clocksource_register(struct clocksource *cs)
> +void clocksource_register(struct clocksource *cs)
> {
> /* calculate max adjustment for given mult/shift */
> cs->maxadj = clocksource_max_adjustment(cs);
> @@ -820,7 +819,6 @@ int clocksource_register(struct clocksource *cs)
> clocksource_enqueue_watchdog(cs);
> clocksource_select();
> mutex_unlock(&clocksource_mutex);
> - return 0;
> }
> EXPORT_SYMBOL(clocksource_register);
>
> diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
> index 7a925ba..ae4c534 100644
> --- a/kernel/time/jiffies.c
> +++ b/kernel/time/jiffies.c
> @@ -88,7 +88,8 @@ EXPORT_SYMBOL(jiffies);
>
> static int __init init_jiffies_clocksource(void)
> {
> - return clocksource_register(&clocksource_jiffies);
> + clocksource_register(&clocksource_jiffies);
> + return 0;
> }
>
> core_initcall(init_jiffies_clocksource);
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
|
|
From: Yijing W. <wan...@hu...> - 2014-01-23 08:27:58
|
On 2014/1/23 16:04, Tony Prisk wrote:
> On 23/01/14 20:58, Geert Uytterhoeven wrote:
>> On Thu, Jan 23, 2014 at 8:45 AM, Tony Prisk <li...@pr...> wrote:
>>>> -static inline int clocksource_register_hz(struct clocksource *cs, u32
>>>> hz)
>>>> +static inline void clocksource_register_hz(struct clocksource *cs, u32
>>>> hz)
>>>> {
>>>> return __clocksource_register_scale(cs, 1, hz);
>>>> }
>>>
>>> This doesn't make sense - you are still returning a value on a function
>>> declared void, and the return is now from a function that doesn't return
>>> anything either ?!?!
>>> Doesn't this throw a compile-time warning??
>> No, passing on void in functions returning void doesn't cause compiler
>> warnings.
>>
>> Gr{oetje,eeting}s,
>>
>> Geert
>>
>> --
>> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
>>
>> In personal conversations with technical people, I call myself a hacker. But
>> when I'm talking to journalists I just say "programmer" or something like that.
>> -- Linus Torvalds
> Doesn't seem right to me (even if there is no warning) but that's probably because I used to program in Pascal where functions with no return were 'procedures' :)
> Whether it needs to be changed or not:
>
> For the vt8500 part -
> Acked-by: Tony Prisk <li...@pr...>
Thanks!
>
> Regards
> Tony Prisk
>
>
> .
>
--
Thanks!
Yijing
|
|
From: Tony P. <li...@pr...> - 2014-01-23 08:09:45
|
On 23/01/14 20:12, Yijing Wang wrote:
> Currently, clocksource_register() and __clocksource_register_scale()
> functions always return 0, it's pointless, make functions void.
> And remove the dead code that check the clocksource_register_hz()
> return value.
>
> Signed-off-by: Yijing Wang <wan...@hu...>
......
> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
> index 67301a4..5a17c5e 100644
> --- a/include/linux/clocksource.h
> +++ b/include/linux/clocksource.h
> @@ -282,7 +282,7 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
> }
>
>
> -extern int clocksource_register(struct clocksource*);
> +extern void clocksource_register(struct clocksource *);
> extern int clocksource_unregister(struct clocksource*);
> extern void clocksource_touch_watchdog(void);
> extern struct clocksource* clocksource_get_next(void);
> @@ -301,17 +301,17 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
> * Don't call __clocksource_register_scale directly, use
> * clocksource_register_hz/khz
> */
> -extern int
> +extern void
> __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
> extern void
> __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq);
>
> -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
> +static inline void clocksource_register_hz(struct clocksource *cs, u32 hz)
> {
> return __clocksource_register_scale(cs, 1, hz);
> }
This doesn't make sense - you are still returning a value on a function
declared void, and the return is now from a function that doesn't return
anything either ?!?!
Doesn't this throw a compile-time warning??
Regards
Tony Prisk
|
|
From: Tony P. <li...@pr...> - 2014-01-23 08:04:22
|
On 23/01/14 20:58, Geert Uytterhoeven wrote:
> On Thu, Jan 23, 2014 at 8:45 AM, Tony Prisk <li...@pr...> wrote:
>>> -static inline int clocksource_register_hz(struct clocksource *cs, u32
>>> hz)
>>> +static inline void clocksource_register_hz(struct clocksource *cs, u32
>>> hz)
>>> {
>>> return __clocksource_register_scale(cs, 1, hz);
>>> }
>>
>> This doesn't make sense - you are still returning a value on a function
>> declared void, and the return is now from a function that doesn't return
>> anything either ?!?!
>> Doesn't this throw a compile-time warning??
> No, passing on void in functions returning void doesn't cause compiler
> warnings.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
Doesn't seem right to me (even if there is no warning) but that's
probably because I used to program in Pascal where functions with no
return were 'procedures' :)
Whether it needs to be changed or not:
For the vt8500 part -
Acked-by: Tony Prisk <li...@pr...>
Regards
Tony Prisk
|
|
From: Geert U. <ge...@li...> - 2014-01-23 07:58:19
|
On Thu, Jan 23, 2014 at 8:45 AM, Tony Prisk <li...@pr...> wrote:
>> -static inline int clocksource_register_hz(struct clocksource *cs, u32
>> hz)
>> +static inline void clocksource_register_hz(struct clocksource *cs, u32
>> hz)
>> {
>> return __clocksource_register_scale(cs, 1, hz);
>> }
>
>
> This doesn't make sense - you are still returning a value on a function
> declared void, and the return is now from a function that doesn't return
> anything either ?!?!
> Doesn't this throw a compile-time warning??
No, passing on void in functions returning void doesn't cause compiler
warnings.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: Hans-Christian E. <eg...@sa...> - 2014-01-23 07:45:26
|
Around Thu 23 Jan 2014 15:12:46 +0800 or thereabout, Yijing Wang wrote: > Currently, clocksource_register() and __clocksource_register_scale() > functions always return 0, it's pointless, make functions void. > And remove the dead code that check the clocksource_register_hz() > return value. > > Signed-off-by: Yijing Wang <wan...@hu...> For the avr32 related change Acked-by: Hans-Christian Egtvedt <eg...@sa...> > --- > arch/arm/mach-davinci/time.c | 5 ++--- > arch/arm/mach-msm/timer.c | 4 +--- > arch/arm/mach-omap2/timer.c | 8 +++----- > arch/avr32/kernel/time.c | 4 +--- > arch/blackfin/kernel/time-ts.c | 6 ++---- > arch/microblaze/kernel/timer.c | 3 +-- > arch/mips/jz4740/time.c | 6 +----- > arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | 3 ++- > arch/openrisc/kernel/time.c | 3 +-- > arch/powerpc/kernel/time.c | 6 +----- > arch/um/kernel/time.c | 6 +----- > arch/x86/platform/uv/uv_time.c | 14 ++++++-------- > drivers/clocksource/acpi_pm.c | 3 ++- > drivers/clocksource/cadence_ttc_timer.c | 6 +----- > drivers/clocksource/exynos_mct.c | 4 +--- > drivers/clocksource/i8253.c | 3 ++- > drivers/clocksource/mmio.c | 3 ++- > drivers/clocksource/samsung_pwm_timer.c | 5 +---- > drivers/clocksource/scx200_hrt.c | 3 ++- > drivers/clocksource/tcb_clksrc.c | 8 +------- > drivers/clocksource/timer-marco.c | 2 +- > drivers/clocksource/timer-prima2.c | 2 +- > drivers/clocksource/vt8500_timer.c | 4 +--- > include/linux/clocksource.h | 8 ++++---- > kernel/time/clocksource.c | 6 ++---- > kernel/time/jiffies.c | 3 ++- > 26 files changed, 45 insertions(+), 83 deletions(-) <snipp diffs> -- HcE |
|
From: Yijing W. <wan...@hu...> - 2014-01-23 07:26:31
|
Currently, clocksource_register() and __clocksource_register_scale()
functions always return 0, it's pointless, make functions void.
And remove the dead code that check the clocksource_register_hz()
return value.
Signed-off-by: Yijing Wang <wan...@hu...>
---
arch/arm/mach-davinci/time.c | 5 ++---
arch/arm/mach-msm/timer.c | 4 +---
arch/arm/mach-omap2/timer.c | 8 +++-----
arch/avr32/kernel/time.c | 4 +---
arch/blackfin/kernel/time-ts.c | 6 ++----
arch/microblaze/kernel/timer.c | 3 +--
arch/mips/jz4740/time.c | 6 +-----
arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | 3 ++-
arch/openrisc/kernel/time.c | 3 +--
arch/powerpc/kernel/time.c | 6 +-----
arch/um/kernel/time.c | 6 +-----
arch/x86/platform/uv/uv_time.c | 14 ++++++--------
drivers/clocksource/acpi_pm.c | 3 ++-
drivers/clocksource/cadence_ttc_timer.c | 6 +-----
drivers/clocksource/exynos_mct.c | 4 +---
drivers/clocksource/i8253.c | 3 ++-
drivers/clocksource/mmio.c | 3 ++-
drivers/clocksource/samsung_pwm_timer.c | 5 +----
drivers/clocksource/scx200_hrt.c | 3 ++-
drivers/clocksource/tcb_clksrc.c | 8 +-------
drivers/clocksource/timer-marco.c | 2 +-
drivers/clocksource/timer-prima2.c | 2 +-
drivers/clocksource/vt8500_timer.c | 4 +---
include/linux/clocksource.h | 8 ++++----
kernel/time/clocksource.c | 6 ++----
kernel/time/jiffies.c | 3 ++-
26 files changed, 45 insertions(+), 83 deletions(-)
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 56c6eb5..9536f85 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -387,9 +387,8 @@ void __init davinci_timer_init(void)
/* setup clocksource */
clocksource_davinci.name = id_to_name[clocksource_id];
- if (clocksource_register_hz(&clocksource_davinci,
- davinci_clock_tick_rate))
- printk(err, clocksource_davinci.name);
+ clocksource_register_hz(&clocksource_davinci,
+ davinci_clock_tick_rate);
setup_sched_clock(davinci_read_sched_clock, 32,
davinci_clock_tick_rate);
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 1e9c338..c96e034 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -226,9 +226,7 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
err:
writel_relaxed(TIMER_ENABLE_EN, source_base + TIMER_ENABLE);
- res = clocksource_register_hz(cs, dgt_hz);
- if (res)
- pr_err("clocksource_register failed\n");
+ clocksource_register_hz(cs, dgt_hz);
setup_sched_clock(msm_sched_clock_read, sched_bits, dgt_hz);
}
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 3ca81e0..beaf7c7 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -473,11 +473,9 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
OMAP_TIMER_NONPOSTED);
setup_sched_clock(dmtimer_read_sched_clock, 32, clksrc.rate);
- if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))
- pr_err("Could not register clocksource %s\n",
- clocksource_gpt.name);
- else
- pr_info("OMAP clocksource: %s at %lu Hz\n",
+ clocksource_register_hz(&clocksource_gpt, clksrc.rate);
+
+ pr_info("OMAP clocksource: %s at %lu Hz\n",
clocksource_gpt.name, clksrc.rate);
}
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
index d0f771b..51b4a66 100644
--- a/arch/avr32/kernel/time.c
+++ b/arch/avr32/kernel/time.c
@@ -134,9 +134,7 @@ void __init time_init(void)
/* figure rate for counter */
counter_hz = clk_get_rate(boot_cpu_data.clk);
- ret = clocksource_register_hz(&counter, counter_hz);
- if (ret)
- pr_debug("timer: could not register clocksource: %d\n", ret);
+ clocksource_register_hz(&counter, counter_hz);
/* setup COMPARE clockevent */
comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift);
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index cb0a484..df3bb08 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -51,8 +51,7 @@ static inline unsigned long long bfin_cs_cycles_sched_clock(void)
static int __init bfin_cs_cycles_init(void)
{
- if (clocksource_register_hz(&bfin_cs_cycles, get_cclk()))
- panic("failed to register clocksource");
+ clocksource_register_hz(&bfin_cs_cycles, get_cclk());
return 0;
}
@@ -103,8 +102,7 @@ static int __init bfin_cs_gptimer0_init(void)
{
setup_gptimer0();
- if (clocksource_register_hz(&bfin_cs_gptimer0, get_sclk()))
- panic("failed to register clocksource");
+ clocksource_register_hz(&bfin_cs_gptimer0, get_sclk());
return 0;
}
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index 3e39b10..6a2417e 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -208,8 +208,7 @@ static struct clocksource clocksource_microblaze = {
static int __init xilinx_clocksource_init(void)
{
- if (clocksource_register_hz(&clocksource_microblaze, timer_clock_freq))
- panic("failed to register clocksource");
+ clocksource_register_hz(&clocksource_microblaze, timer_clock_freq);
/* stop timer1 */
out_be32(timer_baseaddr + TCSR1,
diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c
index 5e430ce..041cdff 100644
--- a/arch/mips/jz4740/time.c
+++ b/arch/mips/jz4740/time.c
@@ -105,7 +105,6 @@ static struct irqaction timer_irqaction = {
void __init plat_time_init(void)
{
- int ret;
uint32_t clk_rate;
uint16_t ctrl;
@@ -121,10 +120,7 @@ void __init plat_time_init(void)
clockevents_register_device(&jz4740_clockevent);
- ret = clocksource_register_hz(&jz4740_clocksource, clk_rate);
-
- if (ret)
- printk(KERN_ERR "Failed to register clocksource: %d\n", ret);
+ clocksource_register_hz(&jz4740_clocksource, clk_rate);
setup_irq(JZ4740_IRQ_TCU0, &timer_irqaction);
diff --git a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
index c639b9d..9fa6d99 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
@@ -208,7 +208,8 @@ int __init init_mfgpt_clocksource(void)
if (num_possible_cpus() > 1) /* MFGPT does not scale! */
return 0;
- return clocksource_register_hz(&clocksource_mfgpt, MFGPT_TICK_RATE);
+ clocksource_register_hz(&clocksource_mfgpt, MFGPT_TICK_RATE);
+ return 0;
}
arch_initcall(init_mfgpt_clocksource);
diff --git a/arch/openrisc/kernel/time.c b/arch/openrisc/kernel/time.c
index 7c52e94..3f789aa 100644
--- a/arch/openrisc/kernel/time.c
+++ b/arch/openrisc/kernel/time.c
@@ -156,8 +156,7 @@ static struct clocksource openrisc_timer = {
static int __init openrisc_timer_init(void)
{
- if (clocksource_register_hz(&openrisc_timer, cpuinfo.clock_frequency))
- panic("failed to register clocksource");
+ clocksource_register_hz(&openrisc_timer, cpuinfo.clock_frequency);
/* Enable the incrementer: 'continuous' mode with interrupt disabled */
mtspr(SPR_TTMR, SPR_TTMR_CR);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b3b1441..27c0627 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -788,11 +788,7 @@ static void __init clocksource_init(void)
else
clock = &clocksource_timebase;
- if (clocksource_register_hz(clock, tb_ticks_per_sec)) {
- printk(KERN_ERR "clocksource: %s is already registered\n",
- clock->name);
- return;
- }
+ clocksource_register_hz(clock, tb_ticks_per_sec);
printk(KERN_INFO "clocksource: %s mult[%x] shift[%d] registered\n",
clock->name, clock->mult, clock->shift);
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index 117568d..2034b58 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -92,11 +92,7 @@ static void __init setup_itimer(void)
clockevent_delta2ns(60 * HZ, &itimer_clockevent);
itimer_clockevent.min_delta_ns =
clockevent_delta2ns(1, &itimer_clockevent);
- err = clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
- if (err) {
- printk(KERN_ERR "clocksource_register_hz returned %d\n", err);
- return;
- }
+ clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
clockevents_register_device(&itimer_clockevent);
}
diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c
index 5c86786..b963774 100644
--- a/arch/x86/platform/uv/uv_time.c
+++ b/arch/x86/platform/uv/uv_time.c
@@ -379,15 +379,13 @@ static __init int uv_rtc_setup_clock(void)
if (!is_uv_system())
return -ENODEV;
- rc = clocksource_register_hz(&clocksource_uv, sn_rtc_cycles_per_second);
- if (rc)
- printk(KERN_INFO "UV RTC clocksource failed rc %d\n", rc);
- else
- printk(KERN_INFO "UV RTC clocksource registered freq %lu MHz\n",
- sn_rtc_cycles_per_second/(unsigned long)1E6);
+ clocksource_register_hz(&clocksource_uv, sn_rtc_cycles_per_second);
+
+ pr_info("UV RTC clocksource registered freq %lu MHz\n",
+ sn_rtc_cycles_per_second/(unsigned long)1E6);
- if (rc || !uv_rtc_evt_enable || x86_platform_ipi_callback)
- return rc;
+ if (!uv_rtc_evt_enable || x86_platform_ipi_callback)
+ return 0;
/* Setup and register clockevents */
rc = uv_rtc_allocate_timers();
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index 6eab889..ab1dc63 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -218,8 +218,9 @@ static int __init init_acpi_pm_clocksource(void)
return -ENODEV;
}
- return clocksource_register_hz(&clocksource_acpi_pm,
+ clocksource_register_hz(&clocksource_acpi_pm,
PMTMR_TICKS_PER_SEC);
+ return 0;
}
/* We use fs_initcall because we want the PCI fixups to have run
diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c
index 63f176d..b9b56ed 100644
--- a/drivers/clocksource/cadence_ttc_timer.c
+++ b/drivers/clocksource/cadence_ttc_timer.c
@@ -301,11 +301,7 @@ static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base)
__raw_writel(CNT_CNTRL_RESET,
ttccs->ttc.base_addr + TTC_CNT_CNTRL_OFFSET);
- err = clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE);
- if (WARN_ON(err)) {
- kfree(ttccs);
- return;
- }
+ clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE);
ttc_sched_clock_val_reg = base + TTC_COUNT_VAL_OFFSET;
sched_clock_register(ttc_sched_clock_read, 16, ttccs->ttc.freq / PRESCALE);
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 62b0de6..98649c7 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -193,9 +193,7 @@ struct clocksource mct_frc = {
static void __init exynos4_clocksource_init(void)
{
exynos4_mct_frc_start(0, 0);
-
- if (clocksource_register_hz(&mct_frc, clk_rate))
- panic("%s: can't register clocksource\n", mct_frc.name);
+ clocksource_register_hz(&mct_frc, clk_rate);
}
static void exynos4_mct_comp0_stop(void)
diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
index 14ee3ef..9c45f0a 100644
--- a/drivers/clocksource/i8253.c
+++ b/drivers/clocksource/i8253.c
@@ -95,7 +95,8 @@ static struct clocksource i8253_cs = {
int __init clocksource_i8253_init(void)
{
- return clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
+ clocksource_register_hz(&i8253_cs, PIT_TICK_RATE);
+ return 0;
}
#endif
diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c
index c0e2512..6e0b530 100644
--- a/drivers/clocksource/mmio.c
+++ b/drivers/clocksource/mmio.c
@@ -69,5 +69,6 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name,
cs->clksrc.mask = CLOCKSOURCE_MASK(bits);
cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
- return clocksource_register_hz(&cs->clksrc, hz);
+ clocksource_register_hz(&cs->clksrc, hz);
+ return 0;
}
diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
index 5645cfc..c59292f 100644
--- a/drivers/clocksource/samsung_pwm_timer.c
+++ b/drivers/clocksource/samsung_pwm_timer.c
@@ -340,7 +340,6 @@ static void __init samsung_clocksource_init(void)
{
unsigned long pclk;
unsigned long clock_rate;
- int ret;
pclk = clk_get_rate(pwm.timerclk);
@@ -361,9 +360,7 @@ static void __init samsung_clocksource_init(void)
pwm.variant.bits, clock_rate);
samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
- ret = clocksource_register_hz(&samsung_clocksource, clock_rate);
- if (ret)
- panic("samsung_clocksource_timer: can't register clocksource\n");
+ clocksource_register_hz(&samsung_clocksource, clock_rate);
}
static void __init samsung_timer_resources(void)
diff --git a/drivers/clocksource/scx200_hrt.c b/drivers/clocksource/scx200_hrt.c
index 64f9e82..57bdc04 100644
--- a/drivers/clocksource/scx200_hrt.c
+++ b/drivers/clocksource/scx200_hrt.c
@@ -83,7 +83,8 @@ static int __init init_hrt_clocksource(void)
pr_info("enabling scx200 high-res timer (%s MHz +%d ppm)\n", mhz27 ? "27":"1", ppm);
- return clocksource_register_hz(&cs_hrt, freq);
+ clocksource_register_hz(&cs_hrt, freq);
+ return 0;
}
module_init(init_hrt_clocksource);
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
index 00fdd11..805245d 100644
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -340,9 +340,7 @@ static int __init tcb_clksrc_init(void)
}
/* and away we go! */
- ret = clocksource_register_hz(&clksrc, divided_rate);
- if (ret)
- goto err_disable_t1;
+ clocksource_register_hz(&clksrc, divided_rate);
/* channel 2: periodic and oneshot timer support */
ret = setup_clkevents(tc, clk32k_divisor_idx);
@@ -354,10 +352,6 @@ static int __init tcb_clksrc_init(void)
err_unregister_clksrc:
clocksource_unregister(&clksrc);
-err_disable_t1:
- if (!tc->tcb_config || tc->tcb_config->counter_width != 32)
- clk_disable_unprepare(tc->clk[1]);
-
err_disable_t0:
clk_disable_unprepare(t0_clk);
diff --git a/drivers/clocksource/timer-marco.c b/drivers/clocksource/timer-marco.c
index 09a17d9..ae78ce0 100644
--- a/drivers/clocksource/timer-marco.c
+++ b/drivers/clocksource/timer-marco.c
@@ -283,7 +283,7 @@ static void __init sirfsoc_marco_timer_init(void)
/* Clear all interrupts */
writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
- BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
+ clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE);
sirfsoc_clockevent_init();
}
diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c
index 8a492d3..c9cc307 100644
--- a/drivers/clocksource/timer-prima2.c
+++ b/drivers/clocksource/timer-prima2.c
@@ -204,7 +204,7 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
- BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
+ clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE);
sched_clock_register(sirfsoc_read_sched_clock, 64, CLOCK_TICK_RATE);
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index 1098ed3..13f5fa4 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -150,9 +150,7 @@ static void __init vt8500_timer_init(struct device_node *np)
writel(0xf, regbase + TIMER_STATUS_VAL);
writel(~0, regbase + TIMER_MATCH_VAL);
- if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
- pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n",
- __func__, clocksource.name);
+ clocksource_register_hz(&clocksource, VT8500_TIMER_HZ);
clockevent.cpumask = cpumask_of(0);
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 67301a4..5a17c5e 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -282,7 +282,7 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
}
-extern int clocksource_register(struct clocksource*);
+extern void clocksource_register(struct clocksource *);
extern int clocksource_unregister(struct clocksource*);
extern void clocksource_touch_watchdog(void);
extern struct clocksource* clocksource_get_next(void);
@@ -301,17 +301,17 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
* Don't call __clocksource_register_scale directly, use
* clocksource_register_hz/khz
*/
-extern int
+extern void
__clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
extern void
__clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq);
-static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
+static inline void clocksource_register_hz(struct clocksource *cs, u32 hz)
{
return __clocksource_register_scale(cs, 1, hz);
}
-static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
+static inline void clocksource_register_khz(struct clocksource *cs, u32 khz)
{
return __clocksource_register_scale(cs, 1000, khz);
}
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 9951575..686ff72 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -782,7 +782,7 @@ EXPORT_SYMBOL_GPL(__clocksource_updatefreq_scale);
* This *SHOULD NOT* be called directly! Please use the
* clocksource_register_hz() or clocksource_register_khz helper functions.
*/
-int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
+void __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
{
/* Initialize mult/shift and max_idle_ns */
@@ -794,7 +794,6 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
clocksource_enqueue_watchdog(cs);
clocksource_select();
mutex_unlock(&clocksource_mutex);
- return 0;
}
EXPORT_SYMBOL_GPL(__clocksource_register_scale);
@@ -804,7 +803,7 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
* @cs: clocksource to be registered
*
*/
-int clocksource_register(struct clocksource *cs)
+void clocksource_register(struct clocksource *cs)
{
/* calculate max adjustment for given mult/shift */
cs->maxadj = clocksource_max_adjustment(cs);
@@ -820,7 +819,6 @@ int clocksource_register(struct clocksource *cs)
clocksource_enqueue_watchdog(cs);
clocksource_select();
mutex_unlock(&clocksource_mutex);
- return 0;
}
EXPORT_SYMBOL(clocksource_register);
diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
index 7a925ba..ae4c534 100644
--- a/kernel/time/jiffies.c
+++ b/kernel/time/jiffies.c
@@ -88,7 +88,8 @@ EXPORT_SYMBOL(jiffies);
static int __init init_jiffies_clocksource(void)
{
- return clocksource_register(&clocksource_jiffies);
+ clocksource_register(&clocksource_jiffies);
+ return 0;
}
core_initcall(init_jiffies_clocksource);
--
1.7.1
|
|
From: Yijing W. <wan...@hu...> - 2014-01-23 07:24:04
|
clocksource_register() and __clocksource_register_scale()
always return 0, so the comment is just pointless, it's
outdated, remove it.
Signed-off-by: Yijing Wang <wan...@hu...>
---
kernel/time/clocksource.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index ba3e502..9951575 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -779,8 +779,6 @@ EXPORT_SYMBOL_GPL(__clocksource_updatefreq_scale);
* @scale: Scale factor multiplied against freq to get clocksource hz
* @freq: clocksource frequency (cycles per second) divided by scale
*
- * Returns -EBUSY if registration fails, zero otherwise.
- *
* This *SHOULD NOT* be called directly! Please use the
* clocksource_register_hz() or clocksource_register_khz helper functions.
*/
@@ -805,7 +803,6 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
* clocksource_register - Used to install new clocksources
* @cs: clocksource to be registered
*
- * Returns -EBUSY if registration fails, zero otherwise.
*/
int clocksource_register(struct clocksource *cs)
{
--
1.7.1
|