Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tick/broadcast: Split __tick_broadcast_oneshot_control() into a helper

In preparation for adding support for per-cpu wakeup timers, split
_tick_broadcast_oneshot_control() into a helper function which deals
only with the broadcast timer management across idle transitions.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210524221818.15850-3-will@kernel.org

authored by

Will Deacon and committed by
Thomas Gleixner
e5007c28 c2d4fee3

+20 -13
+20 -13
kernel/time/tick-broadcast.c
··· 717 717 clockevents_switch_state(dev, CLOCK_EVT_STATE_SHUTDOWN); 718 718 } 719 719 720 - int __tick_broadcast_oneshot_control(enum tick_broadcast_state state) 720 + static int ___tick_broadcast_oneshot_control(enum tick_broadcast_state state, 721 + struct tick_device *td, 722 + int cpu) 721 723 { 722 - struct clock_event_device *bc, *dev; 723 - int cpu, ret = 0; 724 + struct clock_event_device *bc, *dev = td->evtdev; 725 + int ret = 0; 724 726 ktime_t now; 725 - 726 - /* 727 - * If there is no broadcast device, tell the caller not to go 728 - * into deep idle. 729 - */ 730 - if (!tick_broadcast_device.evtdev) 731 - return -EBUSY; 732 - 733 - dev = this_cpu_ptr(&tick_cpu_device)->evtdev; 734 727 735 728 raw_spin_lock(&tick_broadcast_lock); 736 729 bc = tick_broadcast_device.evtdev; 737 - cpu = smp_processor_id(); 738 730 739 731 if (state == TICK_BROADCAST_ENTER) { 740 732 /* ··· 853 861 out: 854 862 raw_spin_unlock(&tick_broadcast_lock); 855 863 return ret; 864 + } 865 + 866 + int __tick_broadcast_oneshot_control(enum tick_broadcast_state state) 867 + { 868 + struct tick_device *td = this_cpu_ptr(&tick_cpu_device); 869 + int cpu = smp_processor_id(); 870 + 871 + if (tick_broadcast_device.evtdev) 872 + return ___tick_broadcast_oneshot_control(state, td, cpu); 873 + 874 + /* 875 + * If there is no broadcast device, tell the caller not 876 + * to go into deep idle. 877 + */ 878 + return -EBUSY; 856 879 } 857 880 858 881 /*