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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Aug 2015 15:45:17 +0530
From:	Kishon Vijay Abraham I <kishon@...com>
To:	<ulf.hansson@...aro.org>, <linux-mmc@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <nsekhar@...com>
CC:	<adrian.hunter@...el.com>, <neilb@...e.de>,
	<zhonghui.fu@...ux.intel.com>, <afenkart@...il.com>,
	<kishon@...com>
Subject: [RFC PATCH 2/2] mmc: core: sdio: claim host before power up or power off

mmc_sdio_runtime_resume and mmc_sdio_runtime_suspend does power up and
power off respectively but does so without claiming the host. Among other
things mmc_claim_host inovkes pm_runtime_get_sync to enable the clocks.
Invoke mmc_claim_host before mmc_power_up and mmc_power_off in
mmc_sdio_runtime_resume and mmc_sdio_runtime_suspend respectively.

This is required since certain platforms (like TI SoCs) access
the controller registers during power up.

Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
---
 drivers/mmc/core/sdio.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 0cbbfb8..40795b2 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1023,16 +1023,24 @@ static int mmc_sdio_power_restore(struct mmc_host *host)
 
 static int mmc_sdio_runtime_suspend(struct mmc_host *host)
 {
+	mmc_claim_host(host);
 	/* No references to the card, cut the power to it. */
 	mmc_power_off(host);
+	mmc_release_host(host);
 	return 0;
 }
 
 static int mmc_sdio_runtime_resume(struct mmc_host *host)
 {
+	int ret;
+
+	mmc_claim_host(host);
 	/* Restore power and re-initialize. */
 	mmc_power_up(host, host->card->ocr);
-	return mmc_sdio_power_restore(host);
+	ret = _mmc_sdio_power_restore(host);
+	mmc_release_host(host);
+
+	return ret;
 }
 
 static int mmc_sdio_reset(struct mmc_host *host)
-- 
1.7.9.5

--
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