From: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
To: wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c-rcar: fix MNR interrupt handling
Date: Tue, 02 Sep 2014 22:29:06 +0400 [thread overview]
Message-ID: <54060C72.3010309@cogentembedded.com> (raw)
In-Reply-To: <1843756.qQiZLxsyqD-gHKXc3Y1Z8zGSmamagVegGFoWSdPRAKMAL8bYrjMMd8@public.gmane.org>
On 09/02/2014 01:15 AM, Sergei Shtylyov wrote:
> Sometimes the MNR and MST interrupts happen simultaneously (stop automatically
> follows NACK, according to the manuals) and in such case the ID_NACK flag isn't
> set since the MST interrupt handling precedes MNR and all interrupts are cleared
> and disabled then, so that MNR interrupt is never noticed -- this causes NACK'ed
> transfers to be falsely reported as successful. Exchanging MNR and MST handlers
> fixes this issue, however the MNR bit somehow gets set again even after being
> explicitly cleared, so I decided to completely suppress handling of all disabled
> interrupts (which is a good thing anyway)...
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
> The patch is against Wolfram Sang's 'linux.git' repo.
> drivers/i2c/busses/i2c-rcar.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> Index: linux/drivers/i2c/busses/i2c-rcar.c
> ===================================================================
> --- linux.orig/drivers/i2c/busses/i2c-rcar.c
> +++ linux/drivers/i2c/busses/i2c-rcar.c
> @@ -367,18 +367,15 @@ static irqreturn_t rcar_i2c_irq(int irq,
>
> msr = rcar_i2c_read(priv, ICMSR);
>
> + /* Only handle interrupts that are currently enabled */
> + msr &= rcar_i2c_read(priv, ICMIER);
> +
I think it makes sense to check 'msr' for 0 and return IRQ_NONE in this
case. Would you apply such patch (probably to the -next branch)?
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c-rcar: fix MNR interrupt handling
Date: Tue, 02 Sep 2014 18:29:06 +0000 [thread overview]
Message-ID: <54060C72.3010309@cogentembedded.com> (raw)
In-Reply-To: <1843756.qQiZLxsyqD-gHKXc3Y1Z8zGSmamagVegGFoWSdPRAKMAL8bYrjMMd8@public.gmane.org>
On 09/02/2014 01:15 AM, Sergei Shtylyov wrote:
> Sometimes the MNR and MST interrupts happen simultaneously (stop automatically
> follows NACK, according to the manuals) and in such case the ID_NACK flag isn't
> set since the MST interrupt handling precedes MNR and all interrupts are cleared
> and disabled then, so that MNR interrupt is never noticed -- this causes NACK'ed
> transfers to be falsely reported as successful. Exchanging MNR and MST handlers
> fixes this issue, however the MNR bit somehow gets set again even after being
> explicitly cleared, so I decided to completely suppress handling of all disabled
> interrupts (which is a good thing anyway)...
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Cc: stable@vger.kernel.org
> ---
> The patch is against Wolfram Sang's 'linux.git' repo.
> drivers/i2c/busses/i2c-rcar.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> Index: linux/drivers/i2c/busses/i2c-rcar.c
> =================================> --- linux.orig/drivers/i2c/busses/i2c-rcar.c
> +++ linux/drivers/i2c/busses/i2c-rcar.c
> @@ -367,18 +367,15 @@ static irqreturn_t rcar_i2c_irq(int irq,
>
> msr = rcar_i2c_read(priv, ICMSR);
>
> + /* Only handle interrupts that are currently enabled */
> + msr &= rcar_i2c_read(priv, ICMIER);
> +
I think it makes sense to check 'msr' for 0 and return IRQ_NONE in this
case. Would you apply such patch (probably to the -next branch)?
WBR, Sergei
next prev parent reply other threads:[~2014-09-02 18:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-01 21:15 [PATCH] i2c-rcar: fix MNR interrupt handling Sergei Shtylyov
2014-09-01 21:15 ` Sergei Shtylyov
2014-09-02 10:28 ` Wolfram Sang
2014-09-02 10:28 ` Wolfram Sang
[not found] ` <1843756.qQiZLxsyqD-gHKXc3Y1Z8zGSmamagVegGFoWSdPRAKMAL8bYrjMMd8@public.gmane.org>
2014-09-02 18:29 ` Sergei Shtylyov [this message]
2014-09-02 18:29 ` Sergei Shtylyov
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=54060C72.3010309@cogentembedded.com \
--to=sergei.shtylyov-m4dtvfq/zs1mrggop+s0pdbpr1lh4cv8@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.