]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mei: request async autosuspend at the end of enumeration
authorAlexander Usyskin <alexander.usyskin@intel.com>
Thu, 24 Nov 2016 11:34:02 +0000 (13:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2016 19:15:30 +0000 (20:15 +0100)
pm_runtime_autosuspend can take synchronous or asynchronous
paths, Because we are calling pm_runtime_mark_last_busy just before
this most of the cases it takes the asynchronous way. However,
when the FW or driver resets during already running runtime suspend,
the call will result in calling to the driver's rpm callback and results
in a deadlock on device_lock.
The simplest fix is to replace pm_runtime_autosuspend with
asynchronous pm_request_autosuspend.

Cc: <stable@vger.kernel.org> # 4.4+
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c

index 9635b14b6011346f0c819147b1071c72d85025d5..391936c1aa041c5bd925d284aa593e65b5ce1065 100644 (file)
@@ -691,7 +691,7 @@ void mei_host_client_init(struct mei_device *dev)
 
        pm_runtime_mark_last_busy(dev->dev);
        dev_dbg(dev->dev, "rpm: autosuspend\n");
-       pm_runtime_autosuspend(dev->dev);
+       pm_request_autosuspend(dev->dev);
 }
 
 /**