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:	Fri, 18 Mar 2011 15:11:59 -0700
From:	"Luis R. Rodriguez" <lrodriguez@...eros.com>
To:	<cjb@...top.org>
CC:	<linux-mmc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<vmehta@...eros.com>, <naveen.singh@...eros.com>,
	<kvalo@...rom.com>, <j@...fi>,
	"Luis R. Rodriguez" <lrodriguez@...eros.com>,
	Naveen Singh <nsingh@...eros.com>,
	Vipin Mehta <Vipin.Mehta@...eros.com>
Subject: [RFC 3/4] sdhci: cache when the MMC bus width is 4 bits wide

This can later be used when we send commands.

Cc: Chris Ball <cjb@...top.org>
Cc: Kalle Valo <kvalo@...rom.com>
Cc: Naveen Singh <nsingh@...eros.com>
Cc: Vipin Mehta <Vipin.Mehta@...eros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@...eros.com>
---
 drivers/mmc/host/sdhci.c  |    7 +++++--
 include/linux/mmc/sdhci.h |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 7074870..a4cf0c0 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1206,10 +1206,13 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		} else {
 			if (host->version >= SDHCI_SPEC_300)
 				ctrl &= ~SDHCI_CTRL_8BITBUS;
-			if (ios->bus_width == MMC_BUS_WIDTH_4)
+			if (ios->bus_width == MMC_BUS_WIDTH_4) {
 				ctrl |= SDHCI_CTRL_4BITBUS;
-			else
+				host->flags |= SDHCI_IN_4BIT_MODE;
+			} else {
 				ctrl &= ~SDHCI_CTRL_4BITBUS;
+				host->flags &= ~SDHCI_IN_4BIT_MODE;
+			}
 		}
 		sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 	}
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 83bd9f7..266f796 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -109,6 +109,7 @@ struct sdhci_host {
 #define SDHCI_USE_ADMA		(1<<1)	/* Host is ADMA capable */
 #define SDHCI_REQ_USE_DMA	(1<<2)	/* Use DMA for this req. */
 #define SDHCI_DEVICE_DEAD	(1<<3)	/* Device unresponsive */
+#define SDHCI_IN_4BIT_MODE	(1<<4)  /* bus is in 4-bit mode */
 
 	unsigned int version;	/* SDHCI spec. version */
 
-- 
1.7.4.15.g7811d

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