Commit 48b81880519274d2a8b3e9919a47d91d05a1c964
Committed by
Jonathan Corbet
1 parent
986f8b8ccf
Exists in
master
and in
20 other branches
hpet: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
drivers/char/hpet.c
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | #include <linux/interrupt.h> |
15 | 15 | #include <linux/module.h> |
16 | 16 | #include <linux/kernel.h> |
17 | +#include <linux/smp_lock.h> | |
17 | 18 | #include <linux/types.h> |
18 | 19 | #include <linux/miscdevice.h> |
19 | 20 | #include <linux/major.h> |
... | ... | @@ -193,6 +194,7 @@ |
193 | 194 | if (file->f_mode & FMODE_WRITE) |
194 | 195 | return -EINVAL; |
195 | 196 | |
197 | + lock_kernel(); | |
196 | 198 | spin_lock_irq(&hpet_lock); |
197 | 199 | |
198 | 200 | for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) |
... | ... | @@ -207,6 +209,7 @@ |
207 | 209 | |
208 | 210 | if (!devp) { |
209 | 211 | spin_unlock_irq(&hpet_lock); |
212 | + unlock_kernel(); | |
210 | 213 | return -EBUSY; |
211 | 214 | } |
212 | 215 | |
... | ... | @@ -214,6 +217,7 @@ |
214 | 217 | devp->hd_irqdata = 0; |
215 | 218 | devp->hd_flags |= HPET_OPEN; |
216 | 219 | spin_unlock_irq(&hpet_lock); |
220 | + unlock_kernel(); | |
217 | 221 | |
218 | 222 | return 0; |
219 | 223 | } |