[PATCH Vn] OMAP: Fix for bus width which improves SD card's peformance.

From: kishore kadiyala
Date: Wed Mar 31 2010 - 03:03:01 EST


This patch improves low speeds for SD cards.
OMAP-MMC controller's can support maximum bus width of '8'.
when bus width is mentioned as "8" in controller data,the SD
stack will check whether bus width is "4" and if not it will
set bus width to "1" and there by degrading performance.
This patch fixes the issue and improves the performance of
SD cards.

Signed-off-by: Kishore Kadiyala <kishore.kadiyala@xxxxxx>
Signed-off-by: Venkatraman S <svenkatr@xxxxxx>
Acked-by: Madhusudhan Chikkature <madhu.cr@xxxxxx>
Tested-by: Jarkko Nikula <jhnikula@xxxxxxxxx>
---
NM Note:
Completely untested/unreviewed.. just holding on to
what was in https://patchwork.kernel.org/patch/89898/
with my suggested mods
drivers/mmc/host/omap_hsmmc.c | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 83f0aff..89e26bc 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2091,10 +2091,36 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
MMC_CAP_WAIT_WHILE_BUSY;

- if (mmc_slot(host).wires >= 8)
+ switch(mmc_slot(host).wires) {
+ case 8:
mmc->caps |= MMC_CAP_8_BIT_DATA;
- else if (mmc_slot(host).wires >= 4)
- mmc->caps |= MMC_CAP_4_BIT_DATA;
+ /* Fall through */
+ case 4:
+ mmc->caps |= MMC_CAP_8_BIT_DATA;
+ break;
+ case 1:
+ /*
+ * I will still survive with this config.. but warn
+ * if the board file was goofed up
+ */
+ dev_warn(mmc_dev(host->mmc), "Using potentially"
+ "unoptimal 1bit config\n");
+ break;
+ default:
+ /* Completely unexpected.. dont wanna croak and die */
+ dev_crit(mmc_dev(host->mmc), "Unknown width %d"
+ "used!\n",mmc_slot(host).wires);
+ mmc_host_disable(host->mmc);
+ if (host->got_dbclk) {
+ clk_disable(host->dbclk);
+ clk_put(host->dbclk);
+ }
+ clk_disable(host->iclk);
+ clk_put(host->iclk);
+ clk_put(host->fclk);
+ goto err1;
+
+ }

if (mmc_slot(host).nonremovable)
mmc->caps |= MMC_CAP_NONREMOVABLE;
--
1.6.3.3


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