mei: cancel driver workers only after client devices were removed
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 13 Oct 2015 12:02:37 +0000 (15:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 04:45:05 +0000 (21:45 -0700)
In process of client devices removal from the bus there still
might be communication between a driver and the mei device
hence we need to cancel supporting workers only after all
the client devices were removed.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/init.c

index e374661..3edafc8 100644 (file)
@@ -329,10 +329,10 @@ void mei_stop(struct mei_device *dev)
 {
        dev_dbg(dev->dev, "stopping the device.\n");
 
-       mei_cancel_work(dev);
-
        mei_cl_bus_remove_devices(dev);
 
+       mei_cancel_work(dev);
+
        mutex_lock(&dev->device_lock);
 
        mei_wd_stop(dev);