Skip to content

Commit 7ae079a

Browse files
Tomas Winklergregkh
authored andcommitted
mei: set device client to the disconnected state upon suspend.
This fixes regression introduced by commit 8d52af6 ("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: 8d52af6 ("mei: speed up the power down flow") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5eeb2ca commit 7ae079a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎drivers/misc/mei/bus.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,12 +548,6 @@ int mei_cldev_disable(struct mei_cl_device *cldev)
548548
goto out;
549549
}
550550

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-
557551
err = mei_cl_disconnect(cl);
558552
if (err < 0)
559553
dev_err(bus->dev, "Could not disconnect from the ME client\n");

‎drivers/misc/mei/client.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,12 @@ int mei_cl_disconnect(struct mei_cl *cl)
945945
return 0;
946946
}
947947

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+
948954
rets = pm_runtime_get(dev->dev);
949955
if (rets < 0 && rets != -EINPROGRESS) {
950956
pm_runtime_put_noidle(dev->dev);

0 commit comments

Comments
 (0)