Skip to content

Commit

Permalink
mei: init: Flush scheduled work before resetting the device
Browse files Browse the repository at this point in the history
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: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Samuel Ortiz authored and Greg Kroah-Hartman committed Jun 14, 2013
1 parent 317ddd2 commit 5e85b36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/mei/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ void mei_stop(struct mei_device *dev)
{
dev_dbg(&dev->pdev->dev, "stopping the device.\n");

flush_scheduled_work();

mutex_lock(&dev->device_lock);

cancel_delayed_work(&dev->timer_work);
Expand All @@ -210,8 +212,6 @@ void mei_stop(struct mei_device *dev)

mutex_unlock(&dev->device_lock);

flush_scheduled_work();

mei_watchdog_unregister(dev);
}
EXPORT_SYMBOL_GPL(mei_stop);
Expand Down

0 comments on commit 5e85b36

Please sign in to comment.