aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-03-29 04:20:30 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-29 11:22:24 -0400
commit3076212f8d3d9fe4d7b11c6b560c0f424edfcb4e (patch)
treeebeeba622eedfcecb7a66fbbca3fe32c1b0c1ad1 /arch
parent602ed87ecd93a857dc687afb938d2c0f45552986 (diff)
[PATCH] uml: irq locking fixes
As the comment immediately preceding this points out, this list is changed in irq context, so it needs to be protected with spin_lock_irqsave in process context when it is processed. Sometimes, gcc should just compile the comments and forget the code. The IRQ side of this was better, in the sense that it blocked and unblocked interrupts, but it still should have saved and restored them. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/drivers/chan_kern.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 7b8baf146acc..9fdfad649536 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -236,11 +236,11 @@ void free_irqs(void)
236 struct chan *chan; 236 struct chan *chan;
237 LIST_HEAD(list); 237 LIST_HEAD(list);
238 struct list_head *ele; 238 struct list_head *ele;
239 unsigned long flags;
239 240
240 spin_lock_irq(&irqs_to_free_lock); 241 spin_lock_irqsave(&irqs_to_free_lock, flags);
241 list_splice_init(&irqs_to_free, &list); 242 list_splice_init(&irqs_to_free, &list);
242 INIT_LIST_HEAD(&irqs_to_free); 243 spin_unlock_irqrestore(&irqs_to_free_lock, flags);
243 spin_unlock_irq(&irqs_to_free_lock);
244 244
245 list_for_each(ele, &list){ 245 list_for_each(ele, &list){
246 chan = list_entry(ele, struct chan, free_list); 246 chan = list_entry(ele, struct chan, free_list);
@@ -255,13 +255,15 @@ void free_irqs(void)
255 255
256static void close_one_chan(struct chan *chan, int delay_free_irq) 256static void close_one_chan(struct chan *chan, int delay_free_irq)
257{ 257{
258 unsigned long flags;
259
258 if(!chan->opened) 260 if(!chan->opened)
259 return; 261 return;
260 262
261 if(delay_free_irq){ 263 if(delay_free_irq){
262 spin_lock_irq(&irqs_to_free_lock); 264 spin_lock_irqsave(&irqs_to_free_lock, flags);
263 list_add(&chan->free_list, &irqs_to_free); 265 list_add(&chan->free_list, &irqs_to_free);
264 spin_unlock_irq(&irqs_to_free_lock); 266 spin_unlock_irqrestore(&irqs_to_free_lock, flags);
265 } 267 }
266 else { 268 else {
267 if(chan->input) 269 if(chan->input)