Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fd56474 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer updates from Ingo Molnar:
 "The main changes in this cycle were:

   - clockevents state machine cleanups and enhancements (Viresh Kumar)

   - clockevents broadcast notifier horror to state machine conversion
     and related cleanups (Thomas Gleixner, Rafael J Wysocki)

   - clocksource and timekeeping core updates (John Stultz)

   - clocksource driver updates and fixes (Ben Dooks, Dmitry Osipenko,
     Hans de Goede, Laurent Pinchart, Maxime Ripard, Xunlei Pang)

   - y2038 fixes (Xunlei Pang, John Stultz)

   - NMI-safe ktime_get_raw_fast() and general refactoring of the clock
     code, in preparation to perf's per event clock ID support (Peter
     Zijlstra)

   - generic sched/clock fixes, optimizations and cleanups (Daniel
     Thompson)

   - clockevents cpu_down() race fix (Preeti U Murthy)"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (94 commits)
  timers/PM: Drop unnecessary braces from tick_freeze()
  timers/PM: Fix up tick_unfreeze()
  timekeeping: Get rid of stale comment
  clockevents: Cleanup dead cpu explicitely
  clockevents: Make tick handover explicit
  clockevents: Remove broadcast oneshot control leftovers
  sched/idle: Use explicit broadcast oneshot control function
  ARM: Tegra: Use explicit broadcast oneshot control function
  ARM: OMAP: Use explicit broadcast oneshot control function
  intel_idle: Use explicit broadcast oneshot control function
  ACPI/idle: Use explicit broadcast control function
  ACPI/PAD: Use explicit broadcast oneshot control function
  x86/amd/idle, clockevents: Use explicit broadcast oneshot control functions
  clockevents: Provide explicit broadcast oneshot control functions
  clockevents: Remove the broadcast control leftovers
  ARM: OMAP: Use explicit broadcast control function
  intel_idle: Use explicit broadcast control function
  cpuidle: Use explicit broadcast control function
  ACPI/processor: Use explicit broadcast control function
  ACPI/PAD: Use explicit broadcast control function
  ...
parents 49d2953c def74708
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -116,7 +116,7 @@ alpha_rtc_set_time(struct device *dev, struct rtc_time *tm)
}
}


static int
static int
alpha_rtc_set_mmss(struct device *dev, unsigned long nowtime)
alpha_rtc_set_mmss(struct device *dev, time64_t nowtime)
{
{
	int retval = 0;
	int retval = 0;
	int real_seconds, real_minutes, cmos_minutes;
	int real_seconds, real_minutes, cmos_minutes;
@@ -211,7 +211,7 @@ alpha_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
static const struct rtc_class_ops alpha_rtc_ops = {
static const struct rtc_class_ops alpha_rtc_ops = {
	.read_time = alpha_rtc_read_time,
	.read_time = alpha_rtc_read_time,
	.set_time = alpha_rtc_set_time,
	.set_time = alpha_rtc_set_time,
	.set_mmss = alpha_rtc_set_mmss,
	.set_mmss64 = alpha_rtc_set_mmss,
	.ioctl = alpha_rtc_ioctl,
	.ioctl = alpha_rtc_ioctl,
};
};


@@ -276,7 +276,7 @@ do_remote_mmss(void *data)
}
}


static int
static int
remote_set_mmss(struct device *dev, unsigned long now)
remote_set_mmss(struct device *dev, time64_t now)
{
{
	union remote_data x;
	union remote_data x;
	if (smp_processor_id() != boot_cpuid) {
	if (smp_processor_id() != boot_cpuid) {
@@ -290,7 +290,7 @@ remote_set_mmss(struct device *dev, unsigned long now)
static const struct rtc_class_ops remote_rtc_ops = {
static const struct rtc_class_ops remote_rtc_ops = {
	.read_time = remote_read_time,
	.read_time = remote_read_time,
	.set_time = remote_set_time,
	.set_time = remote_set_time,
	.set_mmss = remote_set_mmss,
	.set_mmss64 = remote_set_mmss,
	.ioctl = alpha_rtc_ioctl,
	.ioctl = alpha_rtc_ioctl,
};
};
#endif
#endif
+2 −14
Original line number Original line Diff line number Diff line
@@ -151,8 +151,6 @@ static int bL_switch_to(unsigned int new_cluster_id)
	unsigned int mpidr, this_cpu, that_cpu;
	unsigned int mpidr, this_cpu, that_cpu;
	unsigned int ob_mpidr, ob_cpu, ob_cluster, ib_mpidr, ib_cpu, ib_cluster;
	unsigned int ob_mpidr, ob_cpu, ob_cluster, ib_mpidr, ib_cpu, ib_cluster;
	struct completion inbound_alive;
	struct completion inbound_alive;
	struct tick_device *tdev;
	enum clock_event_mode tdev_mode;
	long volatile *handshake_ptr;
	long volatile *handshake_ptr;
	int ipi_nr, ret;
	int ipi_nr, ret;


@@ -219,13 +217,7 @@ static int bL_switch_to(unsigned int new_cluster_id)
	/* redirect GIC's SGIs to our counterpart */
	/* redirect GIC's SGIs to our counterpart */
	gic_migrate_target(bL_gic_id[ib_cpu][ib_cluster]);
	gic_migrate_target(bL_gic_id[ib_cpu][ib_cluster]);


	tdev = tick_get_device(this_cpu);
	tick_suspend_local();
	if (tdev && !cpumask_equal(tdev->evtdev->cpumask, cpumask_of(this_cpu)))
		tdev = NULL;
	if (tdev) {
		tdev_mode = tdev->evtdev->mode;
		clockevents_set_mode(tdev->evtdev, CLOCK_EVT_MODE_SHUTDOWN);
	}


	ret = cpu_pm_enter();
	ret = cpu_pm_enter();


@@ -251,11 +243,7 @@ static int bL_switch_to(unsigned int new_cluster_id)


	ret = cpu_pm_exit();
	ret = cpu_pm_exit();


	if (tdev) {
	tick_resume_local();
		clockevents_set_mode(tdev->evtdev, tdev_mode);
		clockevents_program_event(tdev->evtdev,
					  tdev->evtdev->next_event, 1);
	}


	trace_cpu_migrate_finish(ktime_get_real_ns(), ib_mpidr);
	trace_cpu_migrate_finish(ktime_get_real_ns(), ib_mpidr);
	local_fiq_enable();
	local_fiq_enable();
+1 −2
Original line number Original line Diff line number Diff line
@@ -12,8 +12,7 @@


extern void timer_tick(void);
extern void timer_tick(void);


struct timespec;
typedef void (*clock_access_fn)(struct timespec64 *);
typedef void (*clock_access_fn)(struct timespec *);
extern int register_persistent_clock(clock_access_fn read_boot,
extern int register_persistent_clock(clock_access_fn read_boot,
				     clock_access_fn read_persistent);
				     clock_access_fn read_persistent);


+3 −3
Original line number Original line Diff line number Diff line
@@ -76,7 +76,7 @@ void timer_tick(void)
}
}
#endif
#endif


static void dummy_clock_access(struct timespec *ts)
static void dummy_clock_access(struct timespec64 *ts)
{
{
	ts->tv_sec = 0;
	ts->tv_sec = 0;
	ts->tv_nsec = 0;
	ts->tv_nsec = 0;
@@ -85,12 +85,12 @@ static void dummy_clock_access(struct timespec *ts)
static clock_access_fn __read_persistent_clock = dummy_clock_access;
static clock_access_fn __read_persistent_clock = dummy_clock_access;
static clock_access_fn __read_boot_clock = dummy_clock_access;;
static clock_access_fn __read_boot_clock = dummy_clock_access;;


void read_persistent_clock(struct timespec *ts)
void read_persistent_clock64(struct timespec64 *ts)
{
{
	__read_persistent_clock(ts);
	__read_persistent_clock(ts);
}
}


void read_boot_clock(struct timespec *ts)
void read_boot_clock64(struct timespec64 *ts)
{
{
	__read_boot_clock(ts);
	__read_boot_clock(ts);
}
}
+4 −6
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
#include <linux/cpuidle.h>
#include <linux/cpuidle.h>
#include <linux/cpu_pm.h>
#include <linux/cpu_pm.h>
#include <linux/export.h>
#include <linux/export.h>
#include <linux/clockchips.h>
#include <linux/tick.h>


#include <asm/cpuidle.h>
#include <asm/cpuidle.h>
#include <asm/proc-fns.h>
#include <asm/proc-fns.h>
@@ -84,7 +84,6 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
{
{
	struct idle_statedata *cx = state_ptr + index;
	struct idle_statedata *cx = state_ptr + index;
	u32 mpuss_can_lose_context = 0;
	u32 mpuss_can_lose_context = 0;
	int cpu_id = smp_processor_id();


	/*
	/*
	 * CPU0 has to wait and stay ON until CPU1 is OFF state.
	 * CPU0 has to wait and stay ON until CPU1 is OFF state.
@@ -112,7 +111,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
	mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) &&
	mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) &&
				 (cx->mpu_logic_state == PWRDM_POWER_OFF);
				 (cx->mpu_logic_state == PWRDM_POWER_OFF);


	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id);
	tick_broadcast_enter();


	/*
	/*
	 * Call idle CPU PM enter notifier chain so that
	 * Call idle CPU PM enter notifier chain so that
@@ -169,7 +168,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
	if (dev->cpu == 0 && mpuss_can_lose_context)
	if (dev->cpu == 0 && mpuss_can_lose_context)
		cpu_cluster_pm_exit();
		cpu_cluster_pm_exit();


	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id);
	tick_broadcast_exit();


fail:
fail:
	cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
	cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
@@ -184,8 +183,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
 */
 */
static void omap_setup_broadcast_timer(void *arg)
static void omap_setup_broadcast_timer(void *arg)
{
{
	int cpu = smp_processor_id();
	tick_broadcast_enable();
	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
}
}


static struct cpuidle_driver omap4_idle_driver = {
static struct cpuidle_driver omap4_idle_driver = {
Loading