diff options
author | Yicong Yang <yangyicong@hisilicon.com> | 2023-03-13 10:45:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-04-20 13:35:11 +0300 |
commit | a1cfba54130066bc89764ab6adcad8ef952eb12b (patch) | |
tree | 2bd5c5de0a7e77f08b0970d7c06fc9fb804d1dca /drivers/i2c | |
parent | bd51c04b7e188e06ed09fa3e48bc65f57307ce50 (diff) | |
download | linux-a1cfba54130066bc89764ab6adcad8ef952eb12b.tar.xz |
i2c: hisi: Avoid redundant interrupts
[ Upstream commit cc9812a3096d1986caca9a23bee99effc45c08df ]
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 <fengsheng5@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-hisi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c index d30071f29987..8a61bee745a1 100644 --- a/drivers/i2c/busses/i2c-hisi.c +++ b/drivers/i2c/busses/i2c-hisi.c @@ -314,6 +314,13 @@ static void hisi_i2c_xfer_msg(struct hisi_i2c_controller *ctlr) max_write == 0) break; } + + /* + * Disable the TX_EMPTY interrupt after finishing all the messages to + * avoid overwhelming the CPU. + */ + if (ctlr->msg_tx_idx == ctlr->msg_num) + hisi_i2c_disable_int(ctlr, HISI_I2C_INT_TX_EMPTY); } static irqreturn_t hisi_i2c_irq(int irq, void *context) |