Commit 8daedea6 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

parport_pc locking fix

http://bugzilla.kernel.org/show_bug.cgi?id=8821 reports a might_sleep()
warning due to parport_pc_exit() running platform_device_unregister() while
holding ports_lock.

Just remove the locking: nobody else can access ports_list during module_exit.

Cc: "Mike Sharkey" <mike@pikeaero.com>
Cc: Tim Waugh <tim@cyberelk.net>
Cc: Stas Sergeev <stsp@aknet.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c21b37f6
...@@ -3445,7 +3445,6 @@ static void __exit parport_pc_exit(void) ...@@ -3445,7 +3445,6 @@ static void __exit parport_pc_exit(void)
pnp_unregister_driver (&parport_pc_pnp_driver); pnp_unregister_driver (&parport_pc_pnp_driver);
platform_driver_unregister(&parport_pc_platform_driver); platform_driver_unregister(&parport_pc_platform_driver);
spin_lock(&ports_lock);
while (!list_empty(&ports_list)) { while (!list_empty(&ports_list)) {
struct parport_pc_private *priv; struct parport_pc_private *priv;
struct parport *port; struct parport *port;
...@@ -3455,11 +3454,8 @@ static void __exit parport_pc_exit(void) ...@@ -3455,11 +3454,8 @@ static void __exit parport_pc_exit(void)
if (port->dev && port->dev->bus == &platform_bus_type) if (port->dev && port->dev->bus == &platform_bus_type)
platform_device_unregister( platform_device_unregister(
to_platform_device(port->dev)); to_platform_device(port->dev));
spin_unlock(&ports_lock);
parport_pc_unregister_port(port); parport_pc_unregister_port(port);
spin_lock(&ports_lock);
} }
spin_unlock(&ports_lock);
} }
MODULE_AUTHOR("Phil Blundell, Tim Waugh, others"); MODULE_AUTHOR("Phil Blundell, Tim Waugh, others");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment