From: Alexander Usyskin Date: Thu, 16 Jun 2016 14:58:52 +0000 (+0300) Subject: mei: recover after errors in runtime pm flow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=77537ad2917bbca0a73ee6ebd44fc0ce5416d590;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mei: recover after errors in runtime pm flow Schedule link reset if failed to perform runtime suspend or resume. Set active runtime pm stte on link reset to clean runtimr pm error, if present. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index e2fb44cc5c37..c2d70d2dd112 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c @@ -18,6 +18,7 @@ #include #include +#include #include "mei_dev.h" #include "hbm.h" @@ -1063,6 +1064,8 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable) } } + pm_runtime_set_active(dev->dev); + hcsr = mei_hcsr_read(dev); /* H_RST may be found lit before reset is started, * for example if preceding reset flow hasn't completed. diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c index 4a6c1b85f11e..e6e5e55a12ed 100644 --- a/drivers/misc/mei/hw-txe.c +++ b/drivers/misc/mei/hw-txe.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -935,6 +936,8 @@ static int mei_txe_hw_start(struct mei_device *dev) return ret; } + pm_runtime_set_active(dev->dev); + /* enable input ready interrupts: * SEC_IPC_HOST_INT_MASK.IPC_INPUT_READY_INT_MASK */ diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index 64e64da6da44..718addfa9fb0 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c @@ -400,6 +400,9 @@ static int mei_me_pm_runtime_suspend(struct device *device) dev_dbg(&pdev->dev, "rpm: me: runtime suspend ret=%d\n", ret); + if (ret && ret != -EAGAIN) + schedule_work(&dev->reset_work); + return ret; } @@ -423,6 +426,9 @@ static int mei_me_pm_runtime_resume(struct device *device) dev_dbg(&pdev->dev, "rpm: me: runtime resume ret = %d\n", ret); + if (ret) + schedule_work(&dev->reset_work); + return ret; } diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c index 30cc30683c07..58ffd30dcc91 100644 --- a/drivers/misc/mei/pci-txe.c +++ b/drivers/misc/mei/pci-txe.c @@ -347,6 +347,10 @@ static int mei_txe_pm_runtime_suspend(struct device *device) dev_dbg(&pdev->dev, "rpm: txe: runtime suspend ret=%d\n", ret); mutex_unlock(&dev->device_lock); + + if (ret && ret != -EAGAIN) + schedule_work(&dev->reset_work); + return ret; } @@ -372,6 +376,9 @@ static int mei_txe_pm_runtime_resume(struct device *device) dev_dbg(&pdev->dev, "rpm: txe: runtime resume ret = %d\n", ret); + if (ret) + schedule_work(&dev->reset_work); + return ret; }