This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SD card is not mounting in DM37x

Hi All,

We are using custom board with Android GingerBread 2.3.4 with 2.6.37 kernel version.

We are using nand images for booting and SD card is using as general storage device. We are using FAT file sysyem without any partitions.

It is working fine with normal system start-up. After booting completes, If i unmount  it through

           Settings->stoarge->Unmount sdcard.

After unmount complets, removed the SD card. Again insert and press on mount sd card.

It is not mounting and saying like "Blank SD card".

Is it known issue? Can any one please help me?

Thanks,

Naresh

  • Hi Naresh,

    Could you use the 'make menuconfig' command to check whether the following option is enabled:

    Device Drivers -> MMC/SD/SDIO card support ->  Assume MMC/SD cards are non-removable (DANGEROUS)

    If it is enabled - disable it. Pay attention of the description of this option: "If you say Y here, the MMC layer will assume that all cards stayed in their respective slots during the suspend. The normal behaviour is to remove them at suspend and redetecting them at resume. Breaking this assumption will in most cases result in data corruption.
    This option is usually just for embedded systems which use a MMC/SD card for rootfs. Most people should say N here."

    BR

    Tsvetolin Shulev

  • Hi Tsvetolin Shulev,

    Thank you for your quick response.

    Actually it was enabled in our code. SO now i disabled it and also enabled:

    Device Drivers -> MMC/SD/SDIO card support -> [*]   Enable paranoid SD card initialization (EXPERIMENTAL)

    It is working fine. But on every suspend operation it is removing SD card as you mentioned. But the the power values are very high(~45mA increasing) after doing these changes in suspend operation.

    When i was debugging, i came to know that if SD card is removable then the MMC and SD drivers are not handling suspend and resume operations. The drivers are defining them as NULL

    Kernel/drivers/mmc/core/sd.c

    static const struct mmc_bus_ops mmc_sd_ops = {
              .remove = mmc_sd_remove,
              .detect = mmc_sd_detect,
              .suspend = NULL,
              .resume = NULL,
              .power_restore = mmc_sd_power_restore,
    };

    Kernel/drivers/mmc/core/mmc.c

    static const struct mmc_bus_ops mmc_ops = {
           .awake = mmc_awake,
           .sleep = mmc_sleep,
           .remove = mmc_remove,
           .detect = mmc_detect,
           .suspend = NULL,
           .resume = NULL,
           .power_restore = mmc_power_restore,
    };

    After i replacing them with already existing suspend and resume handlers in both drivers, the power values came down to normal state.

    Now I want to know:

    1. What is this flag like "Device Drivers -> MMC/SD/SDIO card support -> [*]   Enable paranoid SD card initialization (EXPERIMENTAL)" ?

    If we enable it, it will try to initialize the SD card up-to five times if it is failing to initialize. Is it recommended or not?

    2. Why the suspend and resume operations were not implementing for removable SD or MMC cards?

    Once again thank you for quick response. Please give me reply.

    Thanks,

    Naresh