Commit ac43a0cb5bc8e61b5b785d27c0b0cf53d5b16e16

Authored by Priyanka Jain
1 parent dcb1f291f2

Revert "mmc: move mmc_power_cycle() after controller initialization"

This reverts commit db5e48bab9ef90b05da8c4ad396a9a959506b2fe.
The changes needs rework to work on i.mx devices
LFU-40

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>

Showing 1 changed file with 16 additions and 15 deletions Side-by-side Diff

... ... @@ -2771,6 +2771,21 @@
2771 2771 MMC_QUIRK_RETRY_APP_CMD;
2772 2772 #endif
2773 2773  
  2774 + err = mmc_power_cycle(mmc);
  2775 + if (err) {
  2776 + /*
  2777 + * if power cycling is not supported, we should not try
  2778 + * to use the UHS modes, because we wouldn't be able to
  2779 + * recover from an error during the UHS initialization.
  2780 + */
  2781 + pr_debug("Unable to do a full power cycle. Disabling the UHS modes for safety\n");
  2782 + uhs_en = false;
  2783 + mmc->host_caps &= ~UHS_CAPS;
  2784 + err = mmc_power_on(mmc);
  2785 + }
  2786 + if (err)
  2787 + return err;
  2788 +
2774 2789 #if CONFIG_IS_ENABLED(DM_MMC)
2775 2790 /*
2776 2791 * Re-initialization is needed to clear old configuration for
... ... @@ -2788,21 +2803,6 @@
2788 2803 retry:
2789 2804 mmc_set_initial_state(mmc);
2790 2805  
2791   - err = mmc_power_cycle(mmc);
2792   - if (err) {
2793   - /*
2794   - * if power cycling is not supported, we should not try
2795   - * to use the UHS modes, because we wouldn't be able to
2796   - * recover from an error during the UHS initialization.
2797   - */
2798   - pr_debug("Unable to do a full power cycle. Disabling the UHS modes for safety\n");
2799   - uhs_en = false;
2800   - mmc->host_caps &= ~UHS_CAPS;
2801   - err = mmc_power_on(mmc);
2802   - }
2803   - if (err)
2804   - return err;
2805   -
2806 2806 /* Reset the Card */
2807 2807 err = mmc_go_idle(mmc);
2808 2808  
... ... @@ -2819,6 +2819,7 @@
2819 2819 err = sd_send_op_cond(mmc, uhs_en);
2820 2820 if (err && uhs_en) {
2821 2821 uhs_en = false;
  2822 + mmc_power_cycle(mmc);
2822 2823 goto retry;
2823 2824 }
2824 2825