提交 5e85b364 编写于 作者: S Samuel Ortiz 提交者: Greg Kroah-Hartman

mei: init: Flush scheduled work before resetting the device

Flushing pending work items before resetting the device makes more
sense than doing so afterwards. Some of them, like e.g. the NFC
initialization one, find themselves with client IDs changed after
the reset, eventually leading to trigger a client.c:mei_me_cl_by_id()
warning after a few modprobe/rmmod cycles.
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 317ddd25
...@@ -197,6 +197,8 @@ void mei_stop(struct mei_device *dev) ...@@ -197,6 +197,8 @@ void mei_stop(struct mei_device *dev)
{ {
dev_dbg(&dev->pdev->dev, "stopping the device.\n"); dev_dbg(&dev->pdev->dev, "stopping the device.\n");
flush_scheduled_work();
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
cancel_delayed_work(&dev->timer_work); cancel_delayed_work(&dev->timer_work);
...@@ -210,8 +212,6 @@ void mei_stop(struct mei_device *dev) ...@@ -210,8 +212,6 @@ void mei_stop(struct mei_device *dev)
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
flush_scheduled_work();
mei_watchdog_unregister(dev); mei_watchdog_unregister(dev);
} }
EXPORT_SYMBOL_GPL(mei_stop); EXPORT_SYMBOL_GPL(mei_stop);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册