summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiba Prasad <sibap@codeaurora.org>2016-12-05 18:29:39 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-21 20:49:30 -0700
commit6a0ce2763316934cd0e1aafeb6c2d51628892ecb (patch)
tree76c8e05046b968d7e99d1bf51cdd32f0e1220a66
parent16b7aeeeaafdd65224454d66bffa56f7c190e27c (diff)
mmc: bus: Handle error in case bus_ops suspend fails
bus_ops->suspend may fail due to some reason (for e.g. due to flush timeout). In such cases, if we return error to PM framework from here without calling pm_generic_resume then mmc request may get stuck since PM framework will assume that mmc bus not suspended (because of error) and it won't call resume again. Thus fix this by calling pm_generic_resume in case of error from bus_ops->suspend in mmc_bus_suspend. Change-Id: Iaef485d0b47b005aa88e61cd77a2b7b65931def1 Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org> Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org> Signed-off-by: Siba Prasad <sibap@codeaurora.org>
-rw-r--r--drivers/mmc/core/bus.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 8101b77c2acf..ec6075ec5767 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -167,6 +167,19 @@ static int mmc_bus_suspend(struct device *dev)
if (mmc_bus_needs_resume(host))
return 0;
ret = host->bus_ops->suspend(host);
+
+ /*
+ * bus_ops->suspend may fail due to some reason
+ * In such cases if we return error to PM framework
+ * from here without calling pm_generic_resume then mmc
+ * request may get stuck since PM framework will assume
+ * that mmc bus is not suspended (because of error) and
+ * it won't call resume again.
+ *
+ * So in case of error call pm_generic_resume().
+ */
+ if (ret)
+ pm_generic_resume(dev);
return ret;
}