diff options
| author | David S. Miller <davem@davemloft.net> | 2009-08-12 17:44:53 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-08-12 17:44:53 -0700 |
| commit | aa11d958d1a6572eda08214d7c6a735804fe48a5 (patch) | |
| tree | d025b05270ad1e010660d17eeadc6ac3c1abbd7d /include/linux/clocksource.h | |
| parent | 07f6642ee9418e962e54cbc07471cfe2e559c568 (diff) | |
| parent | 9799218ae36910af50f002a5db1802d576fffb43 (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
arch/microblaze/include/asm/socket.h
Diffstat (limited to 'include/linux/clocksource.h')
| -rw-r--r-- | include/linux/clocksource.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index c56457c8334e..1219be4fb42e 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -293,7 +293,12 @@ static inline int clocksource_enable(struct clocksource *cs) if (cs->enable) ret = cs->enable(cs); - /* save mult_orig on enable */ + /* + * The frequency may have changed while the clocksource + * was disabled. If so the code in ->enable() must update + * the mult value to reflect the new frequency. Make sure + * mult_orig follows this change. + */ cs->mult_orig = cs->mult; return ret; @@ -309,6 +314,13 @@ static inline int clocksource_enable(struct clocksource *cs) */ static inline void clocksource_disable(struct clocksource *cs) { + /* + * Save mult_orig in mult so clocksource_enable() can + * restore the value regardless if ->enable() updates + * the value of mult or not. + */ + cs->mult = cs->mult_orig; + if (cs->disable) cs->disable(cs); } |
