From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Sarthak Garg <quic_sartgarg@quicinc.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Al Cooper <alcooperx@gmail.com>, Haibo Chen <haibo.chen@nxp.com>,
Andrew Jeffery <andrew@aj.id.au>,
Eugen Hristev <eugen.hristev@microchip.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Prabu Thangamuthu <prabu.t@synopsys.com>,
Manjunath M B <manjumb@synopsys.com>,
Ben Dooks <ben-linux@fluff.org>,
Jaehoon Chung <jh80.chung@samsung.com>,
Viresh Kumar <vireshk@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Hu Ziji <huziji@marvell.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Brian Norris <briannorris@chromium.org>,
Wenchao Chen <wenchao.chen@unisoc.com>,
Chevron Li <chevron.li@bayhubtech.com>,
linux-mmc@vger.kernel.org
Subject: [PATCH 2/4] mmc: sdhci: Avoid unnecessary re-configuration
Date: Thu, 24 Nov 2022 19:06:47 +0200 [thread overview]
Message-ID: <20221124170649.63851-3-adrian.hunter@intel.com> (raw)
In-Reply-To: <20221124170649.63851-1-adrian.hunter@intel.com>
Avoid re-configuring UHS and preset settings when the settings have not
changed, irrespective of whether the clock is turning on.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 351b09b90d76..3675d69fb590 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2304,7 +2304,6 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct sdhci_host *host = mmc_priv(mmc);
bool reinit_uhs = host->reinit_uhs;
- bool turning_on_clk = false;
u8 ctrl;
host->reinit_uhs = false;
@@ -2334,8 +2333,6 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
sdhci_enable_preset_value(host, false);
if (!ios->clock || ios->clock != host->clock) {
- turning_on_clk = ios->clock && !host->clock;
-
host->ops->set_clock(host, ios->clock);
host->clock = ios->clock;
@@ -2363,11 +2360,10 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->ops->set_bus_width(host, ios->bus_width);
/*
- * Special case to avoid multiple clock changes during voltage
- * switching.
+ * Avoid unnecessary changes. In particular, this avoids multiple clock
+ * changes during voltage switching.
*/
if (!reinit_uhs &&
- turning_on_clk &&
host->timing == ios->timing &&
host->version >= SDHCI_SPEC_300 &&
(host->preset_enabled || host->drv_type == ios->drv_type) &&
--
2.34.1
next prev parent reply other threads:[~2022-11-24 17:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 17:06 [PATCH 0/4] mmc: sdhci: Fix voltage switch delay Adrian Hunter
2022-11-24 17:06 ` [PATCH 1/4] " Adrian Hunter
2022-11-25 9:41 ` Bough Chen
2022-11-25 10:04 ` Adrian Hunter
2022-11-25 12:01 ` Ulf Hansson
2022-11-28 11:13 ` Wenchao Chen
2022-11-28 13:38 ` Adrian Hunter
2022-11-24 17:06 ` Adrian Hunter [this message]
2022-11-24 17:06 ` [PATCH 3/4] mmc: sdhci: Avoid unnecessary ->set_clock() Adrian Hunter
2022-11-24 17:06 ` [PATCH 4/4] mmc: sdhci: Enable card clock instead of ->set_clock() Adrian Hunter
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=20221124170649.63851-3-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=alcooperx@gmail.com \
--cc=andrew@aj.id.au \
--cc=ben-linux@fluff.org \
--cc=briannorris@chromium.org \
--cc=chevron.li@bayhubtech.com \
--cc=eugen.hristev@microchip.com \
--cc=f.fainelli@gmail.com \
--cc=haibo.chen@nxp.com \
--cc=huziji@marvell.com \
--cc=jh80.chung@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=manjumb@synopsys.com \
--cc=prabu.t@synopsys.com \
--cc=quic_sartgarg@quicinc.com \
--cc=s.hauer@pengutronix.de \
--cc=thierry.reding@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=vigneshr@ti.com \
--cc=vireshk@kernel.org \
--cc=wenchao.chen@unisoc.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox