dect
/
linux-2.6
Archived
13
0
Fork 0

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

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  time/clocksource: Fix kernel-doc warnings
  rtc: m41t80: Workaround broken alarm functionality
  rtc: Expire alarms after the time is set.
This commit is contained in:
Linus Torvalds 2011-12-20 11:42:38 -08:00
commit 5fbd305dd2
4 changed files with 32 additions and 6 deletions

View File

@ -73,6 +73,8 @@ int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
err = -EINVAL; err = -EINVAL;
mutex_unlock(&rtc->ops_lock); mutex_unlock(&rtc->ops_lock);
/* A timer might have just expired */
schedule_work(&rtc->irqwork);
return err; return err;
} }
EXPORT_SYMBOL_GPL(rtc_set_time); EXPORT_SYMBOL_GPL(rtc_set_time);
@ -112,6 +114,8 @@ int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs)
err = -EINVAL; err = -EINVAL;
mutex_unlock(&rtc->ops_lock); mutex_unlock(&rtc->ops_lock);
/* A timer might have just expired */
schedule_work(&rtc->irqwork);
return err; return err;
} }
@ -403,6 +407,8 @@ int rtc_initialize_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node); timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node);
} }
mutex_unlock(&rtc->ops_lock); mutex_unlock(&rtc->ops_lock);
/* maybe that was in the past.*/
schedule_work(&rtc->irqwork);
return err; return err;
} }
EXPORT_SYMBOL_GPL(rtc_initialize_alarm); EXPORT_SYMBOL_GPL(rtc_initialize_alarm);

View File

@ -357,10 +357,19 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t)
static struct rtc_class_ops m41t80_rtc_ops = { static struct rtc_class_ops m41t80_rtc_ops = {
.read_time = m41t80_rtc_read_time, .read_time = m41t80_rtc_read_time,
.set_time = m41t80_rtc_set_time, .set_time = m41t80_rtc_set_time,
/*
* XXX - m41t80 alarm functionality is reported broken.
* until it is fixed, don't register alarm functions.
*
.read_alarm = m41t80_rtc_read_alarm, .read_alarm = m41t80_rtc_read_alarm,
.set_alarm = m41t80_rtc_set_alarm, .set_alarm = m41t80_rtc_set_alarm,
*/
.proc = m41t80_rtc_proc, .proc = m41t80_rtc_proc,
/*
* See above comment on broken alarm
*
.alarm_irq_enable = m41t80_rtc_alarm_irq_enable, .alarm_irq_enable = m41t80_rtc_alarm_irq_enable,
*/
}; };
#if defined(CONFIG_RTC_INTF_SYSFS) || defined(CONFIG_RTC_INTF_SYSFS_MODULE) #if defined(CONFIG_RTC_INTF_SYSFS) || defined(CONFIG_RTC_INTF_SYSFS_MODULE)

View File

@ -71,7 +71,7 @@ struct timecounter {
/** /**
* cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds
* @tc: Pointer to cycle counter. * @cc: Pointer to cycle counter.
* @cycles: Cycles * @cycles: Cycles
* *
* XXX - This could use some mult_lxl_ll() asm optimization. Same code * XXX - This could use some mult_lxl_ll() asm optimization. Same code
@ -114,7 +114,7 @@ extern u64 timecounter_read(struct timecounter *tc);
* time base as values returned by * time base as values returned by
* timecounter_read() * timecounter_read()
* @tc: Pointer to time counter. * @tc: Pointer to time counter.
* @cycle: a value returned by tc->cc->read() * @cycle_tstamp: a value returned by tc->cc->read()
* *
* Cycle counts that are converted correctly as long as they * Cycle counts that are converted correctly as long as they
* fall into the interval [-1/2 max cycle count, +1/2 max cycle count], * fall into the interval [-1/2 max cycle count, +1/2 max cycle count],
@ -156,11 +156,12 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
* @mult: cycle to nanosecond multiplier * @mult: cycle to nanosecond multiplier
* @shift: cycle to nanosecond divisor (power of two) * @shift: cycle to nanosecond divisor (power of two)
* @max_idle_ns: max idle time permitted by the clocksource (nsecs) * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
* @maxadj maximum adjustment value to mult (~11%) * @maxadj: maximum adjustment value to mult (~11%)
* @flags: flags describing special properties * @flags: flags describing special properties
* @archdata: arch-specific data * @archdata: arch-specific data
* @suspend: suspend function for the clocksource, if necessary * @suspend: suspend function for the clocksource, if necessary
* @resume: resume function for the clocksource, if necessary * @resume: resume function for the clocksource, if necessary
* @cycle_last: most recent cycle counter value seen by ::read()
*/ */
struct clocksource { struct clocksource {
/* /*
@ -187,6 +188,7 @@ struct clocksource {
void (*suspend)(struct clocksource *cs); void (*suspend)(struct clocksource *cs);
void (*resume)(struct clocksource *cs); void (*resume)(struct clocksource *cs);
/* private: */
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG #ifdef CONFIG_CLOCKSOURCE_WATCHDOG
/* Watchdog related data, used by the framework */ /* Watchdog related data, used by the framework */
struct list_head wd_list; struct list_head wd_list;
@ -261,6 +263,9 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant)
/** /**
* clocksource_cyc2ns - converts clocksource cycles to nanoseconds * clocksource_cyc2ns - converts clocksource cycles to nanoseconds
* @cycles: cycles
* @mult: cycle to nanosecond multiplier
* @shift: cycle to nanosecond divisor (power of two)
* *
* Converts cycles to nanoseconds, using the given mult and shift. * Converts cycles to nanoseconds, using the given mult and shift.
* *

View File

@ -647,7 +647,7 @@ static void clocksource_enqueue(struct clocksource *cs)
/** /**
* __clocksource_updatefreq_scale - Used update clocksource with new freq * __clocksource_updatefreq_scale - Used update clocksource with new freq
* @t: clocksource to be registered * @cs: clocksource to be registered
* @scale: Scale factor multiplied against freq to get clocksource hz * @scale: Scale factor multiplied against freq to get clocksource hz
* @freq: clocksource frequency (cycles per second) divided by scale * @freq: clocksource frequency (cycles per second) divided by scale
* *
@ -699,7 +699,7 @@ EXPORT_SYMBOL_GPL(__clocksource_updatefreq_scale);
/** /**
* __clocksource_register_scale - Used to install new clocksources * __clocksource_register_scale - Used to install new clocksources
* @t: clocksource to be registered * @cs: clocksource to be registered
* @scale: Scale factor multiplied against freq to get clocksource hz * @scale: Scale factor multiplied against freq to get clocksource hz
* @freq: clocksource frequency (cycles per second) divided by scale * @freq: clocksource frequency (cycles per second) divided by scale
* *
@ -727,7 +727,7 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
/** /**
* clocksource_register - Used to install new clocksources * clocksource_register - Used to install new clocksources
* @t: clocksource to be registered * @cs: clocksource to be registered
* *
* Returns -EBUSY if registration fails, zero otherwise. * Returns -EBUSY if registration fails, zero otherwise.
*/ */
@ -761,6 +761,8 @@ static void __clocksource_change_rating(struct clocksource *cs, int rating)
/** /**
* clocksource_change_rating - Change the rating of a registered clocksource * clocksource_change_rating - Change the rating of a registered clocksource
* @cs: clocksource to be changed
* @rating: new rating
*/ */
void clocksource_change_rating(struct clocksource *cs, int rating) void clocksource_change_rating(struct clocksource *cs, int rating)
{ {
@ -772,6 +774,7 @@ EXPORT_SYMBOL(clocksource_change_rating);
/** /**
* clocksource_unregister - remove a registered clocksource * clocksource_unregister - remove a registered clocksource
* @cs: clocksource to be unregistered
*/ */
void clocksource_unregister(struct clocksource *cs) void clocksource_unregister(struct clocksource *cs)
{ {
@ -787,6 +790,7 @@ EXPORT_SYMBOL(clocksource_unregister);
/** /**
* sysfs_show_current_clocksources - sysfs interface for current clocksource * sysfs_show_current_clocksources - sysfs interface for current clocksource
* @dev: unused * @dev: unused
* @attr: unused
* @buf: char buffer to be filled with clocksource list * @buf: char buffer to be filled with clocksource list
* *
* Provides sysfs interface for listing current clocksource. * Provides sysfs interface for listing current clocksource.
@ -807,6 +811,7 @@ sysfs_show_current_clocksources(struct sys_device *dev,
/** /**
* sysfs_override_clocksource - interface for manually overriding clocksource * sysfs_override_clocksource - interface for manually overriding clocksource
* @dev: unused * @dev: unused
* @attr: unused
* @buf: name of override clocksource * @buf: name of override clocksource
* @count: length of buffer * @count: length of buffer
* *
@ -842,6 +847,7 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev,
/** /**
* sysfs_show_available_clocksources - sysfs interface for listing clocksource * sysfs_show_available_clocksources - sysfs interface for listing clocksource
* @dev: unused * @dev: unused
* @attr: unused
* @buf: char buffer to be filled with clocksource list * @buf: char buffer to be filled with clocksource list
* *
* Provides sysfs interface for listing registered clocksources * Provides sysfs interface for listing registered clocksources