Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp456118rdf; Fri, 3 Nov 2023 05:59:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEx8sW3O3hNXaR2Fmb1Zf4cJrozQsehJaWIHDJCMGhZb4D3m2jskaz0qpO1fZWgw94YxDiN X-Received: by 2002:a17:902:f990:b0:1cc:1ee2:d41d with SMTP id ky16-20020a170902f99000b001cc1ee2d41dmr16467575plb.39.1699016391462; Fri, 03 Nov 2023 05:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699016391; cv=none; d=google.com; s=arc-20160816; b=tmK+2OiqksVkPvRFIvq7eWQJNJhM9TvnINV4KH5qy5ygruiY0U9o4sJRzHcFe4zkKm k/3f8hDU9Jkyf7bzxBdGRPpI9YG+wBo9U59Nkbz0gQHEH8LQ4hc/bu28uzWG4FD4W9+5 tlkXYBmGMgAgyDUvxvmdA0dabd9FAx0rJu4/sUq4wRsPVWQK3V2re68xi0mgzfPa2DQV J80ASS3T9RCueGjVB1EzMJ/I1uV/HrsI/OhJhPLz9QteDJSt8hvj1nk8WomeOulrx3VD 8Iyxa4GKoHyoM5+NOXHeh5iUoOweViO4PDCbub8qOVsHJxQjwbbdC3rpM9BmWqeeQGBE ppNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rLj0iXnce7X5gLVQ37qdMv4tcLFEkr5VKZUTrqngcP0=; fh=D/N/7wbk2vteR7OuHqXLZ7aVE4yCwBKDKDJwtf2E2mY=; b=qWFy+kZXtoiVJFxmZ61hn6nIYuXqPNIH8raHyaVX+OgCgKzHPdoG4xS95goL3yKQpp Or5+4m5gYbi9KAGaYG93V5aowTsOQ79lPLvFnN3BqekSnQ1mvJCtm6jGO7eGEoHBEOGE RUhSQLHr22sBmkdcfsH1GzoeYM4CHZnYEh2IF20A1z2t2Z2fDAhHmYmBYUfp6D3HDi8f +FS5dkcB7VXIvUibxkn+sTzmY9OrqZLTU1BBrhNk2Jrt1IgrACyijs1k4ha5wqGKrSgT 3M24ob3++5VKomlADa1TcZiqcWVqC3V+5xOAgWcKNf6qap6VKHgWCgwDdrBuxOX2AD9o m4EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hG4J2C6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o6-20020a17090323c600b001cc6529c7besi1448704plh.88.2023.11.03.05.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 05:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hG4J2C6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A1DB881E5E6B; Fri, 3 Nov 2023 05:59:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230115AbjKCM7a (ORCPT + 99 others); Fri, 3 Nov 2023 08:59:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjKCM73 (ORCPT ); Fri, 3 Nov 2023 08:59:29 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F8AD83; Fri, 3 Nov 2023 05:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699016363; x=1730552363; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=LUZaFXx8eCpqoFt+eWSDUqbx3codm6TDAZME80lLwFU=; b=hG4J2C6Z0x6I0lnjP6eEv+d87aZU5u2mUtlrdBf3wSgY3TpwvdxKJJOI gyqS0ClNvxcQDzaeaSQMm/PrzmDtQlmzFh3exE/uapsqUCcl1RSJf8ZG3 Tt0clrKIhFhLVasAw9Gqp5dUdaAMDZnBQhBUB11QCrpSgiPeJhen8+QWl YblCYmbSIwYPP99cqVHGByJe1RGz9LPD9CIM1sDNq3Vu5IN47ERnHfLHP gJ9Dwz67IJMwrvVHFR3qefIxagv6INmVZb26dlEKte9R+9r4uPzAmo1at YVOW2YWYyY5n+ps8lhzHyTIjKWKttUtVSzo83vFxD7JI3UaBi/0R12vlD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="387829497" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="387829497" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 05:59:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="905339441" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="905339441" Received: from mylly.fi.intel.com (HELO [10.237.72.161]) ([10.237.72.161]) by fmsmga001.fm.intel.com with ESMTP; 03 Nov 2023 05:59:20 -0700 Message-ID: <849f77be-7cce-4c12-9064-4344e801afa5@linux.intel.com> Date: Fri, 3 Nov 2023 14:59:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] i2c: designware: Disable TX_EMPTY irq while waiting for block length byte To: Tam Nguyen , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Cc: patches@amperecomputing.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, jsd@semihalf.com, chuong@os.amperecomputing.com, darren@os.amperecomputing.com, stable@vger.kernel.org References: <20231102033009.4555-1-tamnguyenchi@os.amperecomputing.com> Content-Language: en-US From: Jarkko Nikula In-Reply-To: <20231102033009.4555-1-tamnguyenchi@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 05:59:46 -0700 (PDT) On 11/2/23 05:30, Tam Nguyen wrote: > During SMBus block data read process, we have seen high interrupt rate > because of TX_EMPTY irq status while waiting for block length byte (the > first data byte after the address phase). The interrupt handler does not > do anything because the internal state is kept as STATUS_WRITE_IN_PROGRESS. > Hence, we should disable TX_EMPTY IRQ until I2C DesignWare receives > first data byte from I2C device, then re-enable it to resume SMBus > transaction. > > It takes 0.789 ms for host to receive data length from slave. > Without the patch, i2c_dw_isr() is called 99 times by TX_EMPTY interrupt. > And it is none after applying the patch. > > Cc: stable@vger.kernel.org > Co-developed-by: Chuong Tran > Signed-off-by: Chuong Tran > Signed-off-by: Tam Nguyen > --- > v2: > + Reduce the indentations level > + Use regmap_update_bits for bitfield update > + Rewrite comment statement [Serge] > + Update commit message > + Add Co-developed-by tag for co-authors [Andy] > > v1: > https://lore.kernel.org/lkml/avd7jhwexehgbvi6euzdwvf5zvqqgjx4ozo6uxu2qpmlarvva3@sgkce3rvovwk/T/ > --- > drivers/i2c/busses/i2c-designware-master.c | 19 ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) > Acked-by: Jarkko Nikula