Skip to contentSkip to conversation

mmc: sunxi: Declare ERASE capability

PATCH New Chen-Yu Tsai 4 participants 6 messages Aug 20, 2014 – Aug 29, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sunxi: Declare ERASE capability

Declare ERASE capability so we can use filesystems with the discard option and the fstrim tool.

---
 drivers/mmc/host/sunxi-mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sunxi-mmc.c +2 -1
index 024f67c..7bf5c1c 100644
@@ -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)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 mmc: sunxi: Declare ERASE capability

Hi

Quoted 2 lines

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

Quoted 19 lines
---
 drivers/mmc/host/sunxi-mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sunxi-mmc.c +2 -1
index 024f67c..7bf5c1c 100644
@@ -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)
Signature · 11 lines
David Lanzend?rfer
OpenSourceSupport GmbH
System engineer and supporter
http://www.o2s.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140820/f6b553d1/attachment.sig>
#2 lore raw

PATCH 1/1 mmc: sunxi: Declare ERASE capability

Quoted 5 lines · David Lanzend?rfer

Hi

Quoted 2 lines

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.

Quoted 1 line

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

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

Kind regards
Uffe

#3 lore raw

PATCH 1/1 mmc: sunxi: Declare ERASE capability

Hi

Quoted 5 lines
Quoted 3 lines

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!

Quoted 3 lines

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.

Quoted 3 lines
Quoted 1 line

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

Signature · 11 lines
David Lanzend?rfer
OpenSourceSupport GmbH
System engineer and supporter
http://www.o2s.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140830/239fdd5a/attachment.sig>
#4 lore raw

PATCH 1/1 mmc: sunxi: Declare ERASE capability

In reply to Chen-Yu Tsai

Hi,

Quoted 4 lines · Chen-Yu Tsai

Declare ERASE capability so we can use filesystems with the discard option and the fstrim tool.

Good one:

Regards,

Hans

Quoted 19 lines
---
 drivers/mmc/host/sunxi-mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sunxi-mmc.c +2 -1
index 024f67c..7bf5c1c 100644
@@ -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)
Applied
#5 lore raw

PATCH 1/1 mmc: sunxi: Declare ERASE capability

In reply to Chen-Yu Tsai
Quoted 4 lines · Chen-Yu Tsai

Declare ERASE capability so we can use filesystems with the discard option and the fstrim tool.

Thanks! Applied for next!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/sunxi-mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sunxi-mmc.c +2 -2
index 024f67c..7bf5c1c 100644
@@ -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