aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2018-02-14 07:03:29 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-16 05:16:40 -0500
commit7ae079aca59f560d2a44b65d45dffdefed6bd17a (patch)
treeda52ccdb36fe46a16520357d6880d0adcab3e684
parent5eeb2ca02a2f6084fc57ae5c244a38baab07033a (diff)
mei: set device client to the disconnected state upon suspend.
This fixes regression introduced by commit 8d52af6795c0 ("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: Tomas Winkler <tomas.winkler@intel.com> Fixes: 8d52af6795c0 ("mei: speed up the power down flow") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/mei/bus.c6
-rw-r--r--drivers/misc/mei/client.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 3e5eabdae8d9..772d02922529 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -548,12 +548,6 @@ int mei_cldev_disable(struct mei_cl_device *cldev)
548 goto out; 548 goto out;
549 } 549 }
550 550
551 if (bus->dev_state == MEI_DEV_POWER_DOWN) {
552 dev_dbg(bus->dev, "Device is powering down, don't bother with disconnection\n");
553 err = 0;
554 goto out;
555 }
556
557 err = mei_cl_disconnect(cl); 551 err = mei_cl_disconnect(cl);
558 if (err < 0) 552 if (err < 0)
559 dev_err(bus->dev, "Could not disconnect from the ME client\n"); 553 dev_err(bus->dev, "Could not disconnect from the ME client\n");
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index be64969d986a..7e60c1817c31 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -945,6 +945,12 @@ int mei_cl_disconnect(struct mei_cl *cl)
945 return 0; 945 return 0;
946 } 946 }
947 947
948 if (dev->dev_state == MEI_DEV_POWER_DOWN) {
949 cl_dbg(dev, cl, "Device is powering down, don't bother with disconnection\n");
950 mei_cl_set_disconnected(cl);
951 return 0;
952 }
953
948 rets = pm_runtime_get(dev->dev); 954 rets = pm_runtime_get(dev->dev);
949 if (rets < 0 && rets != -EINPROGRESS) { 955 if (rets < 0 && rets != -EINPROGRESS) {
950 pm_runtime_put_noidle(dev->dev); 956 pm_runtime_put_noidle(dev->dev);