lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 14 Jan 2011 16:23:24 +0800
From:	Chuanxiao Dong <chuanxiao.dong@...el.com>
To:	linux-mmc@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, cjb@...top.org, ohad@...ery.com
Subject: [PATCH v1 3/3]mmc: not clock gate host when host is in runtime
	suspended state

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@...el.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ