Skip to content

Commit 545f401

Browse files
rayagondawsakernel
authored andcommitted
i2c: iproc: handle only slave interrupts which are enabled
Handle only slave interrupts which are enabled. The IS_OFFSET register contains the interrupt status bits which will be set regardless of the enabling of the corresponding interrupt condition. One must therefore look at both IS_OFFSET and IE_OFFSET to determine whether an interrupt condition is set and enabled. Fixes: c245d94 ("i2c: iproc: Add multi byte read-write support for slave mode") Signed-off-by: Rayagonda Kokatanur <[email protected]> Acked-by: Ray Jui <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 1ca1b45 commit 545f401

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/i2c/busses/i2c-bcm-iproc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,12 +507,17 @@ static void bcm_iproc_i2c_process_m_event(struct bcm_iproc_i2c_dev *iproc_i2c,
507507
static irqreturn_t bcm_iproc_i2c_isr(int irq, void *data)
508508
{
509509
struct bcm_iproc_i2c_dev *iproc_i2c = data;
510-
u32 status = iproc_i2c_rd_reg(iproc_i2c, IS_OFFSET);
510+
u32 slave_status;
511+
u32 status;
511512
bool ret;
512-
u32 sl_status = status & ISR_MASK_SLAVE;
513513

514-
if (sl_status) {
515-
ret = bcm_iproc_i2c_slave_isr(iproc_i2c, sl_status);
514+
status = iproc_i2c_rd_reg(iproc_i2c, IS_OFFSET);
515+
/* process only slave interrupt which are enabled */
516+
slave_status = status & iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET) &
517+
ISR_MASK_SLAVE;
518+
519+
if (slave_status) {
520+
ret = bcm_iproc_i2c_slave_isr(iproc_i2c, slave_status);
516521
if (ret)
517522
return IRQ_HANDLED;
518523
else

0 commit comments

Comments
 (0)