Added-a-second-reset-when-having-an-issue-reading-th.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 30914ed56a766f15162c3bf106797a45857d98f1 Mon Sep 17 00:00:00 2001
  2. From: SolidHal <hal@halemmerich.com>
  3. Date: Sun, 21 Oct 2018 16:40:15 -0500
  4. Subject: [PATCH] Added a second reset when having an issue reading the emmc.
  5. The c201 emmc can be... touchy. Sometimes one full reset isn't
  6. enough to get it into a wokring state if it found it's way into
  7. a really bad state. Note that in my testing WITHOUT this patch,
  8. this only happens about once in just over 1600 reboots.
  9. Signed-off-by: SolidHal <hal@halemmerich.com>
  10. ---
  11. drivers/mmc/core/block.c | 5 +++++
  12. 1 file changed, 5 insertions(+)
  13. diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
  14. index 5bc585e8..39e16e48 100644
  15. --- a/drivers/mmc/core/block.c
  16. +++ b/drivers/mmc/core/block.c
  17. @@ -1033,6 +1033,7 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host,
  18. return -EEXIST;
  19. }
  20. md->reset_done |= type;
  21. +retry:
  22. err = mmc_hw_reset(host);
  23. /* Ensure we switch back to the correct partition */
  24. if (err != -EOPNOTSUPP) {
  25. @@ -1050,6 +1051,10 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host,
  26. return -ENODEV;
  27. }
  28. }
  29. + if (err){
  30. + /* Try one last time, just in case. The emmc can be touchy */
  31. + goto retry;
  32. + }
  33. return err;
  34. }
  35. --
  36. 2.11.0