Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72232
b: refs/heads/master
c: a98ce5c
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and Linus Torvalds committed Oct 23, 2007
1 parent 6856c2b commit 2f4ac6d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 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: 48d2268473a66fe3aa78fb13b09ee59d6ee95073
refs/heads/master: a98ce5c6feead6bfedefabd46cb3d7f5be148d9a
20 changes: 18 additions & 2 deletions trunk/kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,28 @@
void synchronize_irq(unsigned int irq)
{
struct irq_desc *desc = irq_desc + irq;
unsigned int status;

if (irq >= NR_IRQS)
return;

while (desc->status & IRQ_INPROGRESS)
cpu_relax();
do {
unsigned long flags;

/*
* Wait until we're out of the critical section. This might
* give the wrong answer due to the lack of memory barriers.
*/
while (desc->status & IRQ_INPROGRESS)
cpu_relax();

/* Ok, that indicated we're done: double-check carefully. */
spin_lock_irqsave(&desc->lock, flags);
status = desc->status;
spin_unlock_irqrestore(&desc->lock, flags);

/* Oops, that failed? */
} while (status & IRQ_INPROGRESS);
}
EXPORT_SYMBOL(synchronize_irq);

Expand Down

0 comments on commit 2f4ac6d

Please sign in to comment.