* [PATCH 1/2] mmc: core: Enable erase/discard/trim support for all mmc hosts
@ 2020-05-08 11:28 Ulf Hansson
2020-05-16 9:27 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Ulf Hansson @ 2020-05-08 11:28 UTC (permalink / raw)
To: linux-mmc, Ulf Hansson
Cc: Adrian Hunter, Linus Walleij, Rui Miguel Silva,
Greg Kroah-Hartman
Step by step, mmc host drivers and the mmc core have been improved in
regards to support erase/discard/trim operations. We have now reached a
point when it no longer seems reasonable to use an opt-in approach to
enable the functionality. Therefore, let's switch to make the operations
always supported.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/core/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 4c5de6d37ac7..8d2b808e9b58 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1815,8 +1815,7 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
unsigned int rem, to = from + nr;
int err;
- if (!(card->host->caps & MMC_CAP_ERASE) ||
- !(card->csd.cmdclass & CCC_ERASE))
+ if (!(card->csd.cmdclass & CCC_ERASE))
return -EOPNOTSUPP;
if (!card->erase_size)
@@ -1872,8 +1871,7 @@ EXPORT_SYMBOL(mmc_erase);
int mmc_can_erase(struct mmc_card *card)
{
- if ((card->host->caps & MMC_CAP_ERASE) &&
- (card->csd.cmdclass & CCC_ERASE) && card->erase_size)
+ if (card->csd.cmdclass & CCC_ERASE && card->erase_size)
return 1;
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/2] mmc: core: Enable erase/discard/trim support for all mmc hosts
2020-05-08 11:28 [PATCH 1/2] mmc: core: Enable erase/discard/trim support for all mmc hosts Ulf Hansson
@ 2020-05-16 9:27 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2020-05-16 9:27 UTC (permalink / raw)
To: Ulf Hansson
Cc: linux-mmc, Adrian Hunter, Rui Miguel Silva, Greg Kroah-Hartman
On Fri, May 8, 2020 at 1:28 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Step by step, mmc host drivers and the mmc core have been improved in
> regards to support erase/discard/trim operations. We have now reached a
> point when it no longer seems reasonable to use an opt-in approach to
> enable the functionality. Therefore, let's switch to make the operations
> always supported.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Excellent, the cars says it can do this, then we should use it, and
it would be so weird if hardware was so broken that it can't handle this.
We were working around something else I think?
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-16 9:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-08 11:28 [PATCH 1/2] mmc: core: Enable erase/discard/trim support for all mmc hosts Ulf Hansson
2020-05-16 9:27 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).