Don-t-try-to-flush-cache-on-reset.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From e4f737ba76eedeb9c924f46fe6a66520485b2bc6 Mon Sep 17 00:00:00 2001
  2. From: SolidHal <hal@halemmerich.com>
  3. Date: Mon, 22 Oct 2018 19:19:13 -0500
  4. Subject: [PATCH] Don't try to flush cache on reset
  5. A hardware reset is called for two situations. The first is on init
  6. and the second is if the driver encounters an error with the card.
  7. Flushing the cache when the emmc is already in a bad state causes a ~10
  8. minute long hang.
  9. Not only does the cache flush fail after
  10. a long hang, it causes a cmd write during the bus init in mmc_power_cycle
  11. to fail, leaving the card potentially incorrectly configured.
  12. The effects specifically the skHynix emmc with designware controller
  13. used in the c201 chromebook (veyron-speedy), but could causes issues
  14. with other emmcs as well.
  15. ---
  16. drivers/mmc/core/mmc.c | 6 ------
  17. 1 file changed, 6 deletions(-)
  18. diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
  19. index 6f8ebd6c..186cf61b 100644
  20. --- a/drivers/mmc/core/mmc.c
  21. +++ b/drivers/mmc/core/mmc.c
  22. @@ -2121,12 +2121,6 @@ static int mmc_reset(struct mmc_host *host)
  23. {
  24. struct mmc_card *card = host->card;
  25. - /*
  26. - * In the case of recovery, we can't expect flushing the cache to work
  27. - * always, but we have a go and ignore errors.
  28. - */
  29. - mmc_flush_cache(host->card);
  30. -
  31. if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset &&
  32. mmc_can_reset(card)) {
  33. /* If the card accept RST_n signal, send it. */
  34. --
  35. 2.11.0