From: Avri Altman <Avri.Altman@wdc.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Shawn Lin <shawn.lin@rock-chips.com>,
Masami Hiramatsu <masami.hiramatsu@linaro.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/2] mmc: core: Add support for cache ctrl for SD cards
Date: Mon, 10 May 2021 10:41:34 +0000 [thread overview]
Message-ID: <DM6PR04MB6575FC67AED514877921AC99FC549@DM6PR04MB6575.namprd04.prod.outlook.com> (raw)
In-Reply-To: <DM6PR04MB6575E3D63982278D2F1CA022FC549@DM6PR04MB6575.namprd04.prod.outlook.com>
> > + if (!err)
> > + card->ext_perf.feature_enabled |= SD_EXT_PERF_CACHE;
> Maybe
> If (err)
> card->ext_perf.feature_enabled &= ~SD_EXT_PERF_CACHE;
>
> and move to out: to catch the sd_write_ext_reg err ?
Please ignore - got mixed up with card->ext_perf.feature_support...
Sorry,
Avri
>
> > +
> > +out:
> > + kfree(reg_buf);
> > + return err;
> > +}
> > +
> > /*
> > * Handle the detection and initialisation of a card.
> > *
> > @@ -1442,6 +1531,13 @@ static int mmc_sd_init_card(struct mmc_host
> > *host, u32 ocr,
> > goto free_card;
> > }
> >
> > + /* Enable internal SD cache if supported. */
> > + if (card->ext_perf.feature_support & SD_EXT_PERF_CACHE) {
> > + err = sd_enable_cache(card);
> > + if (err)
> > + goto free_card;
> If cache enablement failed, is it worthwhile to bail out?
> Maybe disabling the cache with the appropriate message is enough?
>
> > + }
> > +
> > if (host->cqe_ops && !host->cqe_enabled) {
> > err = host->cqe_ops->cqe_enable(host, card);
> > if (!err) {
> > @@ -1694,6 +1790,8 @@ static const struct mmc_bus_ops mmc_sd_ops =
> {
> > .alive = mmc_sd_alive,
> > .shutdown = mmc_sd_suspend,
> > .hw_reset = mmc_sd_hw_reset,
> > + .cache_enabled = sd_cache_enabled,
> > + .flush_cache = sd_flush_cache,
> > };
>
> I would expect 2 more patches in this series:
> - flush cache on power down
> - cache disablement events?
>
> Thanks,
> Avri
next prev parent reply other threads:[~2021-05-10 10:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 14:58 [PATCH 0/2] mmc: core: Implement support for cache ctrl for SD cards Ulf Hansson
2021-05-06 14:58 ` [PATCH 1/2] mmc: core: Move eMMC cache flushing to a new bus_ops callback Ulf Hansson
2021-05-07 7:15 ` Avri Altman
2021-05-09 18:48 ` Linus Walleij
2021-05-06 14:58 ` [PATCH 2/2] mmc: core: Add support for cache ctrl for SD cards Ulf Hansson
2021-05-09 19:01 ` Linus Walleij
2021-05-10 14:32 ` Ulf Hansson
2021-05-10 9:10 ` Avri Altman
2021-05-10 10:41 ` Avri Altman [this message]
2021-05-10 14:41 ` Ulf Hansson
2021-05-11 8:22 ` Avri Altman
2021-05-10 7:39 ` [PATCH 0/2] mmc: core: Implement " Avri Altman
2021-05-10 9:44 ` Ulf Hansson
2021-05-10 10:12 ` Avri Altman
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=DM6PR04MB6575FC67AED514877921AC99FC549@DM6PR04MB6575.namprd04.prod.outlook.com \
--to=avri.altman@wdc.com \
--cc=adrian.hunter@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=masami.hiramatsu@linaro.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.