Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47444
b: refs/heads/master
c: 190c3e4
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 11, 2007
1 parent c6afa2c commit e6baff0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 894be2a485b75bce9a4d45d3e431aafd4c89f1ea
refs/heads/master: 190c3e456325942a17785332fe15b68eeb3775ca
21 changes: 18 additions & 3 deletions trunk/arch/um/drivers/chan_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,28 @@ void enable_chan(struct line *line)
}
}

/* Items are added in IRQ context, when free_irq can't be called, and
* removed in process context, when it can.
* This handles interrupt sources which disappear, and which need to
* be permanently disabled. This is discovered in IRQ context, but
* the freeing of the IRQ must be done later.
*/
static DEFINE_SPINLOCK(irqs_to_free_lock);
static LIST_HEAD(irqs_to_free);

void free_irqs(void)
{
struct chan *chan;
LIST_HEAD(list);
struct list_head *ele;

spin_lock_irq(&irqs_to_free_lock);
list_splice_init(&irqs_to_free, &list);
INIT_LIST_HEAD(&irqs_to_free);
spin_unlock_irq(&irqs_to_free_lock);

while(!list_empty(&irqs_to_free)){
chan = list_entry(irqs_to_free.next, struct chan, free_list);
list_del(&chan->free_list);
list_for_each(ele, &list){
chan = list_entry(ele, struct chan, free_list);

if(chan->input)
free_irq(chan->line->driver->read_irq, chan);
Expand All @@ -246,7 +259,9 @@ static void close_one_chan(struct chan *chan, int delay_free_irq)
return;

if(delay_free_irq){
spin_lock_irq(&irqs_to_free_lock);
list_add(&chan->free_list, &irqs_to_free);
spin_unlock_irq(&irqs_to_free_lock);
}
else {
if(chan->input)
Expand Down

0 comments on commit e6baff0

Please sign in to comment.