tick-broadcast.c (12572dbb53638c6e454ef831c8fee7de3df24389) tick-broadcast.c (12ad10004645d38356b14d1fbba379c523a61916)
1/*
2 * linux/kernel/time/tick-broadcast.c
3 *
4 * This file contains functions which emulate a local clock-event
5 * device via a broadcast event source.
6 *
7 * Copyright(C) 2005-2006, Thomas Gleixner <tglx@linutronix.de>
8 * Copyright(C) 2005-2007, Red Hat, Inc., Ingo Molnar

--- 4 unchanged lines hidden (view full) ---

13 */
14#include <linux/cpu.h>
15#include <linux/err.h>
16#include <linux/hrtimer.h>
17#include <linux/interrupt.h>
18#include <linux/percpu.h>
19#include <linux/profile.h>
20#include <linux/sched.h>
1/*
2 * linux/kernel/time/tick-broadcast.c
3 *
4 * This file contains functions which emulate a local clock-event
5 * device via a broadcast event source.
6 *
7 * Copyright(C) 2005-2006, Thomas Gleixner <tglx@linutronix.de>
8 * Copyright(C) 2005-2007, Red Hat, Inc., Ingo Molnar

--- 4 unchanged lines hidden (view full) ---

13 */
14#include <linux/cpu.h>
15#include <linux/err.h>
16#include <linux/hrtimer.h>
17#include <linux/interrupt.h>
18#include <linux/percpu.h>
19#include <linux/profile.h>
20#include <linux/sched.h>
21#include <linux/smp.h>
21
22#include "tick-internal.h"
23
24/*
25 * Broadcast support for broken x86 hardware, where the local apic
26 * timer stops in C3 state.
27 */
28

--- 52 unchanged lines hidden (view full) ---

81/*
82 * Check, if the device is the broadcast device
83 */
84int tick_is_broadcast_device(struct clock_event_device *dev)
85{
86 return (dev && tick_broadcast_device.evtdev == dev);
87}
88
22
23#include "tick-internal.h"
24
25/*
26 * Broadcast support for broken x86 hardware, where the local apic
27 * timer stops in C3 state.
28 */
29

--- 52 unchanged lines hidden (view full) ---

82/*
83 * Check, if the device is the broadcast device
84 */
85int tick_is_broadcast_device(struct clock_event_device *dev)
86{
87 return (dev && tick_broadcast_device.evtdev == dev);
88}
89
90static void err_broadcast(const struct cpumask *mask)
91{
92 pr_crit_once("Failed to broadcast timer tick. Some CPUs may be unresponsive.\n");
93}
94
89/*
90 * Check, if the device is disfunctional and a place holder, which
91 * needs to be handled by the broadcast device.
92 */
93int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu)
94{
95 unsigned long flags;
96 int ret = 0;
97
98 raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
99
100 /*
101 * Devices might be registered with both periodic and oneshot
102 * mode disabled. This signals, that the device needs to be
103 * operated from the broadcast device and is a placeholder for
104 * the cpu local device.
105 */
106 if (!tick_device_is_functional(dev)) {
107 dev->event_handler = tick_handle_periodic;
95/*
96 * Check, if the device is disfunctional and a place holder, which
97 * needs to be handled by the broadcast device.
98 */
99int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu)
100{
101 unsigned long flags;
102 int ret = 0;
103
104 raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
105
106 /*
107 * Devices might be registered with both periodic and oneshot
108 * mode disabled. This signals, that the device needs to be
109 * operated from the broadcast device and is a placeholder for
110 * the cpu local device.
111 */
112 if (!tick_device_is_functional(dev)) {
113 dev->event_handler = tick_handle_periodic;
114 if (!dev->broadcast)
115 dev->broadcast = tick_broadcast;
116 if (!dev->broadcast) {
117 pr_warn_once("%s depends on broadcast, but no broadcast function available\n",
118 dev->name);
119 dev->broadcast = err_broadcast;
120 }
108 cpumask_set_cpu(cpu, tick_get_broadcast_mask());
109 tick_broadcast_start_periodic(tick_broadcast_device.evtdev);
110 ret = 1;
111 } else {
112 /*
113 * When the new device is not affected by the stop
114 * feature and the cpu is marked in the broadcast mask
115 * then clear the broadcast bit.

--- 531 unchanged lines hidden ---
121 cpumask_set_cpu(cpu, tick_get_broadcast_mask());
122 tick_broadcast_start_periodic(tick_broadcast_device.evtdev);
123 ret = 1;
124 } else {
125 /*
126 * When the new device is not affected by the stop
127 * feature and the cpu is marked in the broadcast mask
128 * then clear the broadcast bit.

--- 531 unchanged lines hidden ---