diff mbox

[RESEND] mvsdio: Add ERASE caps

Message ID 00ad6e33ca4270d9530ac6bd7e508af05e759a1c.camel@vitec.com (mailing list archive)
State New, archived
Headers show

Commit Message

Damien Thébault May 30, 2018, 3:25 p.m. UTC
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.

Regards
---
 drivers/mmc/host/mvsdio.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.17.0

Comments

Ulf Hansson May 31, 2018, 10:41 a.m. UTC | #1
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 mbox

Patch

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)