Skip to content

Commit

Permalink
parport: make lockdep happy with waitlist_lock
Browse files Browse the repository at this point in the history
parport_unregister_device() should never be used when interrupts are
enabled in hardware and irq handler is registered so there is no need to
disable interrupts when using waitlist_lock.  But there is no way to
explain this subtle semantics to lockdep analyzer.

So disable interrupts here too to simplify things.  The price is
negligible.

Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Alexander Gordeev authored and Linus Torvalds committed Jan 26, 2011
1 parent 0766d20 commit cbeb4b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/parport/share.c
Original file line number Diff line number Diff line change
@@ -678,7 +678,7 @@ void parport_unregister_device(struct pardevice *dev)

/* Make sure we haven't left any pointers around in the wait
* list. */
spin_lock (&port->waitlist_lock);
spin_lock_irq(&port->waitlist_lock);
if (dev->waitprev || dev->waitnext || port->waithead == dev) {
if (dev->waitprev)
dev->waitprev->waitnext = dev->waitnext;
@@ -689,7 +689,7 @@ void parport_unregister_device(struct pardevice *dev)
else
port->waittail = dev->waitprev;
}
spin_unlock (&port->waitlist_lock);
spin_unlock_irq(&port->waitlist_lock);

kfree(dev->state);
kfree(dev);

0 comments on commit cbeb4b7

Please sign in to comment.