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: [PATCH] i2c-rcar: check for no IRQ in rcar_i2c_irq()
Date: Mon, 15 Sep 2014 00:20:19 +0400 [thread overview]
Message-ID: <3921243.2t7X6eKC2i@wasted.cogentembedded.com> (raw)
Check if the ICMSR register (masked with the ICMIER register) evaluates to 0 in
the driver's interrupt handler and return IRQ_NONE in that case, like many other
drivers do.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
---
The patch is against Wolfram Sang's 'linux.git' repo's 'i2c/for-next' branch
plus 3 cleanup patches just re-posted.
drivers/i2c/busses/i2c-rcar.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Index: renesas/drivers/i2c/busses/i2c-rcar.c
===================================================================
--- renesas.orig/drivers/i2c/busses/i2c-rcar.c
+++ renesas/drivers/i2c/busses/i2c-rcar.c
@@ -361,6 +361,7 @@ static void rcar_i2c_irq_recv(struct rca
static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
{
struct rcar_i2c_priv *priv = ptr;
+ irqreturn_t result = IRQ_HANDLED;
u32 msr;
/*-------------- spin lock -----------------*/
@@ -370,6 +371,10 @@ static irqreturn_t rcar_i2c_irq(int irq,
/* Only handle interrupts that are currently enabled */
msr &= rcar_i2c_read(priv, ICMIER);
+ if (!msr) {
+ result = IRQ_NONE;
+ goto exit;
+ }
/* Arbitration lost */
if (msr & MAL) {
@@ -404,10 +409,11 @@ out:
wake_up(&priv->wait);
}
+exit:
spin_unlock(&priv->lock);
/*-------------- spin unlock -----------------*/
- return IRQ_HANDLED;
+ return result;
}
static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
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: [PATCH] i2c-rcar: check for no IRQ in rcar_i2c_irq()
Date: Sun, 14 Sep 2014 20:20:19 +0000 [thread overview]
Message-ID: <3921243.2t7X6eKC2i@wasted.cogentembedded.com> (raw)
Check if the ICMSR register (masked with the ICMIER register) evaluates to 0 in
the driver's interrupt handler and return IRQ_NONE in that case, like many other
drivers do.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against Wolfram Sang's 'linux.git' repo's 'i2c/for-next' branch
plus 3 cleanup patches just re-posted.
drivers/i2c/busses/i2c-rcar.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Index: renesas/drivers/i2c/busses/i2c-rcar.c
=================================--- renesas.orig/drivers/i2c/busses/i2c-rcar.c
+++ renesas/drivers/i2c/busses/i2c-rcar.c
@@ -361,6 +361,7 @@ static void rcar_i2c_irq_recv(struct rca
static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
{
struct rcar_i2c_priv *priv = ptr;
+ irqreturn_t result = IRQ_HANDLED;
u32 msr;
/*-------------- spin lock -----------------*/
@@ -370,6 +371,10 @@ static irqreturn_t rcar_i2c_irq(int irq,
/* Only handle interrupts that are currently enabled */
msr &= rcar_i2c_read(priv, ICMIER);
+ if (!msr) {
+ result = IRQ_NONE;
+ goto exit;
+ }
/* Arbitration lost */
if (msr & MAL) {
@@ -404,10 +409,11 @@ out:
wake_up(&priv->wait);
}
+exit:
spin_unlock(&priv->lock);
/*-------------- spin unlock -----------------*/
- return IRQ_HANDLED;
+ return result;
}
static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
next reply other threads:[~2014-09-14 20:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-14 20:20 Sergei Shtylyov [this message]
2014-09-14 20:20 ` [PATCH] i2c-rcar: check for no IRQ in rcar_i2c_irq() Sergei Shtylyov
[not found] ` <3921243.2t7X6eKC2i-gHKXc3Y1Z8zGSmamagVegGFoWSdPRAKMAL8bYrjMMd8@public.gmane.org>
2014-09-20 9:59 ` Wolfram Sang
2014-09-20 9:59 ` Wolfram Sang
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=3921243.2t7X6eKC2i@wasted.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.