@@ -795,6 +795,9 @@ static void calculate_clk_divider(struct mmc_host *mmc, struct mmc_ios *ios)
}
}
+static void
+davinci_abort_data(struct mmc_davinci_host *host, struct mmc_data *data);
+
static void mmc_davinci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct mmc_davinci_host *host = mmc_priv(mmc);
@@ -856,9 +859,14 @@ static void mmc_davinci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
}
if (lose)
dev_warn(mmc_dev(host->mmc), "powerup timeout\n");
- }
- /* FIXME on power OFF, reset things ... */
+ } else if (ios->power_mode == MMC_POWER_OFF) {
+
+ /* Controller maybe in bad state, e.g. card pulled while writing */
+ davinci_abort_data(host, NULL);
+
+ /* FIXME on power OFF, reset more things ...? */
+ }
}
static void