i2c: rcar: check master irqs before slave irqs
commit c3be0af15959e11fa535d5332ab3d7cf34abd09b upstream. 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> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> Reviewed-by: Biju Das <biju.das@bp.renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b414f20d84
commit
fdcc1b764d
1 changed files with 5 additions and 8 deletions
|
@ -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 @@ out:
|
||||||
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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue