File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2330,7 +2330,13 @@ void mmc_rescan(struct work_struct *work)
2330
2330
}
2331
2331
2332
2332
for (i = 0 ; i < ARRAY_SIZE (freqs ); i ++ ) {
2333
- if (!mmc_rescan_try_freq (host , max (freqs [i ], host -> f_min )))
2333
+ unsigned int freq = freqs [i ];
2334
+ if (freq > host -> f_max ) {
2335
+ if (i + 1 < ARRAY_SIZE (freqs ))
2336
+ continue ;
2337
+ freq = host -> f_max ;
2338
+ }
2339
+ if (!mmc_rescan_try_freq (host , max (freq , host -> f_min )))
2334
2340
break ;
2335
2341
if (freqs [i ] <= host -> f_min )
2336
2342
break ;
@@ -2344,7 +2350,7 @@ void mmc_rescan(struct work_struct *work)
2344
2350
2345
2351
void mmc_start_host (struct mmc_host * host )
2346
2352
{
2347
- host -> f_init = max (freqs [0 ], host -> f_min );
2353
+ host -> f_init = max (min ( freqs [0 ], host -> f_max ) , host -> f_min );
2348
2354
host -> rescan_disable = 0 ;
2349
2355
host -> ios .power_mode = MMC_POWER_UNDEFINED ;
2350
2356
You can’t perform that action at this time.
0 commit comments