Skip to content

Commit cc9812a

Browse files
Yicong Yangwsakernel
authored andcommitted
i2c: hisi: Avoid redundant interrupts
After issuing all the messages we can disable the TX_EMPTY interrupts to avoid handling redundant interrupts. For doing a sinlge bus detection (i2cdetect -y -r 0) we can reduce ~97% interrupts (before ~12000 after ~400). Signed-off-by: Sheng Feng <[email protected]> Signed-off-by: Yicong Yang <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 5190417 commit cc9812a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/i2c/busses/i2c-hisi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ static void hisi_i2c_xfer_msg(struct hisi_i2c_controller *ctlr)
316316
max_write == 0)
317317
break;
318318
}
319+
320+
/*
321+
* Disable the TX_EMPTY interrupt after finishing all the messages to
322+
* avoid overwhelming the CPU.
323+
*/
324+
if (ctlr->msg_tx_idx == ctlr->msg_num)
325+
hisi_i2c_disable_int(ctlr, HISI_I2C_INT_TX_EMPTY);
319326
}
320327

321328
static irqreturn_t hisi_i2c_irq(int irq, void *context)

0 commit comments

Comments
 (0)