Commit 7ae079ac authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: set device client to the disconnected state upon suspend.

This fixes regression introduced by
commit 8d52af67 ("mei: speed up the power down flow")

In mei_cldev_disable during device power down flow, such as
suspend or system power off, it jumps over disconnecting function
to speed up the power down process, however, because the client is
unlinked from the file_list (mei_cl_unlink) mei_cl_set_disconnected
is not called from mei_cl_all_disconnect leaving resource leaking.
The most visible is reference counter on underlying HW module is
not decreased preventing to remove modules after suspend/resume cycles.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Fixes: 8d52af67 ("mei: speed up the power down flow")
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5eeb2ca0
...@@ -548,12 +548,6 @@ int mei_cldev_disable(struct mei_cl_device *cldev) ...@@ -548,12 +548,6 @@ int mei_cldev_disable(struct mei_cl_device *cldev)
goto out; goto out;
} }
if (bus->dev_state == MEI_DEV_POWER_DOWN) {
dev_dbg(bus->dev, "Device is powering down, don't bother with disconnection\n");
err = 0;
goto out;
}
err = mei_cl_disconnect(cl); err = mei_cl_disconnect(cl);
if (err < 0) if (err < 0)
dev_err(bus->dev, "Could not disconnect from the ME client\n"); dev_err(bus->dev, "Could not disconnect from the ME client\n");
......
...@@ -945,6 +945,12 @@ int mei_cl_disconnect(struct mei_cl *cl) ...@@ -945,6 +945,12 @@ int mei_cl_disconnect(struct mei_cl *cl)
return 0; return 0;
} }
if (dev->dev_state == MEI_DEV_POWER_DOWN) {
cl_dbg(dev, cl, "Device is powering down, don't bother with disconnection\n");
mei_cl_set_disconnected(cl);
return 0;
}
rets = pm_runtime_get(dev->dev); rets = pm_runtime_get(dev->dev);
if (rets < 0 && rets != -EINPROGRESS) { if (rets < 0 && rets != -EINPROGRESS) {
pm_runtime_put_noidle(dev->dev); pm_runtime_put_noidle(dev->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment