mmc: core: Fix clk scaling when card max freq below 50MHz

When card max supported clk frequency is less than 50MHz,
driver registers scale up frequency as 0 and scale down
frequency as max card supported clk frequency. So read/write
during high load performace is dropping.

Ideally in this scenario, clk scaling could be disabled by
skipping registration with devfreq, but userspace might see
scaling supported for some card and its not supported for another
which might create confusion. Hence keeping low and high, clk
scaling frequency as same, and scaling would be skipped when
devfreq attempts to scale the clk.

Change-Id: I25977bdff4275c4ebec7309952029f43e0d2455f
Signed-off-by: Ram Prakash Gupta <rampraka@codeaurora.org>
This commit is contained in:
Ram Prakash Gupta 2020-10-12 17:39:23 +05:30 • committed by Gerrit - the friendly Code Review server
commit 03454835bd

View file

@ -612,6 +612,12 @@ static int mmc_devfreq_create_freq_table(struct mmc_host *host)
break;
}
if (mmc_card_sd(host->card) && (clk_scaling->freq_table_sz < 2)) {
clk_scaling->freq_table[clk_scaling->freq_table_sz] =
host->card->clk_scaling_highest;
clk_scaling->freq_table_sz++;
}
out:
/**
* devfreq requires unsigned long type freq_table while the