diff --git a/patches.kernel.org/6.2.12-084-i2c-hisi-Avoid-redundant-interrupts.patch b/patches.kernel.org/6.2.12-084-i2c-hisi-Avoid-redundant-interrupts.patch new file mode 100644 index 0000000..a819d5e --- /dev/null +++ b/patches.kernel.org/6.2.12-084-i2c-hisi-Avoid-redundant-interrupts.patch @@ -0,0 +1,44 @@ +From: Yicong Yang +Date: Mon, 13 Mar 2023 15:45:51 +0800 +Subject: [PATCH] i2c: hisi: Avoid redundant interrupts +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: cc9812a3096d1986caca9a23bee99effc45c08df + +[ 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 +Signed-off-by: Yicong Yang +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + drivers/i2c/busses/i2c-hisi.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c +index f5c37d2f..e067671b 100644 +--- a/drivers/i2c/busses/i2c-hisi.c ++++ b/drivers/i2c/busses/i2c-hisi.c +@@ -316,6 +316,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) +-- +2.35.3 + diff --git a/series.conf b/series.conf index d88a51e..1416041 100644 --- a/series.conf +++ b/series.conf @@ -2311,6 +2311,7 @@ patches.kernel.org/6.2.12-081-selftests-bpf-Fix-progs-find_vma_fail1.c-build.patch patches.kernel.org/6.2.12-082-wifi-mwifiex-mark-OF-related-data-as-maybe-unu.patch patches.kernel.org/6.2.12-083-i2c-imx-lpi2c-clean-rx-tx-buffers-upon-new-mes.patch + patches.kernel.org/6.2.12-084-i2c-hisi-Avoid-redundant-interrupts.patch ######################################################## # Build fixes that apply to the vanilla kernel too.