From: Cory Maccarrone <darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Rajendra Nayak <rnayak-l0cyMroinI0@public.gmane.org>,
Jouni Hogander
<jouni.hogander-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>,
Jagadeesh Bhaskar Pakaravoor
<j-pakaravoor-l0cyMroinI0@public.gmane.org>,
Aaro Koskinen
<aaro.koskinen-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>,
Jon Hunter <jon-hunter-l0cyMroinI0@public.gmane.org>,
Hu Tao <taohu-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org>,
Xiaolong Chen <A21785-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org>,
Cory Maccarrone
<darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] [I2C] OMAP: Don't write IE state in unidle if 0
Date: Tue, 22 Dec 2009 18:06:13 -0700 [thread overview]
Message-ID: <1261530373-408-1-git-send-email-darkstar6262@gmail.com> (raw)
Commit ef871432... (i2c-omap: OMAP3: PM: (re)init for every transfer
to support off-mode) introduced a change which make the dev->iestate
contents be written to the OMAP_I2C_IE_REG every time omap_i2c_unidle
is called. Previously, the state was only written if it wasn't equal
to zero.
In omap_i2c_probe, omap_i2c_unidle() is called prior to omap_i2c_init(),
in which case dev->iestate has not yet been initialized and will be set
to zero. Having this value written to the registers causes deadlock
while booting.
As such, this change restores the original functionality.
Signed-off-by: Cory Maccarrone <darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/i2c/busses/i2c-omap.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 3440d88..c0bb9eb 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -248,7 +248,13 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN);
}
dev->idle = 0;
- omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
+
+ /*
+ * Don't write to this register if the IE state is 0 as it can
+ * cause deadlock.
+ */
+ if (dev->iestate)
+ omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
}
static void omap_i2c_idle(struct omap_i2c_dev *dev)
--
1.6.3.3
next reply other threads:[~2009-12-23 1:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-23 1:06 Cory Maccarrone [this message]
2009-12-28 20:19 ` [PATCH] [I2C] OMAP: Don't write IE state in unidle if 0 Tony Lindgren
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=1261530373-408-1-git-send-email-darkstar6262@gmail.com \
--to=darkstar6262-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=A21785-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org \
--cc=aaro.koskinen-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=j-pakaravoor-l0cyMroinI0@public.gmane.org \
--cc=jon-hunter-l0cyMroinI0@public.gmane.org \
--cc=jouni.hogander-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rnayak-l0cyMroinI0@public.gmane.org \
--cc=taohu-3WKxDLwmzFNWk0Htik3J/w@public.gmane.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).