From: maxime.ripard@bootlin.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 7/7] mmc: sunxi: Drop the init / reset of the controller from set_ios
Date: Mon, 16 Apr 2018 16:23:05 +0200 [thread overview]
Message-ID: <68af0c20ec99bda4af61d413e5feee75f0577292.1523888566.git-series.maxime.ripard@bootlin.com> (raw)
In-Reply-To: <cover.e9b9c0ab5bc9ffcc52a15e1c2f41462729da5b61.1523888566.git-series.maxime.ripard@bootlin.com>
Our set_ios hook is, when the card is power up or down, either doing a full
init or put our controller back into a reset mode.
Since we're also doing that in our runtime_pm hooks, and at possibly much
more often, we can drop it from the set_ios, and either rely on our
runtime_pm hooks or our probe to do it.
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
drivers/mmc/host/sunxi-mmc.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 0253deb153a4..97c6b79b7d6f 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -939,14 +939,7 @@ static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct sunxi_mmc_host *host = mmc_priv(mmc);
- if (ios->power_mode == MMC_POWER_OFF)
- sunxi_mmc_reset_host(host);
-
sunxi_mmc_card_power(host, ios);
-
- if (ios->power_mode == MMC_POWER_UP)
- sunxi_mmc_init_host(host);
-
sunxi_mmc_set_bus_width(host, ios->bus_width);
sunxi_mmc_set_clk(host, ios);
}
@@ -1401,6 +1394,10 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
if (ret)
goto error_free_dma;
+ ret = sunxi_mmc_init_host(host);
+ if (ret)
+ goto error_free_dma;
+
pm_runtime_set_active(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
pm_runtime_use_autosuspend(&pdev->dev);
--
git-series 0.9.1
next prev parent reply other threads:[~2018-04-16 14:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 14:22 [PATCH v3 0/7] mmc: sunxi: Add runtime PM support Maxime Ripard
2018-04-16 14:22 ` [PATCH v3 1/7] mmc: sunxi: Reorder the headers Maxime Ripard
2018-04-16 14:23 ` [PATCH v3 2/7] mmc: sunxi: Change sunxi_mmc_init_host argument type Maxime Ripard
2018-04-16 14:23 ` [PATCH v3 3/7] mmc: sunxi: Move bus width configuration to a function Maxime Ripard
2018-04-16 14:23 ` [PATCH v3 4/7] mmc: sunxi: Move clock " Maxime Ripard
2018-04-16 14:23 ` [PATCH v3 5/7] mmc: sunxi: Move the card power " Maxime Ripard
2018-04-16 14:23 ` [PATCH v3 6/7] mmc: sunxi: Add runtime_pm support Maxime Ripard
2018-06-14 14:11 ` Marc Zyngier
2018-06-14 18:57 ` Kevin Hilman
2018-06-15 8:55 ` Ulf Hansson
2018-06-15 14:45 ` Kevin Hilman
2018-06-15 15:12 ` Maxime Ripard
2018-06-26 9:09 ` Maxime Ripard
2018-04-16 14:23 ` Maxime Ripard [this message]
2018-04-19 13:17 ` [PATCH v3 0/7] mmc: sunxi: Add runtime PM support Ulf Hansson
2018-07-16 17:14 ` Ondřej Jirman
2018-07-20 14:51 ` Maxime Ripard
2018-07-23 16:16 ` Ondřej Jirman
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=68af0c20ec99bda4af61d413e5feee75f0577292.1523888566.git-series.maxime.ripard@bootlin.com \
--to=maxime.ripard@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).