summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2013-08-07 18:40:29 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-27 10:28:51 -0700
commitd453e3e1fff3e16b37ab47665eabfa1acad81b84 (patch)
tree8724122745c4b84f2053fe67e1df007464858eb0 /drivers
parent39ba9d6667631c41453bd9a1ef83496ddc247e62 (diff)
mmc: sdhci: fix issue with auto cmd err detection
As per specification, auto cmd error status register is valid only when auto cmd error bit is set in Error interrupt status register. CRs-fixed: 515513 Change-Id: Id1013e1705d8efdba0171dcad14f783607d38ef3 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed minor merge conflict] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci.c10
-rw-r--r--drivers/mmc/host/sdhci.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c434771815dc..85dc8cd6d647 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -129,7 +129,7 @@ static void sdhci_dumpregs(struct sdhci_host *host)
sdhci_readl(host, SDHCI_INT_ENABLE),
sdhci_readl(host, SDHCI_SIGNAL_ENABLE));
pr_info(DRIVER_NAME ": AC12 err: 0x%08x | Slot int: 0x%08x\n",
- sdhci_readw(host, SDHCI_AUTO_CMD_ERR),
+ host->auto_cmd_err_sts,
sdhci_readw(host, SDHCI_SLOT_INT_STATUS));
pr_info(DRIVER_NAME ": Caps: 0x%08x | Caps_1: 0x%08x\n",
sdhci_readl(host, SDHCI_CAPABILITIES),
@@ -2480,6 +2480,7 @@ static void sdhci_tasklet_finish(unsigned long param)
host->mrq = NULL;
host->cmd = NULL;
host->data = NULL;
+ host->auto_cmd_err_sts = 0;
#ifndef SDHCI_USE_LEDS_CLASS
sdhci_deactivate_led(host);
@@ -2554,7 +2555,9 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask)
host->cmd->error = -EILSEQ;
if (intmask & SDHCI_INT_AUTO_CMD_ERR) {
- auto_cmd_status = sdhci_readw(host, SDHCI_AUTO_CMD_ERR);
+ auto_cmd_status = host->auto_cmd_err_sts;
+ pr_err("%s: %s: AUTO CMD err sts 0x%08x\n",
+ mmc_hostname(host->mmc), __func__, auto_cmd_status);
if (auto_cmd_status & (SDHCI_AUTO_CMD12_NOT_EXEC |
SDHCI_AUTO_CMD_INDEX_ERR |
SDHCI_AUTO_CMD_ENDBIT_ERR))
@@ -2811,6 +2814,9 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
}
do {
+ if (intmask & SDHCI_INT_AUTO_CMD_ERR)
+ host->auto_cmd_err_sts = sdhci_readw(host,
+ SDHCI_AUTO_CMD_ERR);
/* Clear selected interrupts. */
mask = intmask & (SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK |
SDHCI_INT_BUS_POWER);
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 9334741d2172..065e13abedfc 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -591,6 +591,8 @@ struct sdhci_host {
enum sdhci_power_policy power_policy;
+ u32 auto_cmd_err_sts;
+
unsigned long private[0] ____cacheline_aligned;
};