Patch "i2c: hisi: Avoid redundant interrupts" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    i2c: hisi: Avoid redundant interrupts

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i2c-hisi-avoid-redundant-interrupts.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e823e0028fbd44622350ee0bfc63a03ca35f6c0a
Author: Yicong Yang <yangyicong@xxxxxxxxxxxxx>
Date:   Mon Mar 13 15:45:51 2023 +0800

    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@xxxxxxxxxx>
    Signed-off-by: Yicong Yang <yangyicong@xxxxxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c
index 72e43ecaff133..1f406e6f4ece3 100644
--- a/drivers/i2c/busses/i2c-hisi.c
+++ b/drivers/i2c/busses/i2c-hisi.c
@@ -315,6 +315,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)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux