Commit 4b7a89a3c1cf545b03470416aa821fc2ff826b91
Committed by
Dominik Brodowski
1 parent
6bb1c39a43
Exists in
master
and in
4 other branches
[PATCH] pcmcia: fix deadlock in pcmcia_parse_events
The PCMCIA layer calls pcmcia_parse_events both from user context and IRQ context; the lock thus needs to be irqsave to avoid deadlocks Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
drivers/pcmcia/cs.c
| ... | ... | @@ -699,11 +699,12 @@ |
| 699 | 699 | */ |
| 700 | 700 | void pcmcia_parse_events(struct pcmcia_socket *s, u_int events) |
| 701 | 701 | { |
| 702 | + unsigned long flags; | |
| 702 | 703 | cs_dbg(s, 4, "parse_events: events %08x\n", events); |
| 703 | 704 | if (s->thread) { |
| 704 | - spin_lock(&s->thread_lock); | |
| 705 | + spin_lock_irqsave(&s->thread_lock, flags); | |
| 705 | 706 | s->thread_events |= events; |
| 706 | - spin_unlock(&s->thread_lock); | |
| 707 | + spin_unlock_irqrestore(&s->thread_lock, flags); | |
| 707 | 708 | |
| 708 | 709 | wake_up(&s->thread_wait); |
| 709 | 710 | } |