diff mbox

[v2] mmc: enable trim in eMMC device

Message ID 1392072891-21302-1-git-send-email-puthik@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Puthikorn Voravootivat Feb. 10, 2014, 10:54 p.m. UTC
Force all host to have erase capacity to enable trim or
discard feature in supported eMMC device.

Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
---
V2 change:
Instead of add MMC_CAP_ERASE just only for dw_mmc, this patch adds
this capability to all host.

 drivers/mmc/core/host.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jaehoon Chung Feb. 11, 2014, 2:48 a.m. UTC | #1
As my understanding, if erase will be used by default, MMC_CAP_ERASE flags can be removed. isn't?

Best Regards,
Jaehoon Chung

On 02/11/2014 07:54 AM, Puthikorn Voravootivat wrote:
> Force all host to have erase capacity to enable trim or
> discard feature in supported eMMC device.
> 
> Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
> ---
> V2 change:
> Instead of add MMC_CAP_ERASE just only for dw_mmc, this patch adds
> this capability to all host.
> 
>  drivers/mmc/core/host.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 49bc403..a21f590 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -521,6 +521,8 @@ int mmc_add_host(struct mmc_host *host)
>  	WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
>  		!host->ops->enable_sdio_irq);
>  
> +	host->caps |= MMC_CAP_ERASE;
> +
>  	err = device_add(&host->class_dev);
>  	if (err)
>  		return err;
> 

--
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/core/host.c b/drivers/mmc/core/host.c
index 49bc403..a21f590 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -521,6 +521,8 @@  int mmc_add_host(struct mmc_host *host)
 	WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
 		!host->ops->enable_sdio_irq);
 
+	host->caps |= MMC_CAP_ERASE;
+
 	err = device_add(&host->class_dev);
 	if (err)
 		return err;