From: Francesco Dolcini <francesco@dolcini.it>
To: Bean Huo <beanhuo@iokpp.de>
Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com,
beanhuo@micron.com, jakub.kwapisz@toradex.com,
rafael.beims@toradex.com, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3] mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A
Date: Fri, 22 Sep 2023 19:01:12 +0200 [thread overview]
Message-ID: <ZQ3IWOpcSfjVqNYC@francesco-nb.int.toradex.com> (raw)
In-Reply-To: <20230921203426.638262-1-beanhuo@iokpp.de>
On Thu, Sep 21, 2023 at 10:34:26PM +0200, Bean Huo wrote:
> From: Bean Huo <beanhuo@micron.com>
>
> Micron MTFC4GACAJCN eMMC supports cache but requires that flush cache
> operation be allowed only after a write has occurred. Otherwise, the
> cache flush command or subsequent commands will time out.
>
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> Co-developed-by: Rafael Beims <rafael.beims@toradex.com>
> Cc: stable@vger.kernel.org
> ---
> Changelog:
>
> v2--v3:
> 1. Set card->written_flag in mmc_blk_mq_issue_rq().
> v1--v2:
> 1. Add Rafael's test-tag, and Co-developed-by.
> 2. Check host->card whether NULL or not in __mmc_start_request() before asserting host->card->->quirks
> ---
> drivers/mmc/core/block.c | 4 ++++
> drivers/mmc/core/mmc.c | 5 +++++
> drivers/mmc/core/quirks.h | 7 ++++---
> include/linux/mmc/card.h | 2 ++
> 4 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 3a8f27c3e310..14d0dc7942de 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -2387,6 +2387,10 @@ enum mmc_issued mmc_blk_mq_issue_rq(struct mmc_queue *mq, struct request *req)
> ret = mmc_blk_cqe_issue_rw_rq(mq, req);
> else
> ret = mmc_blk_mq_issue_rw_rq(mq, req);
> +
> + if (host->card->quirks & MMC_QUIRK_BROKEN_CACHE_FLUSH &&
> + !host->card->written_flag && !ret)
> + host->card->written_flag = true;
From what I can see this branch is followed for both REQ_OP_READ and
REQ_OP_WRITE, and I would say we want to set this flag only for
REQ_OP_WRITE.
Am I wrong?
Francesco
next prev parent reply other threads:[~2023-09-22 17:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-21 20:34 [PATCH v3] mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A Bean Huo
2023-09-22 9:29 ` Greg KH
2023-09-23 10:50 ` Rafael Beims
2023-09-22 17:01 ` Francesco Dolcini [this message]
2023-09-27 8:56 ` Bean Huo
2023-09-25 14:06 ` Ulf Hansson
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=ZQ3IWOpcSfjVqNYC@francesco-nb.int.toradex.com \
--to=francesco@dolcini.it \
--cc=adrian.hunter@intel.com \
--cc=beanhuo@iokpp.de \
--cc=beanhuo@micron.com \
--cc=jakub.kwapisz@toradex.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=rafael.beims@toradex.com \
--cc=stable@vger.kernel.org \
--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