From: Adrian Hunter <adrian.hunter@intel.com>
To: Marek Vasut <marex@denx.de>, linux-mmc@vger.kernel.org
Cc: "Christian Löhle" <CLoehle@hyperstone.com>,
"Avri Altman" <avri.altman@wdc.com>,
"Jens Axboe" <axboe@kernel.dk>,
"Michael Wu" <michael@allwinnertech.com>,
"Ming Lei" <ming.lei@redhat.com>,
"Seunghui Lee" <sh043.lee@samsung.com>,
"Ulf Hansson" <ulf.hansson@linaro.org>
Subject: Re: [PATCH] [RFC] Revert "mmc: core: Fixup support for writeback-cache for eMMC and SD"
Date: Wed, 31 May 2023 08:46:06 +0300 [thread overview]
Message-ID: <ecad717c-77b5-c78a-795b-2c3019b7452a@intel.com> (raw)
In-Reply-To: <20230531002740.1235620-1-marex@denx.de>
On 31/05/23 03:27, Marek Vasut wrote:
> 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 ?
This does not disable the cache, it disables the block layer from issuing
cache flushes (by telling it there is no cache being used).
It would be good to know what commands are failing, which should be visible
in the kernel messages if dynamic debug is enabled:
Dynamic debug for mmc
---------------------
Kernel must be configured:
CONFIG_DYNAMIC_DEBUG=y
To enable mmc debug via sysfs:
echo 'file drivers/mmc/core/* +p' > /sys/kernel/debug/dynamic_debug/control
echo 'file drivers/mmc/host/* +p' > /sys/kernel/debug/dynamic_debug/control
To enable mmc debug via kernel command line:
dyndbg="file drivers/mmc/core/* +p;file drivers/mmc/host/* +p"
To disable mmc debug:
echo 'file drivers/mmc/core/* -p' > /sys/kernel/debug/dynamic_debug/control
echo 'file drivers/mmc/host/* -p' > /sys/kernel/debug/dynamic_debug/control
More general information in kernel documentation in kernel tree:
Documentation/admin-guide/dynamic-debug-howto.rst
>
> 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));
next prev parent reply other threads:[~2023-05-31 5:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ecad717c-77b5-c78a-795b-2c3019b7452a@intel.com \
--to=adrian.hunter@intel.com \
--cc=CLoehle@hyperstone.com \
--cc=avri.altman@wdc.com \
--cc=axboe@kernel.dk \
--cc=linux-mmc@vger.kernel.org \
--cc=marex@denx.de \
--cc=michael@allwinnertech.com \
--cc=ming.lei@redhat.com \
--cc=sh043.lee@samsung.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox