From: Shawn Lin Date: Fri, 22 Nov 2024 09:37:22 +0000 (+0800) Subject: mmc: core: Respect quirk_max_rate for non-UHS SDIO card X-Git-Tag: v5.15.179~407 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bafaee99fc23834fc666782c5e55f396de44e869;p=thirdparty%2Fkernel%2Fstable.git mmc: core: Respect quirk_max_rate for non-UHS SDIO card [ Upstream commit a2a44f8da29352f76c99c6904ee652911b8dc7dd ] The card-quirk was added to limit the clock-rate for a card with UHS-mode support, although let's respect the quirk for non-UHS mode too, to make the behaviour consistent. Signed-off-by: Shawn Lin Message-ID: <1732268242-72799-1-git-send-email-shawn.lin@rock-chips.com> Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index eda2dbd965392..a0cac8c87ef2f 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -443,6 +443,8 @@ static unsigned mmc_sdio_get_max_clock(struct mmc_card *card) if (card->type == MMC_TYPE_SD_COMBO) max_dtr = min(max_dtr, mmc_sd_get_max_clock(card)); + max_dtr = min_not_zero(max_dtr, card->quirk_max_rate); + return max_dtr; }