From: Tomas Winkler Date: Tue, 13 Oct 2015 12:02:37 +0000 (+0300) Subject: mei: cancel driver workers only after client devices were removed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=97ccf63f42721e758bb3cd1aa8967a89d26ed0bb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mei: cancel driver workers only after client devices were removed 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index e374661652cd..3edafc8d3ad4 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c @@ -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);