Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350156
b: refs/heads/master
c: 12ad100
h: refs/heads/master
v: v3
  • Loading branch information
Mark Rutland authored and Thomas Gleixner committed Jan 31, 2013
1 parent 0b025c0 commit bb963b3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12572dbb53638c6e454ef831c8fee7de3df24389
refs/heads/master: 12ad10004645d38356b14d1fbba379c523a61916
5 changes: 5 additions & 0 deletions trunk/include/linux/clockchips.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ extern void clockevents_suspend(void);
extern void clockevents_resume(void);

#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
#ifdef CONFIG_ARCH_HAS_TICK_BROADCAST
extern void tick_broadcast(const struct cpumask *mask);
#else
#define tick_broadcast NULL
#endif
extern int tick_receive_broadcast(void);
#endif

Expand Down
4 changes: 4 additions & 0 deletions trunk/kernel/time/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ config GENERIC_CLOCKEVENTS_BUILD
default y
depends on GENERIC_CLOCKEVENTS

# Architecture can handle broadcast in a driver-agnostic way
config ARCH_HAS_TICK_BROADCAST
bool

# Clockevents broadcasting infrastructure
config GENERIC_CLOCKEVENTS_BROADCAST
bool
Expand Down
13 changes: 13 additions & 0 deletions trunk/kernel/time/tick-broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/percpu.h>
#include <linux/profile.h>
#include <linux/sched.h>
#include <linux/smp.h>

#include "tick-internal.h"

Expand Down Expand Up @@ -86,6 +87,11 @@ int tick_is_broadcast_device(struct clock_event_device *dev)
return (dev && tick_broadcast_device.evtdev == dev);
}

static void err_broadcast(const struct cpumask *mask)
{
pr_crit_once("Failed to broadcast timer tick. Some CPUs may be unresponsive.\n");
}

/*
* Check, if the device is disfunctional and a place holder, which
* needs to be handled by the broadcast device.
Expand All @@ -105,6 +111,13 @@ int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu)
*/
if (!tick_device_is_functional(dev)) {
dev->event_handler = tick_handle_periodic;
if (!dev->broadcast)
dev->broadcast = tick_broadcast;
if (!dev->broadcast) {
pr_warn_once("%s depends on broadcast, but no broadcast function available\n",
dev->name);
dev->broadcast = err_broadcast;
}
cpumask_set_cpu(cpu, tick_get_broadcast_mask());
tick_broadcast_start_periodic(tick_broadcast_device.evtdev);
ret = 1;
Expand Down

0 comments on commit bb963b3

Please sign in to comment.