mmc: dw_mmc-rockchip: fix failing to mount partition with "discard"
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 1 Mar 2016 07:08:48 +0000 (15:08 +0800)
committerShawn Lin <shawn.lin@rock-chips.com>
Tue, 1 Mar 2016 07:46:48 +0000 (15:46 +0800)
Without MMC_CAP_ERASE support, we fail to mount partition
with "discard" option since mmc_queue_setup_discard is limited
for checking mmc_can_erase. Without doing mmc_queue_setup_discard,
blk_queue_discard fails to test QUEUE_FLAG_DISCARD flag, so we get
the following log from f2fs(actually similar to other file system):

mounting with "discard" option, but the device does not support discard

Change-Id: Iee781795c9c61153644f0dd5b00dfc2cca6cc721
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/mmc/host/dw_mmc-rockchip.c

index 9becebeeccd17c925d933aa4bff36954a217ff9c..954f66f356ffdc54839a1cb190429196ccb3be0e 100644 (file)
@@ -241,11 +241,12 @@ static int dw_mci_rockchip_init(struct dw_mci *host)
 
 /* Common capabilities of RK3288 SoC */
 static unsigned long dw_mci_rk3288_dwmmc_caps[4] = {
-       MMC_CAP_RUNTIME_RESUME, /* emmc */
-       MMC_CAP_RUNTIME_RESUME, /* sdmmc */
-       MMC_CAP_RUNTIME_RESUME, /* sdio0 */
-       MMC_CAP_RUNTIME_RESUME, /* sdio1 */
+       MMC_CAP_RUNTIME_RESUME | MMC_CAP_ERASE, /* emmc */
+       MMC_CAP_RUNTIME_RESUME | MMC_CAP_ERASE, /* sdmmc */
+       MMC_CAP_RUNTIME_RESUME | MMC_CAP_ERASE, /* sdio0 */
+       MMC_CAP_RUNTIME_RESUME | MMC_CAP_ERASE, /* sdio1 */
 };
+
 static const struct dw_mci_drv_data rk2928_drv_data = {
        .prepare_command        = dw_mci_rockchip_prepare_command,
        .init                   = dw_mci_rockchip_init,