Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH] [RFC] Revert "mmc: core: Fixup support for writeback-cache for eMMC and SD"
@ 2023-05-31  0:27 Marek Vasut
  2023-05-31  5:46 ` Adrian Hunter
  2023-05-31  6:01 ` Avri Altman
  0 siblings, 2 replies; 25+ messages in thread
From: Marek Vasut @ 2023-05-31  0:27 UTC (permalink / raw)
  To: linux-mmc
  Cc: Marek Vasut, Christian Löhle, Adrian Hunter, Avri Altman,
	Jens Axboe, Michael Wu, Ming Lei, Seunghui Lee, Ulf Hansson

This reverts commit 08ebf903af57cda6d773f3dd1671b64f73b432b8.

On STM32MP153C DHCOR DRC Compact with microSD card
Kingston Canvas Go! Plus MicroSDXC I 64 GiB U3/V30/A2 SDCG3/64GB
it is no longer possible to mount ext4 filesystem.

Git bisect points to this commit which is being reverted here. A bit of
investigation shows that for non-working microSD cards
  cache_enabled=TRUE fua_enabled=false
For working microSD card (Kingston Canvas React Plus, MicroSDXC II
64 GiB U3/V90/A1 SDCR2/64GB)
  cache_enabled=FALSE fua_enabled=false

It seems enabling the cache for SD cards causes the issue. Before the
reverted commit, the cache was not reported enabled for SD cards. I am
not sure whether such blunt revert is the correct solution however, any
ideas ?

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: "Christian Löhle" <CLoehle@hyperstone.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marek Vasut <marex@denx.de>
Cc: Michael Wu <michael@allwinnertech.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Seunghui Lee <sh043.lee@samsung.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
---
 drivers/mmc/core/block.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index db6d8a0999100..72aa47af11d37 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2413,8 +2413,6 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 	struct mmc_blk_data *md;
 	int devidx, ret;
 	char cap_str[10];
-	bool cache_enabled = false;
-	bool fua_enabled = false;
 
 	devidx = ida_simple_get(&mmc_blk_ida, 0, max_devices, GFP_KERNEL);
 	if (devidx < 0) {
@@ -2494,17 +2492,13 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 			md->flags |= MMC_BLK_CMD23;
 	}
 
-	if (md->flags & MMC_BLK_CMD23 &&
+	if (mmc_card_mmc(card) &&
+	    md->flags & MMC_BLK_CMD23 &&
 	    ((card->ext_csd.rel_param & EXT_CSD_WR_REL_PARAM_EN) ||
 	     card->ext_csd.rel_sectors)) {
 		md->flags |= MMC_BLK_REL_WR;
-		fua_enabled = true;
-		cache_enabled = true;
+		blk_queue_write_cache(md->queue.queue, true, true);
 	}
-	if (mmc_cache_enabled(card->host))
-		cache_enabled  = true;
-
-	blk_queue_write_cache(md->queue.queue, cache_enabled, fua_enabled);
 
 	string_get_size((u64)size, 512, STRING_UNITS_2,
 			cap_str, sizeof(cap_str));
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-06-20  1:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-31  0:27 [PATCH] [RFC] Revert "mmc: core: Fixup support for writeback-cache for eMMC and SD" Marek Vasut
2023-05-31  5:46 ` Adrian Hunter
2023-05-31 11:34   ` Marek Vasut
2023-05-31 13:08     ` Christian Loehle
2023-05-31 21:33       ` Marek Vasut
2023-05-31 13:13     ` Adrian Hunter
2023-05-31 21:31       ` Marek Vasut
2023-06-01  6:20         ` Adrian Hunter
2023-06-02 21:46           ` Marek Vasut
2023-06-04 16:30             ` Adrian Hunter
2023-06-07 20:43               ` Marek Vasut
2023-06-12  4:59                 ` Adrian Hunter
2023-06-12  8:59                   ` Marek Vasut
2023-06-12  9:29                     ` Adrian Hunter
2023-06-15 15:14                     ` Ulf Hansson
2023-06-15 15:32                       ` Marek Vasut
2023-06-15 15:35                       ` Adrian Hunter
2023-06-15 15:36                         ` Marek Vasut
2023-06-16 10:02                           ` Ulf Hansson
2023-06-16 10:24                             ` Marek Vasut
2023-06-16 10:33                               ` Ulf Hansson
2023-06-20  1:44                                 ` Marek Vasut
2023-06-16 10:20                       ` Marek Vasut
2023-05-31  6:01 ` Avri Altman
2023-05-31 11:34   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox