Skip to content

Commit

Permalink
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/linux-2.6-tip

* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  lockdep: Reduce stack_trace usage
  lockdep: No need to disable preemption in debug atomic ops
  lockdep: Actually _dec_ in debug_atomic_dec
  lockdep: Provide off case for redundant_hardirqs_on increment
  lockdep: Simplify debug atomic ops
  lockdep: Fix redundant_hardirqs_on incremented with irqs enabled
  lockstat: Make lockstat counting per cpu
  i8253: Convert i8253_lock to raw_spinlock
  • Loading branch information
Linus Torvalds committed May 18, 2010
2 parents 8123d8f + 4726f2a commit 1014cfe
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 124 deletions.
2 changes: 1 addition & 1 deletion arch/mips/include/asm/i8253.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define PIT_CH0 0x40
#define PIT_CH2 0x42

extern spinlock_t i8253_lock;
extern raw_spinlock_t i8253_lock;

extern void setup_pit_timer(void);

Expand Down
14 changes: 7 additions & 7 deletions arch/mips/kernel/i8253.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <asm/io.h>
#include <asm/time.h>

DEFINE_SPINLOCK(i8253_lock);
DEFINE_RAW_SPINLOCK(i8253_lock);
EXPORT_SYMBOL(i8253_lock);

/*
Expand All @@ -26,7 +26,7 @@ EXPORT_SYMBOL(i8253_lock);
static void init_pit_timer(enum clock_event_mode mode,
struct clock_event_device *evt)
{
spin_lock(&i8253_lock);
raw_spin_lock(&i8253_lock);

switch(mode) {
case CLOCK_EVT_MODE_PERIODIC:
Expand Down Expand Up @@ -55,7 +55,7 @@ static void init_pit_timer(enum clock_event_mode mode,
/* Nothing to do here */
break;
}
spin_unlock(&i8253_lock);
raw_spin_unlock(&i8253_lock);
}

/*
Expand All @@ -65,10 +65,10 @@ static void init_pit_timer(enum clock_event_mode mode,
*/
static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
{
spin_lock(&i8253_lock);
raw_spin_lock(&i8253_lock);
outb_p(delta & 0xff , PIT_CH0); /* LSB */
outb(delta >> 8 , PIT_CH0); /* MSB */
spin_unlock(&i8253_lock);
raw_spin_unlock(&i8253_lock);

return 0;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ static cycle_t pit_read(struct clocksource *cs)
static int old_count;
static u32 old_jifs;

spin_lock_irqsave(&i8253_lock, flags);
raw_spin_lock_irqsave(&i8253_lock, flags);
/*
* Although our caller may have the read side of xtime_lock,
* this is now a seqlock, and we are cheating in this routine
Expand Down Expand Up @@ -183,7 +183,7 @@ static cycle_t pit_read(struct clocksource *cs)
old_count = count;
old_jifs = jifs;

spin_unlock_irqrestore(&i8253_lock, flags);
raw_spin_unlock_irqrestore(&i8253_lock, flags);

count = (LATCH - 1) - count;

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/i8253.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define PIT_CH0 0x40
#define PIT_CH2 0x42

extern spinlock_t i8253_lock;
extern raw_spinlock_t i8253_lock;

extern struct clock_event_device *global_clock_event;

Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/apm_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,15 +1224,15 @@ static void reinit_timer(void)
#ifdef INIT_TIMER_AFTER_SUSPEND
unsigned long flags;

spin_lock_irqsave(&i8253_lock, flags);
raw_spin_lock_irqsave(&i8253_lock, flags);
/* set the clock to HZ */
outb_pit(0x34, PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */
udelay(10);
outb_pit(LATCH & 0xff, PIT_CH0); /* LSB */
udelay(10);
outb_pit(LATCH >> 8, PIT_CH0); /* MSB */
udelay(10);
spin_unlock_irqrestore(&i8253_lock, flags);
raw_spin_unlock_irqrestore(&i8253_lock, flags);
#endif
}

Expand Down
14 changes: 7 additions & 7 deletions arch/x86/kernel/i8253.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <asm/hpet.h>
#include <asm/smp.h>

DEFINE_SPINLOCK(i8253_lock);
DEFINE_RAW_SPINLOCK(i8253_lock);
EXPORT_SYMBOL(i8253_lock);

/*
Expand All @@ -33,7 +33,7 @@ struct clock_event_device *global_clock_event;
static void init_pit_timer(enum clock_event_mode mode,
struct clock_event_device *evt)
{
spin_lock(&i8253_lock);
raw_spin_lock(&i8253_lock);

switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
Expand Down Expand Up @@ -62,7 +62,7 @@ static void init_pit_timer(enum clock_event_mode mode,
/* Nothing to do here */
break;
}
spin_unlock(&i8253_lock);
raw_spin_unlock(&i8253_lock);
}

/*
Expand All @@ -72,10 +72,10 @@ static void init_pit_timer(enum clock_event_mode mode,
*/
static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
{
spin_lock(&i8253_lock);
raw_spin_lock(&i8253_lock);
outb_pit(delta & 0xff , PIT_CH0); /* LSB */
outb_pit(delta >> 8 , PIT_CH0); /* MSB */
spin_unlock(&i8253_lock);
raw_spin_unlock(&i8253_lock);

return 0;
}
Expand Down Expand Up @@ -130,7 +130,7 @@ static cycle_t pit_read(struct clocksource *cs)
int count;
u32 jifs;

spin_lock_irqsave(&i8253_lock, flags);
raw_spin_lock_irqsave(&i8253_lock, flags);
/*
* Although our caller may have the read side of xtime_lock,
* this is now a seqlock, and we are cheating in this routine
Expand Down Expand Up @@ -176,7 +176,7 @@ static cycle_t pit_read(struct clocksource *cs)
old_count = count;
old_jifs = jifs;

spin_unlock_irqrestore(&i8253_lock, flags);
raw_spin_unlock_irqrestore(&i8253_lock, flags);

count = (LATCH - 1) - count;

Expand Down
4 changes: 2 additions & 2 deletions drivers/block/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ unsigned long read_timer(void)
unsigned long t, flags;
int i;

spin_lock_irqsave(&i8253_lock, flags);
raw_spin_lock_irqsave(&i8253_lock, flags);
t = jiffies * 11932;
outb_p(0, 0x43);
i = inb_p(0x40);
i |= inb(0x40) << 8;
spin_unlock_irqrestore(&i8253_lock, flags);
raw_spin_unlock_irqrestore(&i8253_lock, flags);
return(t - i);
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/gameport/gameport.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ static unsigned int get_time_pit(void)
unsigned long flags;
unsigned int count;

spin_lock_irqsave(&i8253_lock, flags);
raw_spin_lock_irqsave(&i8253_lock, flags);
outb_p(0x00, 0x43);
count = inb_p(0x40);
count |= inb_p(0x40) << 8;
spin_unlock_irqrestore(&i8253_lock, flags);
raw_spin_unlock_irqrestore(&i8253_lock, flags);

return count;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/joystick/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ static unsigned int get_time_pit(void)
unsigned long flags;
unsigned int count;

spin_lock_irqsave(&i8253_lock, flags);
raw_spin_lock_irqsave(&i8253_lock, flags);
outb_p(0x00, 0x43);
count = inb_p(0x40);
count |= inb_p(0x40) << 8;
spin_unlock_irqrestore(&i8253_lock, flags);
raw_spin_unlock_irqrestore(&i8253_lock, flags);

return count;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/misc/pcspkr.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MODULE_ALIAS("platform:pcspkr");
#include <asm/i8253.h>
#else
#include <asm/8253pit.h>
static DEFINE_SPINLOCK(i8253_lock);
static DEFINE_RAW_SPINLOCK(i8253_lock);
#endif

static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
Expand All @@ -50,7 +50,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
if (value > 20 && value < 32767)
count = PIT_TICK_RATE / value;

spin_lock_irqsave(&i8253_lock, flags);
raw_spin_lock_irqsave(&i8253_lock, flags);

if (count) {
/* set command for counter 2, 2 byte write */
Expand All @@ -65,7 +65,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
outb(inb_p(0x61) & 0xFC, 0x61);
}

spin_unlock_irqrestore(&i8253_lock, flags);
raw_spin_unlock_irqrestore(&i8253_lock, flags);

return 0;
}
Expand Down
Loading

0 comments on commit 1014cfe

Please sign in to comment.