Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3121605pxb; Sun, 20 Feb 2022 09:55:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnriXdfRyZjDJr46GermBGvk0uzqqx6olROM24vjkIHpb0s0a7gdw6wn2NgLim7njUYJrr X-Received: by 2002:a17:90a:2bc1:b0:1b9:8aff:dd37 with SMTP id n1-20020a17090a2bc100b001b98affdd37mr17901293pje.145.1645379724537; Sun, 20 Feb 2022 09:55:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645379724; cv=none; d=google.com; s=arc-20160816; b=vHQ52BfwGm+vtGd2ApA8LQk4VhW/wHXrdZ1dV66f6h6ogjy/Un1bArNTKE++q7mFnw mZ5hK4HLhQl5dUnl4Ty+fGaMB4sfzXg/speTSHy2vR0dphREipBVcNKyyun+cFQHFmOL yldU3VEsImCfcwPKODbgkgqUdKRwQc5yRWy60VbQQ++GXtDjs1LTCXrW1n6fjYbnbhen tAFxYIk/goqiFjpqBwHLgRIl/8bPu6DPK9/F5RoLupPE9hwMWK2Ql1KKin+FyPX6nvI2 SF4H9Tn0si041+/auZQus7IGs5D2ZVU8tPFJEEJ0wHuR8W43Vu3ptAhM6JsPxT4Q0SWT 7MnA== 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=tO9gUxk8ScG394Fv1F7MLR3Gf0mTFyKLln3kWcROujg=; b=zVUoUrpRdhFzIeVJJbAIW+VIYEp1tSEXnUwB5ltpUk3DE6CouzEo8o6lgfHYZ8V9PL vsvvgnQmt24bzoyDhQB9ypNyEnryU3mVoTEPdFeL7hrc0Q1RmdQDVWWhhL6SSPHvIbAF uT6TR89W/Y0RlquhtITlzvnHyaI6TuBz8EHt/oUkFW6+RK6TuPG6vfpPkspbRbRqduLc gKpJOogZYSMHUGAEcdK4XV4AhCxIcpNICzZFbFEipjCXDghUTw710lTjgvPjy9NxCoVj Cqag8qXCbrFd9kZ+SZ5cCFO6BZ99PgFxcm8pgmpM5U/Z91mfr4M69JMtQu7cjbVEFl4A jB4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YFsNLhOG; 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 z188si7512548pfc.276.2022.02.20.09.55.09; Sun, 20 Feb 2022 09:55:24 -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=YFsNLhOG; 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 S239462AbiBTD55 (ORCPT + 99 others); Sat, 19 Feb 2022 22:57:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243433AbiBTD5i (ORCPT ); Sat, 19 Feb 2022 22:57:38 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAD741FAD; Sat, 19 Feb 2022 19:57:16 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id a11-20020a17090a740b00b001b8b506c42fso15889057pjg.0; Sat, 19 Feb 2022 19:57:16 -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=tO9gUxk8ScG394Fv1F7MLR3Gf0mTFyKLln3kWcROujg=; b=YFsNLhOGDEWxYVO1KI8dOBszZn9ragwhXM72tBXopH5oO5WrTkbDhoPx4ViCfsBQoA kk0MWgjbt+T5j7MmgtbE/ICMJtl5ytH1iCa3p0dVTp0tNQgXu3c3MTtPse/ErAxxPxik 0QL+zpv0Stdox96CTeTEpXDwwheA2R08Yeok1kz6f8O6+RW1tOusC3Js/2l2ugUVY/sc +H2eosuYZVau3+JqaR+/6CqBTZXhOj09Kpr847R1AkVQLpeRPa2HX5njkpmS6FFk5jrJ TejyIJ0kHTI+46tCBULxFGJcV/0FgA2sOgXI125GzRSlemYB3wdH10NaOVlNExt2D3yd hBCg== 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=tO9gUxk8ScG394Fv1F7MLR3Gf0mTFyKLln3kWcROujg=; b=oLvJdcefb597145NV9GTl2v/Y2ZI8WWDWQ34vKge08fil7uIaFN+Kvkbs+6PZiv4vn GsDAoXK+5Nafz9RHEMJHAr1Q2pGf3HnYrQL9KJYdU0NcF0/7C3p5eKwPrDO6/Fno79Jd fJfUaSMJSFtTGkZaxcqHER69aubldqqrdoUcEXz1ZBRfWWf5XWfVVNKYgVsq9IHy4cju 0ydhGaP//7PCzHPab1Tbh7NizZ8kdBzVbaMbC7oWL3lqpFmq3WDvuos1gH6KDwMi5UMY gNdhZw20vYHhPeI25ktmEZJUMbmcREwgIwgVqIKBDyADdjXIJ2fIitOHLegSIU1wHETu AMTw== X-Gm-Message-State: AOAM531slkIcjyvBqir2/5dTPEloZW6Py2CPHQjmFNWjRFJghhavgxJQ vMwZOUOEiKLjxNaHr/RmOQ== X-Received: by 2002:a17:902:f54b:b0:14d:6612:428c with SMTP id h11-20020a170902f54b00b0014d6612428cmr13947967plf.54.1645329436310; Sat, 19 Feb 2022 19:57:16 -0800 (PST) Received: from localhost ([2401:e180:8842:e799:9593:a6f2:788b:a48c]) by smtp.gmail.com with ESMTPSA id np11sm3457962pjb.25.2022.02.19.19.57.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Feb 2022 19:57:16 -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, semen.protsenko@linaro.org, yangyicong@hisilicon.com, wsa@kernel.org, jie.deng@intel.com, sven@svenpeter.dev, bence98@sch.bme.hu, christophe.leroy@csgroup.eu, lukas.bulwahn@gmail.com, olof@lixom.net, arnd@arndb.de, digetx@gmail.com, 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 v2 07/11] i2c: npcm: Add tx complete counter Date: Sun, 20 Feb 2022 11:53:17 +0800 Message-Id: <20220220035321.3870-8-warp5tw@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220220035321.3870-1-warp5tw@gmail.com> References: <20220220035321.3870-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 1e6e3f7f59a3..ee4757eff4b3 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