summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2015-11-19 16:56:48 +0100
committerWolfram Sang <wsa@the-dreams.de>2015-11-30 14:22:11 +0100
commitc3be0af15959e11fa535d5332ab3d7cf34abd09b (patch)
tree3a49e139c2b2cef1d6bfe5b2368dfe3cb15f9bd7 /drivers
parentd89667b14f9d13b684287f6189ca209af5feee43 (diff)
downloadlinux-stable-c3be0af15959e11fa535d5332ab3d7cf34abd09b.tar.gz
linux-stable-c3be0af15959e11fa535d5332ab3d7cf34abd09b.tar.bz2
linux-stable-c3be0af15959e11fa535d5332ab3d7cf34abd09b.zip
i2c: rcar: check master irqs before slave irqs
Due to the HW design, master IRQs are timing critical, so give them precedence over slave IRQ. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-rcar.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 87fccf20fc4c..f237b4fc5b5e 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -432,19 +432,17 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)
static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
{
struct rcar_i2c_priv *priv = ptr;
- irqreturn_t result = IRQ_HANDLED;
u32 msr;
- if (rcar_i2c_slave_irq(priv))
- goto exit;
-
msr = rcar_i2c_read(priv, ICMSR);
/* Only handle interrupts that are currently enabled */
msr &= rcar_i2c_read(priv, ICMIER);
if (!msr) {
- result = IRQ_NONE;
- goto exit;
+ if (rcar_i2c_slave_irq(priv))
+ return IRQ_HANDLED;
+
+ return IRQ_NONE;
}
/* Arbitration lost */
@@ -481,8 +479,7 @@ out:
wake_up(&priv->wait);
}
-exit:
- return result;
+ return IRQ_HANDLED;
}
static int rcar_i2c_master_xfer(struct i2c_adapter *adap,