diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2017-12-12 12:27:06 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-13 14:10:47 +0100 |
commit | 8d52af6795c0480a20272159103976a893603fde (patch) | |
tree | 90d5c6b664176a0b7e382ddf015009be2dc23551 /drivers/misc/mei/init.c | |
parent | Merge 4.15-rc3 into char-misc-next (diff) | |
download | linux-8d52af6795c0480a20272159103976a893603fde.tar.xz linux-8d52af6795c0480a20272159103976a893603fde.zip |
mei: speed up the power down flow
When mei driver is powering down due to suspend or shutdown
it will iterate over the mei client bus and disconnect
each client device attached in turn.
The power down flow consist of the link rest, which causes all clients
get disconnected at once, hence the individual disconnection
can be omitted and significantly reduce power down flow.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r-- | drivers/misc/mei/init.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index d2f691424dd1..c46f6e99a55e 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c @@ -310,6 +310,9 @@ void mei_stop(struct mei_device *dev) { dev_dbg(dev->dev, "stopping the device.\n"); + mutex_lock(&dev->device_lock); + dev->dev_state = MEI_DEV_POWER_DOWN; + mutex_unlock(&dev->device_lock); mei_cl_bus_remove_devices(dev); mei_cancel_work(dev); @@ -319,7 +322,6 @@ void mei_stop(struct mei_device *dev) mutex_lock(&dev->device_lock); - dev->dev_state = MEI_DEV_POWER_DOWN; mei_reset(dev); /* move device to disabled state unconditionally */ dev->dev_state = MEI_DEV_DISABLED; |