From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] RTC: TWL: ensure all interrupts are disabled during probe
Date: Thu, 13 Sep 2012 13:45:57 -0700 [thread overview]
Message-ID: <1347569157-19262-1-git-send-email-khilman@deeprootsystems.com> (raw)
From: Kevin Hilman <khilman@ti.com>
On some platforms, bootloaders are known to do some interesting RTC
programming. Without going into the obscurities as to why this may be
the case, suffice it to say the the driver should not make any
assumptions about the state of the RTC when the driver loads. In
particular, the driver probe should be sure that all interrupts are
disabled until otherwise programmed.
This was discovered when finding bursty I2C traffic every second on
Overo platforms. This I2C overhead was keeping the SoC from hitting
deep power states. The cause was found to be the RTC firing every
second on the I2C-connected TWL PMIC.
Special thanks to Felipe Balbi for suggesting to look for a rogue
driver as the source of the I2C traffic rather than the I2C driver
itself.
Special thanks to Steve Sakoman for helping track down the source of
the continuous RTC interrups on the Overo boards.
Cc: Felipe Balbi <balbi@ti.com>
Cc: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
Patch applies to v3.6-rc5
drivers/rtc/rtc-twl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index c5d06fe..9277d94 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -495,6 +495,11 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
if (ret < 0)
goto out1;
+ /* ensure interrupts are disabled, bootloaders can be strange */
+ ret = twl_rtc_write_u8(0, REG_RTC_INTERRUPTS_REG);
+ if (ret < 0)
+ dev_warn(&pdev->dev, "unable to disable interrupt\n");
+
/* init cached IRQ enable bits */
ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG);
if (ret < 0)
--
1.7.9.2
next reply other threads:[~2012-09-13 20:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 20:45 Kevin Hilman [this message]
2012-09-14 11:42 ` [PATCH] RTC: TWL: ensure all interrupts are disabled during probe Shubhrajyoti Datta
2012-09-14 14:07 ` Kevin Hilman
2012-09-14 17:51 ` Shubhrajyoti Datta
2012-09-14 15:33 ` Steve Sakoman
2012-09-14 19:20 ` Andrew Morton
2012-09-14 19:44 ` Steve Sakoman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347569157-19262-1-git-send-email-khilman@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).