From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Vincent Palatin
<vpalatin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
Rakesh Iyer <riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Lucas De Marchi
<lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] i2c: tegra: Check for overflow errors with BUG_ON.
Date: Mon, 15 Aug 2011 22:17:46 +0300 [thread overview]
Message-ID: <20110815191745.GA7178@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <1313434172-18319-1-git-send-email-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]
Hi,
On Mon, Aug 15, 2011 at 11:49:32AM -0700, Doug Anderson wrote:
> This change doesn't fix any known problems but turns
> on the overflow detection feature of the i2c controller
> in the hopes of flushing out any current (or future)
> bugs in the i2c driver.
>
> Inspired by a change on nvidia's git server:
> http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=commit;h=266d1b7397284505e55d06254b497cb32be07b69
>
> Signed-off-by: Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-tegra.c | 11 ++++++++---
> 1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index 2440b74..4dbba23 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -367,7 +367,8 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
> static irqreturn_t tegra_i2c_isr(int irq, void *dev_id)
> {
> u32 status;
> - const u32 status_err = I2C_INT_NO_ACK | I2C_INT_ARBITRATION_LOST;
> + const u32 status_err = I2C_INT_NO_ACK | I2C_INT_ARBITRATION_LOST |
> + I2C_INT_TX_FIFO_OVERFLOW;
> struct tegra_i2c_dev *i2c_dev = dev_id;
>
> status = i2c_readl(i2c_dev, I2C_INT_STATUS);
> @@ -389,6 +390,9 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id)
> }
>
> if (unlikely(status & status_err)) {
> + /* Don't pass this back--it can only happen due to a bug. */
> + BUG_ON(status & I2C_INT_TX_FIFO_OVERFLOW);
so due to a FIFO overflow you lock up the whole system ? Can't you e.g.
reset the controller and reconfigure it rather than locking up the
system ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2011-08-15 19:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-15 18:49 [PATCH] i2c: tegra: Check for overflow errors with BUG_ON Doug Anderson
[not found] ` <1313434172-18319-1-git-send-email-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-08-15 19:17 ` Felipe Balbi [this message]
[not found] ` <20110815191745.GA7178-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-08-15 19:52 ` Doug Anderson
2011-08-15 20:03 ` Felipe Balbi
[not found] ` <20110815200349.GA2616-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-08-23 18:39 ` Ben Dooks
2011-08-16 1:32 ` [PATCH v2] " Doug Anderson
2011-08-16 2:26 ` Stephen Warren
[not found] ` <1313458336-31456-1-git-send-email-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-08-16 6:34 ` Felipe Balbi
2011-08-16 18:00 ` Rhyland Klein
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=20110815191745.GA7178@legolas.emea.dhcp.ti.com \
--to=balbi-l0cymroini0@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw@public.gmane.org \
--cc=riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=vpalatin-F7+t8E8rja9g9hUCZPvPmw@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).