mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: 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 v1] mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A
Date: Thu, 14 Sep 2023 22:10:04 +0200	[thread overview]
Message-ID: <29a418ef8d4f1be398420aa58474184febe26433.camel@iokpp.de> (raw)
In-Reply-To: <CAPDyKFrt4r88RhCg1XigFtd8xSrLLbHeD31ZAEA0aUDkNzRxGQ@mail.gmail.com>

On Thu, 2023-09-14 at 15:59 +0200, Ulf Hansson wrote:
> On Wed, 13 Sept 2023 at 20:57, Bean Huo <beanhuo@iokpp.de> 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.
> 

Hi Uffe, 

Thanks for your review. 

> This needs some more explanation I think. What does "after a write"
> really mean?
> 

"After a write" means that the cache flush command is only
meaningful/allowed or necessary when the data write command occurs. 


> According to the changes below, we are tracking only whether a write
> has been done and then we set host->card->written_flag = true - keep
> it like that forever.
> 
> What happens beyond a power cycle for example? Like in the recovery
> path or in the system wide suspend/resume path? Does the flag need to
> be reset in those cases too?
> 

Yes, during recovery and system/runtime suspend/resume we want to reset
this flag and set it again when a data write command occurs.

 we found that on some systems,  the cache will be flushed after the
system power on/reset,  the cache in the eMMC is actually empty at this
time, and cache flush is meaningless. But for this eMMC device,
flushing the cache before writing data causes problems. This is what
this quirk meant.

However, after writing, and then doing a cache flush, similar to the
following, the cache flush will work even if the cache is empty. So, we
only care about just-boot/reset/resume.


Kind regards,
Bean

> Kind regards
> Uffe






  reply	other threads:[~2023-09-14 20:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 18:57 Bean Huo
2023-09-14 13:59 ` Ulf Hansson
2023-09-14 20:10   ` Bean Huo [this message]
2023-09-14 20:30   ` Bean Huo

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=29a418ef8d4f1be398420aa58474184febe26433.camel@iokpp.de \
    --to=beanhuo@iokpp.de \
    --cc=adrian.hunter@intel.com \
    --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

all inboxes | Powered by JetHome®