summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2013-04-24 14:19:46 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-27 10:28:37 -0700
commit2f5949b9d2b8a852870c4b26ff84224d75fb46ad (patch)
tree5271a5b2aacc4e656ac5a25e374d26e09ee8df31 /drivers/mmc
parent6a7d2df0b0fa6daf46e6b9c6deaa441494d705ae (diff)
mmc: sdhci-msm: Read version register properly
The version register is only 16 bits wide but we use a readl to read it. Normally this wouldn't be a problem, but the register offset is 0xfe, something that is not word aligned. This causes crashes on THUMB2 kernels. Use readw instead to read the register properly and avoid any alignment issues. Change-Id: I3b8b14ce2f741631ef7554e3763d1d7f145077a8 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-msm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 0d2ce449b139..4c8631d5e3dc 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -2049,7 +2049,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
struct sdhci_msm_host *msm_host;
struct resource *core_memres = NULL;
int ret = 0, pwr_irq = 0, dead = 0;
- u32 host_version;
+ u16 host_version;
pr_debug("%s: Enter %s\n", dev_name(&pdev->dev), __func__);
msm_host = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_msm_host),
@@ -2177,7 +2177,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
host->quirks2 |= SDHCI_QUIRK2_BROKEN_PRESET_VALUE;
host->quirks2 |= SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT;
- host_version = readl_relaxed((host->ioaddr + SDHCI_HOST_VERSION));
+ host_version = readw_relaxed((host->ioaddr + SDHCI_HOST_VERSION));
dev_dbg(&pdev->dev, "Host Version: 0x%x Vendor Version 0x%x\n",
host_version, ((host_version & SDHCI_VENDOR_VER_MASK) >>
SDHCI_VENDOR_VER_SHIFT));