From: Ulf Hansson <ulf.hansson@linaro.org>
To: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: Ritesh Raj Sarraf <rrs@researchut.com>,
Alan Stern <stern@rowland.harvard.edu>,
Oliver Neukum <oneukum@suse.com>,
USB list <linux-usb@vger.kernel.org>,
Roger Tseng <rogerable@realtek.com>,
Wei WANG <wei_wang@realsil.com.cn>
Subject: [PATCH 6/6] mmc: core: Don't power off the card when starting the host
Date: Thu, 13 Oct 2016 13:37:40 +0200 [thread overview]
Message-ID: <1476358660-8338-7-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1476358660-8338-1-git-send-email-ulf.hansson@linaro.org>
The MMC_CAP2_NO_PRESCAN_POWERUP was invented to avoid running the power up
sequence, mmc_power_up(), during ->probe() of the mmc host driver, but
instead defer this to the mmc detect work. This is especially useful for
those hosts that suffers from a long initialization time, as this time
would otherwise add up to the total boot time.
However, due to the introduction of runtime PM of mmc host devices in the
mmc core, this behaviour changed a bit. More precisely, it caused the mmc
core to runtime resume the host device during ->probe() of the host driver.
In cases like the rtsx_usb_sdmmc, runtime resuming the device may be costly
and thus affecting the total boot time.
To improve this behaviour when using MMC_CAP2_NO_PRESCAN_POWERUP, let's
postpone also calling mmc_power_off() when starting the host. This change
allows the mmc core to avoid runtime resuming the device, as it don't need
to claim the host for that execution path.
Cc: Ritesh Raj Sarraf <rrs@researchut.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/core/core.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 2553d90..2ad7291 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2824,12 +2824,11 @@ void mmc_start_host(struct mmc_host *host)
host->rescan_disable = 0;
host->ios.power_mode = MMC_POWER_UNDEFINED;
- mmc_claim_host(host);
- if (host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP)
- mmc_power_off(host);
- else
+ if (!(host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP)) {
+ mmc_claim_host(host);
mmc_power_up(host, host->ocr_avail);
- mmc_release_host(host);
+ mmc_release_host(host);
+ }
mmc_gpiod_request_cd_irq(host);
_mmc_detect_change(host, 0, false);
--
1.9.1
next prev parent reply other threads:[~2016-10-13 11:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 11:37 [PATCH 0/6] mmc/memstick: rtsx_usb: Fix runtime PM issues Ulf Hansson
2016-10-13 11:37 ` [PATCH 1/6] mmc: rtsx_usb_sdmmc: Avoid keeping the device runtime resumed when unused Ulf Hansson
2016-10-13 11:37 ` [PATCH 2/6] mmc: rtsx_usb_sdmmc: Handle runtime PM while changing the led Ulf Hansson
2016-10-13 11:37 ` [PATCH 3/6] memstick: rtsx_usb_ms: Runtime resume the device when polling for cards Ulf Hansson
2016-10-13 11:37 ` [PATCH 4/6] memstick: rtsx_usb_ms: Manage runtime PM when accessing the device Ulf Hansson
2016-10-13 11:37 ` [PATCH 5/6] mmc: rtsx_usb_sdmmc: Enable runtime PM autosuspend Ulf Hansson
2016-10-13 11:37 ` Ulf Hansson [this message]
[not found] ` <1476358660-8338-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-10-17 13:49 ` [PATCH 0/6] mmc/memstick: rtsx_usb: Fix runtime PM issues Ulf Hansson
[not found] ` <CAPDyKFpzq2wRfh_5x119ouP-e8EAaibsSvM36msxm7oepxRoDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-17 16:34 ` Alan Stern
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=1476358660-8338-7-git-send-email-ulf.hansson@linaro.org \
--to=ulf.hansson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=rogerable@realtek.com \
--cc=rrs@researchut.com \
--cc=stern@rowland.harvard.edu \
--cc=wei_wang@realsil.com.cn \
/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