i8253.c (7483d45f0aee3afc0646d185cabd4af9f6cab58c) | i8253.c (d6ad418763888f617ac5b4849823e4cd670df1dd) |
---|---|
1/* 2 * i8253 PIT clocksource 3 */ 4#include <linux/clockchips.h> 5#include <linux/init.h> 6#include <linux/io.h> 7#include <linux/spinlock.h> 8#include <linux/timex.h> --- 21 unchanged lines hidden (view full) --- 30 static int old_count; 31 static u32 old_jifs; 32 unsigned long flags; 33 int count; 34 u32 jifs; 35 36 raw_spin_lock_irqsave(&i8253_lock, flags); 37 /* | 1/* 2 * i8253 PIT clocksource 3 */ 4#include <linux/clockchips.h> 5#include <linux/init.h> 6#include <linux/io.h> 7#include <linux/spinlock.h> 8#include <linux/timex.h> --- 21 unchanged lines hidden (view full) --- 30 static int old_count; 31 static u32 old_jifs; 32 unsigned long flags; 33 int count; 34 u32 jifs; 35 36 raw_spin_lock_irqsave(&i8253_lock, flags); 37 /* |
38 * Although our caller may have the read side of xtime_lock, | 38 * Although our caller may have the read side of jiffies_lock, |
39 * this is now a seqlock, and we are cheating in this routine 40 * by having side effects on state that we cannot undo if 41 * there is a collision on the seqlock and our caller has to 42 * retry. (Namely, old_jifs and old_count.) So we must treat 43 * jiffies as volatile despite the lock. We read jiffies 44 * before latching the timer count to guarantee that although 45 * the jiffies value might be older than the count (that is, 46 * the counter may underflow between the last point where --- 140 unchanged lines hidden --- | 39 * this is now a seqlock, and we are cheating in this routine 40 * by having side effects on state that we cannot undo if 41 * there is a collision on the seqlock and our caller has to 42 * retry. (Namely, old_jifs and old_count.) So we must treat 43 * jiffies as volatile despite the lock. We read jiffies 44 * before latching the timer count to guarantee that although 45 * the jiffies value might be older than the count (that is, 46 * the counter may underflow between the last point where --- 140 unchanged lines hidden --- |