]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
mmc: Limit MMC speed to 52MHz if not HS200
authorAl Cooper <alcooperx@gmail.com>
Fri, 30 Nov 2012 15:53:35 +0000 (10:53 -0500)
committerChris Ball <cjb@laptop.org>
Thu, 6 Dec 2012 18:55:11 +0000 (13:55 -0500)
If "caps2" host capabilities does not indicate support for MMC
HS200, don't allow clock speeds >52MHz. Currently, for MMC, the
clock speed is set to the lesser of the max speed the eMMC module
supports (card->ext_csd.hs_max_dtr) or the max base clock of the
host controller (host->f_max based on BASE_CLK_FREQ in the host
CAPS register). This means that a host controller that doesn't
support HS200 mode but has a base clock of 100MHz and an eMMC module
that supports HS200 speeds will end up using a 100MHz clock.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/mmc.c

index f605d6e3d2cd2694f36c1d945159bd2f5767c426..e6e39111e05b416623f830060fd8fca86f44edf5 100644 (file)
@@ -1066,6 +1066,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
        if (mmc_card_highspeed(card) || mmc_card_hs200(card)) {
                if (max_dtr > card->ext_csd.hs_max_dtr)
                        max_dtr = card->ext_csd.hs_max_dtr;
+               if (mmc_card_highspeed(card) && (max_dtr > 52000000))
+                       max_dtr = 52000000;
        } else if (max_dtr > card->csd.max_dtr) {
                max_dtr = card->csd.max_dtr;
        }