I have dropped the stable/fixes tag and clarified the commit message a bit, before I applied this for next, thanks!
Thanks a lot.
Let's try to move forward on patch 2 too. Avri, if you have the time to do a re- spin? Otherwise, I will try to get some time to have a stab at it soon.
Please do. I would be interested in testing it using our SD-Express cards that tend to draw more current. Can also provide you with a sample of our latest cards if it helps.
Thanks a lot, Avri
Kind regards Uffe
drivers/mmc/core/sd.c | 7 ++----- include/linux/mmc/card.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index ec02067f03c5..cf92c5b2059a 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -554,7 +554,7 @@ static u32 sd_get_host_max_current(struct
mmc_host
*host)
static int sd_set_current_limit(struct mmc_card *card, u8 *status) {
int current_limit = SD_SET_CURRENT_NO_CHANGE;
int current_limit = SD_SET_CURRENT_LIMIT_200; int err; u32 max_current;@@ -598,11 +598,8 @@ static int sd_set_current_limit(struct mmc_card
*card, u8 *status)
else if (max_current >= 400 && card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_400) current_limit = SD_SET_CURRENT_LIMIT_400;
else if (max_current >= 200 &&card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_200)current_limit = SD_SET_CURRENT_LIMIT_200;if (current_limit != SD_SET_CURRENT_NO_CHANGE) {
if (current_limit != SD_SET_CURRENT_LIMIT_200) { err = mmc_sd_switch(card, SD_SWITCH_SET, 3, current_limit, status); if (err)diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index ddcdf23d731c..e9e964c20e53 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -182,7 +182,6 @@ struct sd_switch_caps { #define SD_SET_CURRENT_LIMIT_400 1 #define SD_SET_CURRENT_LIMIT_600 2 #define SD_SET_CURRENT_LIMIT_800 3 -#define SD_SET_CURRENT_NO_CHANGE (-1)
#define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200)
#define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400)
2.25.1