Patchwork [2/3] mtd/spear_smi: clear status register on init

login
register
mail settings
Submitter Shiraz Hashim
Date July 2, 2012, 5:58 a.m.
Message ID <1341208727-22476-2-git-send-email-shiraz.hashim@st.com>
Download mbox | patch
Permalink /patch/168497/
State New
Headers show

Comments

Shiraz Hashim - July 2, 2012, 5:58 a.m.
It was observed that sometimes smi returned errors while resume from
suspend.

For safety reasons clear status register for any errors during init. In
absence of it smi can return failures during command transmissions.

Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
---
 drivers/mtd/devices/spear_smi.c |    3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index cffd36a..aec941e 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -336,6 +336,9 @@  static void spear_smi_hw_init(struct spear_smi *dev)
 	val = HOLD1 | BANK_EN | DSEL_TIME | (prescale << 8);
 
 	mutex_lock(&dev->lock);
+	/* clear all interrupt conditions */
+	writel(0, dev->io_base + SMI_SR);
+
 	writel(val, dev->io_base + SMI_CR1);
 	mutex_unlock(&dev->lock);
 }