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 v4] mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A
Date: Tue, 10 Oct 2023 17:33:43 +0200	[thread overview]
Message-ID: <254df9b8ca7475ad9dbd3a303c60e1f99eca9c56.camel@iokpp.de> (raw)
In-Reply-To: <CAPDyKFpgPEhVuTbxe5YhYQ0W6907SwJRxSQLB1F2FbVW3zKHxg@mail.gmail.com>

Hi Ulf,

thanks for your comments, I didn't quite get your points:

On Tue, 2023-10-10 at 16:20 +0200, Ulf Hansson wrote:
> > @@ -2381,8 +2381,11 @@ enum mmc_issued mmc_blk_mq_issue_rq(struct
> > mmc_queue *mq, struct request *req)
> >                          }
> >                          ret = mmc_blk_cqe_issue_flush(mq, req);
> >                          break;
> > -               case REQ_OP_READ:
> >                  case REQ_OP_WRITE:
> > +                       if (mmc_card_broken_cache_flush(card) &&
> > !card->written_flag)
> 
> It looks superfluous to me to check mmc_card_broken_cache_flush() and
> !card->written_flag. Just set the card->written_flag unconditionally.

what did you mean "Just set the card->written_flag unconditionally."?
This means I just need to check card->written_flag and set card-
>written_flag to true and false in the case
MMC_QUIRK_BROKEN_CACHE_FLUSH? or don't need to call
mmc_card_broken_cache_flush()?

> 
> > +                               card->written_flag = true;
> > +                       fallthrough;
> > +               case REQ_OP_READ:
> >                          if (host->cqe_enabled)
> >                                  ret = mmc_blk_cqe_issue_rw_rq(mq,
> > req);
> >                          else
> > diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
> > index 4edf9057fa79..b7754a1b8d97 100644
> > --- a/drivers/mmc/core/card.h
> > +++ b/drivers/mmc/core/card.h
> > @@ -280,4 +280,8 @@ static inline int
> > mmc_card_broken_sd_cache(const struct mmc_card *c)
> >          return c->quirks & MMC_QUIRK_BROKEN_SD_CACHE;
> >   }
> > 
> > +static inline int mmc_card_broken_cache_flush(const struct
> > mmc_card *c)
> > +{
> > +       return c->quirks & MMC_QUIRK_BROKEN_CACHE_FLUSH;
> > +}
> >   #endif
> > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> > index 89cd48fcec79..47896c32086e 100644
> > --- a/drivers/mmc/core/mmc.c
> > +++ b/drivers/mmc/core/mmc.c
> > @@ -1929,6 +1929,8 @@ static int mmc_init_card(struct mmc_host
> > *host, u32 ocr,
> >          if (!oldcard)
> >                  host->card = card;
> > 
> > +       card->written_flag = false;
> > +
> 
> How about doing this after a successful flush operation instead? In
> other words in _mmc_flush_cache().

Here initializes flag and the patch is intenting to eliminate the cache
flush command before writing. what do you mean adding in
mmc_flush_cache()?


Kind regards,
Bean


  reply	other threads:[~2023-10-10 15:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-01 19:49 Bean Huo
2023-10-04 19:07 ` Bean Huo
2023-10-10 14:14   ` Bean Huo
2023-10-10 14:20 ` Ulf Hansson
2023-10-10 15:33   ` Bean Huo [this message]
2023-10-10 21:04     ` Ulf Hansson
2023-10-18 16:05       ` Rafael Beims
2023-10-18 22:49         ` 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=254df9b8ca7475ad9dbd3a303c60e1f99eca9c56.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®