Message ID | 00ad6e33ca4270d9530ac6bd7e508af05e759a1c.camel@vitec.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 30 May 2018 at 17:25, Damien Thébault <damien.thebault@vitec.com> wrote: > Hello, > > I'm re-sending this as I did not get feedback the first time I sent > this patch some time ago. > > I was trying to use ERASE with mvsdio and it did not have the > capability. But the Marvell SDIO host controller does support sending > ERASE commands. > > This is similar to the patch that Sascha Silbe sent a few years ago [1], > but this one is based on the latest kernel sources. > > [1]: https://lkml.org/lkml/2011/3/17/297 > > The patch stays in the spirit of what have been done in other drivers > like dw_mmc or sunxi-mmc, setting MMC_CAP_ERASE before calling > mmc_of_parse(). > > This has been tested successfully with blkdiscard and blkdiscard -s on > an eMMC card. I have sent two patches, one more less being a copy of $subject patch. However, I couldn't keep your authorship as you haven't signed off your patch. Anyway, please test it and provide you tested-by tag, if it works of course. Kind regards Uffe -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 210247b3d11a..0367f826a702 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -748,6 +748,11 @@ static int mvsd_probe(struct platform_device *pdev) mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count; mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; + /* + * Support MMC_CAP_ERASE, needed to use trim/discard/erase commands. + */ + mmc->caps |= MMC_CAP_ERASE; + host->base_clock = clk_get_rate(host->clk) / 2; ret = mmc_of_parse(mmc); if (ret < 0)