mtd: spear_smi: clear status register on init

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jul 6 13:59:09 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4dc48c37d1ce968b5ade7d1646927199ee536129
Commit:     4dc48c37d1ce968b5ade7d1646927199ee536129
Parent:     770daa43379690667e6552d68d343111b357341d
Author:     Shiraz Hashim <shiraz.hashim at st.com>
AuthorDate: Mon Jul 2 11:28:46 2012 +0530
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jul 6 18:27:38 2012 +0100

    mtd: spear_smi: clear status register on init
    
    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 at st.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/devices/spear_smi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

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);
 }



More information about the linux-mtd-cvs mailing list