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]
Message-ID: <8dae3acf6ece45ee4698991c1409dd5d45ff3cfe.1429845922.git.micky_ching@realsil.com.cn>
Date:	Wed, 29 Apr 2015 09:23:42 +0800
From:	<micky_ching@...lsil.com.cn>
To:	<chris@...ntf.net>, <ulf.hansson@...aro.org>,
	<sameo@...ux.intel.com>
CC:	<gregkh@...uxfoundation.org>, <dan.carpenter@...cle.com>,
	<devel@...uxdriverproject.org>, <linux-kernel@...r.kernel.org>,
	<linux-mmc@...r.kernel.org>, <rogerable@...ltek.com>,
	<wei_wang@...lsil.com.cn>, Micky Ching <micky_ching@...lsil.com.cn>
Subject: [PATCH 10/12] mmc: sdhci: disable clock control for SD4.0 mode

From: Micky Ching <micky_ching@...lsil.com.cn>

Skip clock control settings for UHSII mode. When card is in UHSII mode,
we only allow poweroff.

Signed-off-by: Micky Ching <micky_ching@...lsil.com.cn>
Signed-off-by: Wei Wang <wei_wang@...lsil.com.cn>
---
 drivers/mmc/host/sdhci.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 3c56944..03df58c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1346,7 +1346,8 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
 
 	host->mmc->actual_clock = 0;
 
-	sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
+	if (!host->uhsii_if_enabled)
+		sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
 
 	if (clock == 0)
 		return;
@@ -1686,7 +1687,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
 		!(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN))
 		sdhci_enable_preset_value(host, false);
 
-	if (!ios->clock || ios->clock != host->clock) {
+	if (!host->uhsii_if_enabled &&
+		(!ios->clock || ios->clock != host->clock)) {
 		host->ops->set_clock(host, ios->clock);
 		host->clock = ios->clock;
 
@@ -1703,7 +1705,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
 		}
 	}
 
-	sdhci_set_power(host, ios->power_mode, ios->vdd);
+	if (!(host->uhsii_if_enabled && (ios->power_mode != MMC_POWER_OFF)))
+		sdhci_set_power(host, ios->power_mode, ios->vdd);
 
 	if (host->ops->platform_send_init_74_clocks)
 		host->ops->platform_send_init_74_clocks(host, ios->power_mode);
@@ -1765,10 +1768,12 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
 			host->ops->set_clock(host, host->clock);
 		}
 
-		/* Reset SD Clock Enable */
-		clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
-		clk &= ~SDHCI_CLOCK_CARD_EN;
-		sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
+		if (!host->uhsii_if_enabled) {
+			/* Reset SD Clock Enable */
+			clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
+			clk &= ~SDHCI_CLOCK_CARD_EN;
+			sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
+		}
 
 		host->ops->set_uhs_signaling(host, ios->timing);
 		host->timing = ios->timing;
@@ -1788,7 +1793,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
 		}
 
 		/* Re-enable SD Clock */
-		host->ops->set_clock(host, host->clock);
+		if (!host->uhsii_if_enabled)
+			host->ops->set_clock(host, host->clock);
 	} else
 		sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 
-- 
1.9.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