From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24F94C77B76 for ; Tue, 18 Apr 2023 12:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231983AbjDRMqP (ORCPT ); Tue, 18 Apr 2023 08:46:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231980AbjDRMqO (ORCPT ); Tue, 18 Apr 2023 08:46:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A26814F47 for ; Tue, 18 Apr 2023 05:46:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA182633A5 for ; Tue, 18 Apr 2023 12:46:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2C2DC4339E; Tue, 18 Apr 2023 12:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681821972; bh=wYI/r4tJiEhg6thiFHAvKr41kMTWCFXFYIv/1bsrBcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ITZcN8OjtVwo9ZXKsxIRr0UMW+yMGCLUaHw2ZBf5ulFlNBxn0oW1xSggzuys/Pxgx mkDEP/lqeGCXR2iAcJkBZS1bIdeC4jX5cR5Y3jqrONB5mXasZntrJk2Qu9Tv4Xegap zd1tH4pxvBvhyaQvOh9iN7Zmy+awq1nCwot7Jj80= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sheng Feng , Yicong Yang , Wolfram Sang , Sasha Levin Subject: [PATCH 6.1 078/134] i2c: hisi: Avoid redundant interrupts Date: Tue, 18 Apr 2023 14:22:14 +0200 Message-Id: <20230418120315.769412886@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418120313.001025904@linuxfoundation.org> References: <20230418120313.001025904@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yicong Yang [ 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 --- 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 d30071f299879..8a61bee745a16 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) -- 2.39.2