diff mbox

mmc: sunxi: Declare ERASE capability

Message ID 1408541960-14788-1-git-send-email-wens@csie.org (mailing list archive)
State New, archived
Headers show

Commit Message

Chen-Yu Tsai Aug. 20, 2014, 1:39 p.m. UTC
Declare ERASE capability so we can use filesystems with the discard
option and the fstrim tool.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/mmc/host/sunxi-mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Lanzendörfer Aug. 20, 2014, 2:10 p.m. UTC | #1
Hi
> Declare ERASE capability so we can use filesystems with the discard
> option and the fstrim tool.
I totally agree with you that information about such capabilities should be
exposed but maybe it would be wiser to use DT instead of hardcoding it?
I mean a WiFi device won't support erase functionality...
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-October/068210.html

> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mmc/host/sunxi-mmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 024f67c..7bf5c1c 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -990,7 +990,8 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
> /* 400kHz ~ 50MHz */
>  	mmc->f_min		=   400000;
>  	mmc->f_max		= 50000000;
> -	mmc->caps	       |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
> +	mmc->caps	       |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
> +				  MMC_CAP_ERASE;
> 
>  	ret = mmc_of_parse(mmc);
>  	if (ret)
Ulf Hansson Aug. 20, 2014, 2:20 p.m. UTC | #2
On 20 August 2014 16:10, David Lanzendörfer <david.lanzendoerfer@o2s.ch> wrote:
> Hi
>> Declare ERASE capability so we can use filesystems with the discard
>> option and the fstrim tool.
> I totally agree with you that information about such capabilities should be
> exposed but maybe it would be wiser to use DT instead of hardcoding it?

Nope, this is pure software support. No HW config.

What we should do future wise, is to remove the MMC_CAP_ERASE
entirely. Due to current existing bugs, mainly in mmc core layer
regarding erase, we can't do it yet.

> I mean a WiFi device won't support erase functionality...

That's already covered by the mmc core layer. No worries.

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
Hans de Goede Aug. 23, 2014, 2:11 p.m. UTC | #3
Hi,

On 08/20/2014 03:39 PM, Chen-Yu Tsai wrote:
> Declare ERASE capability so we can use filesystems with the discard
> option and the fstrim tool.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Good one:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

> ---
>  drivers/mmc/host/sunxi-mmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 024f67c..7bf5c1c 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -990,7 +990,8 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
>  	/* 400kHz ~ 50MHz */
>  	mmc->f_min		=   400000;
>  	mmc->f_max		= 50000000;
> -	mmc->caps	       |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
> +	mmc->caps	       |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
> +				  MMC_CAP_ERASE;
>  
>  	ret = mmc_of_parse(mmc);
>  	if (ret)
> 
--
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
Ulf Hansson Aug. 29, 2014, 11:10 a.m. UTC | #4
On 20 August 2014 15:39, Chen-Yu Tsai <wens@csie.org> wrote:
> Declare ERASE capability so we can use filesystems with the discard
> option and the fstrim tool.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Thanks! Applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sunxi-mmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 024f67c..7bf5c1c 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -990,7 +990,8 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
>         /* 400kHz ~ 50MHz */
>         mmc->f_min              =   400000;
>         mmc->f_max              = 50000000;
> -       mmc->caps              |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
> +       mmc->caps              |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
> +                                 MMC_CAP_ERASE;
>
>         ret = mmc_of_parse(mmc);
>         if (ret)
> --
> 2.1.0
>
--
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
David Lanzendörfer Aug. 29, 2014, 11:16 p.m. UTC | #5
Hi
> > I totally agree with you that information about such capabilities should
> > be
> > exposed but maybe it would be wiser to use DT instead of hardcoding it?
> 
> Nope, this is pure software support. No HW config.
Okey!
> What we should do future wise, is to remove the MMC_CAP_ERASE
> entirely. Due to current existing bugs, mainly in mmc core layer
> regarding erase, we can't do it yet.
I see.
> > I mean a WiFi device won't support erase functionality...
> 
> That's already covered by the mmc core layer. No worries.
Splendid!
Ok then. Let's have it in our driver so far until we can get rid of this flag
for good.

cheers
diff mbox

Patch

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 024f67c..7bf5c1c 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -990,7 +990,8 @@  static int sunxi_mmc_probe(struct platform_device *pdev)
 	/* 400kHz ~ 50MHz */
 	mmc->f_min		=   400000;
 	mmc->f_max		= 50000000;
-	mmc->caps	       |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
+	mmc->caps	       |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
+				  MMC_CAP_ERASE;
 
 	ret = mmc_of_parse(mmc);
 	if (ret)