From: Chuanxiao Dong <chuanxiao.dong@intel.com>
To: linux-mmc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, cjb@laptop.org, ohad@wizery.com
Subject: [PATCH v1 3/3]mmc: not clock gate host when host is in runtime suspended state
Date: Fri, 14 Jan 2011 16:23:24 +0800 [thread overview]
Message-ID: <20110114082324.GD27523@intel.com> (raw)
Since mmc clock gating is done in a work queue which is not synchronized with
host runtime power management, when driver is doing clock gating, host may
has already been power gated.
So before driver clock gate host, check whether host is already suspended.
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
drivers/mmc/core/core.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index e296c5a..d2121fa 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -670,6 +670,17 @@ void mmc_gate_clock(struct mmc_host *host)
host->ios.clock = 0;
host->clk_gated = true;
spin_unlock_irqrestore(&host->clk_lock, flags);
+#ifdef CONFIG_PM_RUNTIME
+ /*
+ * mmc clock gating is done in a work queue which
+ * does not synchronized with host controller runtime
+ * power management. So when mmc gate clock, host may
+ * have already in runtime suspend state. In that case,
+ * driver cannot touch host controller registers
+ */
+ if (host->class_dev.power.runtime_status != RPM_ACTIVE)
+ return;
+#endif
mmc_set_ios(host);
}
--
1.6.6.1
reply other threads:[~2011-01-14 8:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110114082324.GD27523@intel.com \
--to=chuanxiao.dong@intel.com \
--cc=cjb@laptop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ohad@wizery.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.