diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-02-17 11:47:10 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-03-02 04:28:38 -0500 |
commit | ced918eb748ce30b3aace549fd17540e40ffdca0 (patch) | |
tree | f7c194d56e799508e090ef016bfc2dc0152a4244 /sound/drivers/pcsp | |
parent | 13dda80e48439b446d0bc9bab34b91484bc8f533 (diff) |
i8253: Convert i8253_lock to raw_spinlock
i8253_lock needs to be a real spinlock in preempt-rt, i.e. it can
not be converted to a sleeping lock.
Convert it to raw_spinlock and fix up all users.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: Jens Axboe <jens.axboe@oracle.com>
LKML-Reference: <20100217163751.030764372@linutronix.de>
Diffstat (limited to 'sound/drivers/pcsp')
-rw-r--r-- | sound/drivers/pcsp/pcsp.h | 2 | ||||
-rw-r--r-- | sound/drivers/pcsp/pcsp_input.c | 4 | ||||
-rw-r--r-- | sound/drivers/pcsp/pcsp_lib.c | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sound/drivers/pcsp/pcsp.h b/sound/drivers/pcsp/pcsp.h index 1e123077923d..4ff6c8cc5077 100644 --- a/sound/drivers/pcsp/pcsp.h +++ b/sound/drivers/pcsp/pcsp.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <asm/i8253.h> | 16 | #include <asm/i8253.h> |
17 | #else | 17 | #else |
18 | #include <asm/8253pit.h> | 18 | #include <asm/8253pit.h> |
19 | static DEFINE_SPINLOCK(i8253_lock); | 19 | static DEFINE_RAW_SPINLOCK(i8253_lock); |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #define PCSP_SOUND_VERSION 0x400 /* read 4.00 */ | 22 | #define PCSP_SOUND_VERSION 0x400 /* read 4.00 */ |
diff --git a/sound/drivers/pcsp/pcsp_input.c b/sound/drivers/pcsp/pcsp_input.c index 0444cdeb4bec..b5e2b54c2604 100644 --- a/sound/drivers/pcsp/pcsp_input.c +++ b/sound/drivers/pcsp/pcsp_input.c | |||
@@ -21,7 +21,7 @@ static void pcspkr_do_sound(unsigned int count) | |||
21 | { | 21 | { |
22 | unsigned long flags; | 22 | unsigned long flags; |
23 | 23 | ||
24 | spin_lock_irqsave(&i8253_lock, flags); | 24 | raw_spin_lock_irqsave(&i8253_lock, flags); |
25 | 25 | ||
26 | if (count) { | 26 | if (count) { |
27 | /* set command for counter 2, 2 byte write */ | 27 | /* set command for counter 2, 2 byte write */ |
@@ -36,7 +36,7 @@ static void pcspkr_do_sound(unsigned int count) | |||
36 | outb(inb_p(0x61) & 0xFC, 0x61); | 36 | outb(inb_p(0x61) & 0xFC, 0x61); |
37 | } | 37 | } |
38 | 38 | ||
39 | spin_unlock_irqrestore(&i8253_lock, flags); | 39 | raw_spin_unlock_irqrestore(&i8253_lock, flags); |
40 | } | 40 | } |
41 | 41 | ||
42 | void pcspkr_stop_sound(void) | 42 | void pcspkr_stop_sound(void) |
diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c index e1145ac6e908..f6a2e72b8cde 100644 --- a/sound/drivers/pcsp/pcsp_lib.c +++ b/sound/drivers/pcsp/pcsp_lib.c | |||
@@ -65,7 +65,7 @@ static u64 pcsp_timer_update(struct snd_pcsp *chip) | |||
65 | timer_cnt = val * CUR_DIV() / 256; | 65 | timer_cnt = val * CUR_DIV() / 256; |
66 | 66 | ||
67 | if (timer_cnt && chip->enable) { | 67 | if (timer_cnt && chip->enable) { |
68 | spin_lock_irqsave(&i8253_lock, flags); | 68 | raw_spin_lock_irqsave(&i8253_lock, flags); |
69 | if (!nforce_wa) { | 69 | if (!nforce_wa) { |
70 | outb_p(chip->val61, 0x61); | 70 | outb_p(chip->val61, 0x61); |
71 | outb_p(timer_cnt, 0x42); | 71 | outb_p(timer_cnt, 0x42); |
@@ -74,7 +74,7 @@ static u64 pcsp_timer_update(struct snd_pcsp *chip) | |||
74 | outb(chip->val61 ^ 2, 0x61); | 74 | outb(chip->val61 ^ 2, 0x61); |
75 | chip->thalf = 1; | 75 | chip->thalf = 1; |
76 | } | 76 | } |
77 | spin_unlock_irqrestore(&i8253_lock, flags); | 77 | raw_spin_unlock_irqrestore(&i8253_lock, flags); |
78 | } | 78 | } |
79 | 79 | ||
80 | chip->ns_rem = PCSP_PERIOD_NS(); | 80 | chip->ns_rem = PCSP_PERIOD_NS(); |
@@ -158,10 +158,10 @@ static int pcsp_start_playing(struct snd_pcsp *chip) | |||
158 | return -EIO; | 158 | return -EIO; |
159 | } | 159 | } |
160 | 160 | ||
161 | spin_lock(&i8253_lock); | 161 | raw_spin_lock(&i8253_lock); |
162 | chip->val61 = inb(0x61) | 0x03; | 162 | chip->val61 = inb(0x61) | 0x03; |
163 | outb_p(0x92, 0x43); /* binary, mode 1, LSB only, ch 2 */ | 163 | outb_p(0x92, 0x43); /* binary, mode 1, LSB only, ch 2 */ |
164 | spin_unlock(&i8253_lock); | 164 | raw_spin_unlock(&i8253_lock); |
165 | atomic_set(&chip->timer_active, 1); | 165 | atomic_set(&chip->timer_active, 1); |
166 | chip->thalf = 0; | 166 | chip->thalf = 0; |
167 | 167 | ||
@@ -178,11 +178,11 @@ static void pcsp_stop_playing(struct snd_pcsp *chip) | |||
178 | return; | 178 | return; |
179 | 179 | ||
180 | atomic_set(&chip->timer_active, 0); | 180 | atomic_set(&chip->timer_active, 0); |
181 | spin_lock(&i8253_lock); | 181 | raw_spin_lock(&i8253_lock); |
182 | /* restore the timer */ | 182 | /* restore the timer */ |
183 | outb_p(0xb6, 0x43); /* binary, mode 3, LSB/MSB, ch 2 */ | 183 | outb_p(0xb6, 0x43); /* binary, mode 3, LSB/MSB, ch 2 */ |
184 | outb(chip->val61 & 0xFC, 0x61); | 184 | outb(chip->val61 & 0xFC, 0x61); |
185 | spin_unlock(&i8253_lock); | 185 | raw_spin_unlock(&i8253_lock); |
186 | } | 186 | } |
187 | 187 | ||
188 | /* | 188 | /* |