From: Shawn Lin Date: Tue, 1 Mar 2016 07:08:48 +0000 (+0800) Subject: mmc: dw_mmc-rockchip: fix failing to mount partition with "discard" X-Git-Tag: firefly_0821_release~3338 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=42ca4e06a91ba13bc205d19eb29364606b13fa5a;p=firefly-linux-kernel-4.4.55.git mmc: dw_mmc-rockchip: fix failing to mount partition with "discard" 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 --- diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index 9becebeeccd1..954f66f356ff 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -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,