Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp636643pxm; Thu, 3 Mar 2022 01:15:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2hvO4VBD6/Kt4e63j1uVE86v1WuKcwHnEiEUFMtZ/Rux6THqYD7I/ptbN3l32n3KY4J8K X-Received: by 2002:a17:907:3da6:b0:6da:8dde:a4aa with SMTP id he38-20020a1709073da600b006da8ddea4aamr1889537ejc.209.1646298950675; Thu, 03 Mar 2022 01:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646298950; cv=none; d=google.com; s=arc-20160816; b=k/ZdjKqFwVlmgPHv+fj/zy7cf3aSLQV8rnrT7EAaZuDVEIHZN9PN9R+v0+Tjz2K3gF Bp4wDYVQpQJGVJs6fGkrvdD6D3jN0IdgrWWADZGaqjNLSwk+oc1vWoJ4nuXkKE6vfJlu Qjgd+M0GmjfBN0Gw/r094hhIgnFMcjybLa/nEtwvZ1sEiHzE96TKR+BrJ+FkKx2/It0v K5V69jkeuJ2PICIjui2MWDcGe7Ij4c/HF+cqMIXrfUlv5hunaIGm2+H3V5mjOW4032tI MbcJnmJB5WC1nmqzih8qSrmIIEYUhwzXf7pBS3GXpaMNeIVyt395hJNWuUn6EfIoBGhs geWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=qR3k7tR7j/5S7kicq9024I41lOgKh8ZbJEsbrDlOUpc=; b=RT1JZcX7DJW1aZzvIgv2nABbAvJs9T2BEOGAIES2qgLAGeYb3eNITU2rL8koKMFIqa dRr2NsokMogoWKglBW5OvErcqJpyket7Qv923Xhcgm0+J0t1F0oNlizFVbcDYuPp4NCA HHiITvvbwb1kSac/UG7o+NGheeeI480uwhDkYSgxydU6VKzRCGVZHWX7GXw/zltIMVhU zxOKtXi1hzjyXiaSWLLJV/FQvUbctGRegxjJ9W2xa09s0LpRIIb3Qxi2VudWi07pb/I7 gCCcpKei3P061CMBtsAknU/NXuDN8hn6cvpy+HBuHi3YNkl6vp5/JJB0HBuH3u2RcoqF ogxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="c98mF/Vv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a056402255100b0041354ffd635si1352997edb.614.2022.03.03.01.15.28; Thu, 03 Mar 2022 01:15:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="c98mF/Vv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231502AbiCCIdA (ORCPT + 99 others); Thu, 3 Mar 2022 03:33:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231451AbiCCIcu (ORCPT ); Thu, 3 Mar 2022 03:32:50 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89DD5172889; Thu, 3 Mar 2022 00:32:05 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id z15so4152492pfe.7; Thu, 03 Mar 2022 00:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qR3k7tR7j/5S7kicq9024I41lOgKh8ZbJEsbrDlOUpc=; b=c98mF/VvcIKJ4ZkueVOL/DOQ8xsIvjH+GALr1n3psM9il/GzMYEKvoKwbq/+nLSToG qN65D5ikBc9Q2ZQUsVOAlQMw0A/kjvrQJAU15vWqr66JYOptvG4fGErDzCNvBOO62BaY Rc/4jl/alYAWiSXVbQQvOh6ZV3d9Dl5yxogCTFReuha6bEIdT/Xtyddz6L8mwL+D9p7i ls8Qek37dK2+/jSeF7Zkk6gbN8CVP4SaLjN8KlNxSTIflox3Rv86cViqAvN9Q8I3w0cD KAalSgjFKzM7fSY9Heh/2NdYIlN24E4nJb4pAm+X22nukzi91EhfUljKvc/bhSQgIhRt zSTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qR3k7tR7j/5S7kicq9024I41lOgKh8ZbJEsbrDlOUpc=; b=lXg0tYN0Awc/4Dbx7d0l73T0bhaJQjyQLxdG4vpRA32MUbTEFFuqQE7sz8IRtA6FmT 1WaV977TQpPCrVkn8yyXAnAjXn5LtznPueWdEkSpRK/9JjfzMv2lYYxlzoizVEESRI5U LvGKYhkkXspDf7QvkqS2pmB8QP7rMjvs3HbVgt6pWdz8A+zwnhFt9RopnDYEGLOfe3/+ bBNIkio3Gn3VaW8LCbV92B5mF2fPQ8MBKGXT6OstuKFoWxbv4SdBIZtEntZiu9K6aluh STjU6Y6+QGymZtXCl9g1S4I41iR8+ekPOEYq05Vmyf4oJW/imNB7oFLOl9ziru+wX18w wpIw== X-Gm-Message-State: AOAM5312i9gHI+8+Ou4m9YF1eXqWH528s256QJk8W6ZdjeqrwBj60gmF wAAaG9dTDAGcCvhCDyPW3Q== X-Received: by 2002:a65:4687:0:b0:373:a276:767 with SMTP id h7-20020a654687000000b00373a2760767mr29267201pgr.409.1646296324954; Thu, 03 Mar 2022 00:32:04 -0800 (PST) Received: from localhost ([2401:e180:8860:3b30:e4a0:392a:996e:c525]) by smtp.gmail.com with ESMTPSA id r12-20020a63a54c000000b00376047bf784sm1383972pgu.23.2022.03.03.00.32.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Mar 2022 00:32:04 -0800 (PST) From: Tyrone Ting To: avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com, yangyicong@hisilicon.com, semen.protsenko@linaro.org, wsa@kernel.org, jie.deng@intel.com, sven@svenpeter.dev, bence98@sch.bme.hu, lukas.bulwahn@gmail.com, arnd@arndb.de, olof@lixom.net, andriy.shevchenko@linux.intel.com, warp5tw@gmail.com, tali.perry@nuvoton.com, Avi.Fishman@nuvoton.com, tomer.maimon@nuvoton.com, KWLIU@nuvoton.com, JJLIU0@nuvoton.com, kfting@nuvoton.com Cc: openbmc@lists.ozlabs.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 07/11] i2c: npcm: Add tx complete counter Date: Thu, 3 Mar 2022 16:31:37 +0800 Message-Id: <20220303083141.8742-8-warp5tw@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220303083141.8742-1-warp5tw@gmail.com> References: <20220303083141.8742-1-warp5tw@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tali Perry tx_complete counter is used to indicate successful transaction count. Similar counters for failed tx were previously added. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Tali Perry Signed-off-by: Tyrone Ting --- drivers/i2c/busses/i2c-npcm7xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c index 3fd30c38b3bf..237da0ef32ca 100644 --- a/drivers/i2c/busses/i2c-npcm7xx.c +++ b/drivers/i2c/busses/i2c-npcm7xx.c @@ -314,6 +314,7 @@ struct npcm_i2c { u64 rec_fail_cnt; u64 nack_cnt; u64 timeout_cnt; + u64 tx_complete_cnt; }; static inline void npcm_i2c_select_bank(struct npcm_i2c *bus, @@ -684,6 +685,8 @@ static void npcm_i2c_callback(struct npcm_i2c *bus, switch (op_status) { case I2C_MASTER_DONE_IND: bus->cmd_err = bus->msgs_num; + if (bus->tx_complete_cnt < ULLONG_MAX) + bus->tx_complete_cnt++; fallthrough; case I2C_BLOCK_BYTES_ERR_IND: /* Master tx finished and all transmit bytes were sent */ @@ -2223,6 +2226,7 @@ static void npcm_i2c_init_debugfs(struct platform_device *pdev, debugfs_create_u64("rec_succ_cnt", 0444, d, &bus->rec_succ_cnt); debugfs_create_u64("rec_fail_cnt", 0444, d, &bus->rec_fail_cnt); debugfs_create_u64("timeout_cnt", 0444, d, &bus->timeout_cnt); + debugfs_create_u64("tx_complete_cnt", 0444, d, &bus->tx_complete_cnt); bus->debugfs = d; } -- 2.17.1