Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: dw_mmc: add the debug message for polling and non-removable

If card is polling or non-removable, display the more exact message.
It's helpful to debug which detecting scheme is using.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Jaehoon Chung and committed by
Ulf Hansson
d10111cf 1c238a95

+16 -2
+16 -2
drivers/mmc/host/dw_mmc.c
··· 1525 1525 int gpio_cd = mmc_gpio_get_cd(mmc); 1526 1526 1527 1527 /* Use platform get_cd function, else try onboard card detect */ 1528 - if ((mmc->caps & MMC_CAP_NEEDS_POLL) || !mmc_card_is_removable(mmc)) 1528 + if (((mmc->caps & MMC_CAP_NEEDS_POLL) 1529 + || !mmc_card_is_removable(mmc))) { 1529 1530 present = 1; 1530 - else if (gpio_cd >= 0) 1531 + 1532 + if (!test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) { 1533 + if (mmc->caps & MMC_CAP_NEEDS_POLL) { 1534 + dev_info(&mmc->class_dev, 1535 + "card is polling.\n"); 1536 + } else { 1537 + dev_info(&mmc->class_dev, 1538 + "card is non-removable.\n"); 1539 + } 1540 + set_bit(DW_MMC_CARD_PRESENT, &slot->flags); 1541 + } 1542 + 1543 + return present; 1544 + } else if (gpio_cd >= 0) 1531 1545 present = gpio_cd; 1532 1546 else 1533 1547 present = (mci_readl(slot->host, CDETECT) & (1 << slot->id))