Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbeb4b7a authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Linus Torvalds
Browse files

parport: make lockdep happy with waitlist_lock



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: default avatarAlexander Gordeev <lasaine@lvk.cs.msu.su>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0766d20f
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -678,7 +678,7 @@ void parport_unregister_device(struct pardevice *dev)


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


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