linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* discrepancy while save and restore of debounce registers
@ 2012-10-17  6:13 Hebbar, Gururaja
  2012-10-17 21:12 ` Jon Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Hebbar, Gururaja @ 2012-10-17  6:13 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org
  Cc: linux-kernel@vger.kernel.org, grant.likely@secretlab.ca,
	linux-arm-kernel@lists.infradead.org, Tony Lindgren,
	Rajashekhara, Sudhakar, Nori, Sekhar

Hi,

I came across a peculiar issue while updating GPIO debounce registers on
OMAP platform.

According to mainline commit ae547354a8ed59f19b57f7e1de9c7816edfc3537

gpio/omap: save and restore debounce registers

GPIO debounce registers need to be saved and restored for proper functioning
of driver.

...
@@ -1363,6 +1369,12 @@ static void omap_gpio_restore_context(struct gpio_bank *bank)
        __raw_writel(bank->context.fallingdetect,
                                bank->base + bank->regs->fallingdetect);
        __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout);
+       if (bank->dbck_enable_mask) {
+               __raw_writel(bank->context.debounce, bank->base +
+                                       bank->regs->debounce);
+               __raw_writel(bank->context.debounce_en,
+                                       bank->base + bank->regs->debounce_en);
+       }
 }


Due to copy/paste of this commit into my local tree, I missed the check for 
bank->dbck_enable_mask, and directly restored the saved value from context.

After this, I saw random crashes when accessing different registers (sometimes
its OE register and sometime its DATAOUT register). 

These crashes were seen across 2nd and subsequent suspend/resume.

My doubt/questions are
1. Why should debounce registers be updated only when it's accessed previously?

2. What is the relation between updating debounce registers and crash seen on
others registers? 

Thanks in advance for the support.

Regards
Gururaja



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-02  9:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-17  6:13 discrepancy while save and restore of debounce registers Hebbar, Gururaja
2012-10-17 21:12 ` Jon Hunter
2012-10-18  5:31   ` Hebbar, Gururaja
2012-10-18 16:14     ` Jon Hunter
2012-11-02  9:44       ` Hebbar, Gururaja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).