From a455049e0e2f72856c09d0e6382a5eec4d16181b Mon Sep 17 00:00:00 2001 From: "Bao D. Nguyen" Date: Fri, 21 Aug 2020 11:19:35 -0700 Subject: [PATCH] mmc: core: Fix uninitialized clock scaling's freq table For the UHS1 cards that have been initialized to operate at 1.8V signaling level earlier and the card initialization is invoked again, the driver would skip the voltage switching sequence from 3.3V to 1.8V and exit the card initialization because the SD card is already operating at 1.8V signaling voltage. The clock scaling logic's clk_scaling_highest and clk_scaling_lowest would be un-initialized in this case and cause failure to the subsequent clock scaling initialization. Fix the issue by properly initialize the clock scaling parameters that are later used by the clock scaling initialization function. Change-Id: I6489fbe3790feb07613d27b3c4bef62cd34fd44b Signed-off-by: Bao D. Nguyen --- drivers/mmc/core/sd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 42ad10c3fce6..a6ced8dce879 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1164,12 +1164,11 @@ retry: err = -EINVAL; goto free_card; } - +done: #if defined(CONFIG_SDC_QTI) card->clk_scaling_highest = mmc_sd_get_max_clock(card); card->clk_scaling_lowest = host->f_min; #endif -done: host->card = card; return 0;