Loading drivers/mmc/core/core.c +11 −6 Original line number Diff line number Diff line Loading @@ -456,10 +456,11 @@ int mmc_clk_update_freq(struct mmc_host *host, } EXPORT_SYMBOL(mmc_clk_update_freq); void mmc_recovery_fallback_lower_speed(struct mmc_host *host) int mmc_recovery_fallback_lower_speed(struct mmc_host *host) { int err = 0; if (!host->card) return; return -EINVAL; if (host->sdr104_wa && mmc_card_sd(host->card) && (host->ios.timing == MMC_TIMING_UHS_SDR104) && Loading @@ -467,9 +468,14 @@ void mmc_recovery_fallback_lower_speed(struct mmc_host *host) pr_err("%s: %s: blocked SDR104, lower the bus-speed (SDR50 / DDR50)\n", mmc_hostname(host), __func__); mmc_host_clear_sdr104(host); mmc_hw_reset(host); err = mmc_hw_reset(host); host->card->sdr104_blocked = true; } if (err) pr_err("%s: %s: Fallback to lower speed mode failed with err=%d\n", mmc_hostname(host), __func__, err); return err; } static int mmc_devfreq_set_target(struct device *dev, Loading Loading @@ -537,7 +543,7 @@ static int mmc_devfreq_set_target(struct device *dev, if (err && err != -EAGAIN) { pr_err("%s: clock scale to %lu failed with error %d\n", mmc_hostname(host), *freq, err); mmc_recovery_fallback_lower_speed(host); err = mmc_recovery_fallback_lower_speed(host); } else { pr_debug("%s: clock change to %lu finished successfully (%s)\n", mmc_hostname(host), *freq, current->comm); Loading Loading @@ -4306,8 +4312,7 @@ int _mmc_detect_card_removed(struct mmc_host *host) if (ret) { if (host->ops->get_cd && host->ops->get_cd(host)) { mmc_recovery_fallback_lower_speed(host); ret = 0; ret = mmc_recovery_fallback_lower_speed(host); } else { mmc_card_set_removed(host->card); if (host->card->sdr104_blocked) { Loading include/linux/mmc/core.h +1 −1 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ extern void mmc_cmdq_clk_scaling_start_busy(struct mmc_host *host, bool lock_needed); extern void mmc_cmdq_clk_scaling_stop_busy(struct mmc_host *host, bool lock_needed, bool is_cmdq_dcmd); extern void mmc_recovery_fallback_lower_speed(struct mmc_host *host); extern int mmc_recovery_fallback_lower_speed(struct mmc_host *host); /** * mmc_claim_host - exclusively claim a host Loading Loading
drivers/mmc/core/core.c +11 −6 Original line number Diff line number Diff line Loading @@ -456,10 +456,11 @@ int mmc_clk_update_freq(struct mmc_host *host, } EXPORT_SYMBOL(mmc_clk_update_freq); void mmc_recovery_fallback_lower_speed(struct mmc_host *host) int mmc_recovery_fallback_lower_speed(struct mmc_host *host) { int err = 0; if (!host->card) return; return -EINVAL; if (host->sdr104_wa && mmc_card_sd(host->card) && (host->ios.timing == MMC_TIMING_UHS_SDR104) && Loading @@ -467,9 +468,14 @@ void mmc_recovery_fallback_lower_speed(struct mmc_host *host) pr_err("%s: %s: blocked SDR104, lower the bus-speed (SDR50 / DDR50)\n", mmc_hostname(host), __func__); mmc_host_clear_sdr104(host); mmc_hw_reset(host); err = mmc_hw_reset(host); host->card->sdr104_blocked = true; } if (err) pr_err("%s: %s: Fallback to lower speed mode failed with err=%d\n", mmc_hostname(host), __func__, err); return err; } static int mmc_devfreq_set_target(struct device *dev, Loading Loading @@ -537,7 +543,7 @@ static int mmc_devfreq_set_target(struct device *dev, if (err && err != -EAGAIN) { pr_err("%s: clock scale to %lu failed with error %d\n", mmc_hostname(host), *freq, err); mmc_recovery_fallback_lower_speed(host); err = mmc_recovery_fallback_lower_speed(host); } else { pr_debug("%s: clock change to %lu finished successfully (%s)\n", mmc_hostname(host), *freq, current->comm); Loading Loading @@ -4306,8 +4312,7 @@ int _mmc_detect_card_removed(struct mmc_host *host) if (ret) { if (host->ops->get_cd && host->ops->get_cd(host)) { mmc_recovery_fallback_lower_speed(host); ret = 0; ret = mmc_recovery_fallback_lower_speed(host); } else { mmc_card_set_removed(host->card); if (host->card->sdr104_blocked) { Loading
include/linux/mmc/core.h +1 −1 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ extern void mmc_cmdq_clk_scaling_start_busy(struct mmc_host *host, bool lock_needed); extern void mmc_cmdq_clk_scaling_stop_busy(struct mmc_host *host, bool lock_needed, bool is_cmdq_dcmd); extern void mmc_recovery_fallback_lower_speed(struct mmc_host *host); extern int mmc_recovery_fallback_lower_speed(struct mmc_host *host); /** * mmc_claim_host - exclusively claim a host Loading