[PATCH 4.14 45/95] mmc: core: Do not leave the block driver in a suspended state

From: Greg Kroah-Hartman
Date: Mon Dec 04 2017 - 11:21:56 EST


4.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Adrian Hunter <adrian.hunter@xxxxxxxxx>

commit ebe7dd45cf49e3b49cacbaace17f9f878f21fbea upstream.

The block driver must be resumed if the mmc bus fails to suspend the card.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/mmc/core/bus.c | 3 +++
1 file changed, 3 insertions(+)

--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -157,6 +157,9 @@ static int mmc_bus_suspend(struct device
return ret;

ret = host->bus_ops->suspend(host);
+ if (ret)
+ pm_generic_resume(dev);
+
return ret;
}