Commit c3be0af1 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent d89667b1
...@@ -432,19 +432,17 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv) ...@@ -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) static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
{ {
struct rcar_i2c_priv *priv = ptr; struct rcar_i2c_priv *priv = ptr;
irqreturn_t result = IRQ_HANDLED;
u32 msr; u32 msr;
if (rcar_i2c_slave_irq(priv))
goto exit;
msr = rcar_i2c_read(priv, ICMSR); msr = rcar_i2c_read(priv, ICMSR);
/* Only handle interrupts that are currently enabled */ /* Only handle interrupts that are currently enabled */
msr &= rcar_i2c_read(priv, ICMIER); msr &= rcar_i2c_read(priv, ICMIER);
if (!msr) { if (!msr) {
result = IRQ_NONE; if (rcar_i2c_slave_irq(priv))
goto exit; return IRQ_HANDLED;
return IRQ_NONE;
} }
/* Arbitration lost */ /* Arbitration lost */
...@@ -481,8 +479,7 @@ static irqreturn_t rcar_i2c_irq(int irq, void *ptr) ...@@ -481,8 +479,7 @@ static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
wake_up(&priv->wait); wake_up(&priv->wait);
} }
exit: return IRQ_HANDLED;
return result;
} }
static int rcar_i2c_master_xfer(struct i2c_adapter *adap, static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment