Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp118583iob; Tue, 17 May 2022 20:50:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhHoioUSefj/WtilCAO840fZPI8VcPkjsQmofwb5ga1BDXj+9SW8D+RdOsfvIYDormstl5 X-Received: by 2002:a17:903:1111:b0:15f:7f0:bbf3 with SMTP id n17-20020a170903111100b0015f07f0bbf3mr25453170plh.12.1652845843323; Tue, 17 May 2022 20:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652845843; cv=none; d=google.com; s=arc-20160816; b=OvwLidihEZIkI+z1QcGz3+++FQezlV/dEOnp3afABAC7oicfBtfC86a6osyV735GuE pVpO03d8paV2Gbv/NJVaJqEzivXIc2RRTT2YjdDdDrKfAv0VuJRqVh02eVj02du+2/n3 ShP296uwy0pWOozZ06bVjKJjqG9/cNG2TIl7WbiW5nWcYtXn8dRIInff4rlG/JejZgtj FPSFyLG+l0Q++UGIx/LXLCT715+MQJoLso9aXcvhbMvpd1d9OUr+y24vV+BRkU114vnW WB4nd6Uqp2cr6ChVgf68rHPPvlgLH3+Vbgxgy+BtVqXkBmXu2NX8vfjQ7gyz6bH72Iap 8V+A== 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=krLNxO0S/d+QCIpYPvVWVYi5XGTs+BtKLzm4JTRH6tI=; b=MkZuddR3M3nYtVjtZQSOQgLLboGz1wFJjxmnuMCVfISJZEOv080iwAQGThRDx/5ovK EFJvC7KXstay4ctauB/D3Q1IAfbkFTNNcb1z5acRgojfrBYWYYaUFrpjJcJ5v9ZiM9CM YYYR5TIvIJPwMlJnGfKM45gqNa/B6QGHQBKF0IIUCAK2d3J+ew0GeDJ+p++JS4kuQNoM jMpqpknS05Q7xUDX+qDTN/Agct7Cb5oMkPJthgYVtn3fD4oMjOd7vZf2i++hOptLASo3 Z8Xeu2QrzZIIwyeLVMmWoFLmZP+OcUMgtCa+yVYt7nogGml3WV9Ili7a9RBipuCXDvX6 kxBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wej2EPVt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i6-20020a635846000000b003ab4cc709bcsi1042471pgm.691.2022.05.17.20.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:50:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wej2EPVt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 840AE8D693; Tue, 17 May 2022 20:33:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234487AbiEQKNo (ORCPT + 99 others); Tue, 17 May 2022 06:13:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343793AbiEQKMp (ORCPT ); Tue, 17 May 2022 06:12:45 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7371CFC2; Tue, 17 May 2022 03:12:05 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id z7-20020a17090abd8700b001df78c7c209so1984238pjr.1; Tue, 17 May 2022 03:12:05 -0700 (PDT) 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=krLNxO0S/d+QCIpYPvVWVYi5XGTs+BtKLzm4JTRH6tI=; b=Wej2EPVtv+g3E5YqfceFbhSCpcOw88Cw6q41HmZNLtWCJJCj8A0mueeN2H9mG2J5GV oJ9tSPE2546gKfKptsCpkvicpPJiKqSzEEWKU7SuKQ3MD9hc+2UAPplRSpss12N4J+h6 IxAIeVUWuNbD4efUsRmAbAt7TkRwvoCVlrYzGy402m02J5a6HUdgCpK9wzMqjyrRX/9Q kt5ojaQ46PU5J8fB4Xg2g5qpaHZ8xTGCscmCGkMr3XnMfLnBFp6SGOqMtbqXaJF2H1R5 qPReM/WUz8VWNXQn/ffxwIXj6i3JBi5dvlB9whRI+MvLB50BKT/ipesqLA+qhZ5ge+M0 LEfw== 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=krLNxO0S/d+QCIpYPvVWVYi5XGTs+BtKLzm4JTRH6tI=; b=JeXdkbvlCqrUp/cNnarDbNJ445GNL5Ujz8H3TwLWIhOaHHKY5EWoRgbCGIFvGLVTKo 6dcd+VkSx/HTOiu7+xJdF+oas8fREDBLYJn1QZk23lF1kvmNNEYBjDpH5Rz3L5YUt/HP Serhx4gkgOH5e/TT61B8KbUeo03mUoOCxBFuo3GrPl5/Z27YmESIiDEizmftnMmjFueo o2uV6nYnfwJJsKE+C8tQNlh6VVMQx3Q5W3eZxRNYsscjuw3jDNs0lsnLWq03lmIiE0Yf 2f0wBHZn+HS6n2ugNSj2gXhmsszA+opjLvzL9L8lCRJET2kDzwZoRv7TfzhvHmuYY+20 YUjQ== X-Gm-Message-State: AOAM530osQo45TMpZMyirUO4PSsZ427c4rKacqv/h5NlPfGv+5ZhGVs+ 21N3VHnxPETlxt/YsYYnrg== X-Received: by 2002:a17:902:bb94:b0:161:60b3:3300 with SMTP id m20-20020a170902bb9400b0016160b33300mr12971537pls.97.1652782324968; Tue, 17 May 2022 03:12:04 -0700 (PDT) Received: from localhost (220-133-130-217.hinet-ip.hinet.net. [220.133.130.217]) by smtp.gmail.com with ESMTPSA id e17-20020a62ee11000000b0050dc76281b8sm8664208pfi.146.2022.05.17.03.12.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 May 2022 03:12:04 -0700 (PDT) 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+dt@linaro.org, wsa@kernel.org, andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com, semen.protsenko@linaro.org, rafal@milecki.pl, sven@svenpeter.dev, jsd@semihalf.com, jie.deng@intel.com, lukas.bulwahn@gmail.com, arnd@arndb.de, olof@lixom.net, 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 v5 05/10] i2c: npcm: Add tx complete counter Date: Tue, 17 May 2022 18:11:37 +0800 Message-Id: <20220517101142.28421-6-warp5tw@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220517101142.28421-1-warp5tw@gmail.com> References: <20220517101142.28421-1-warp5tw@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 489b4c8ad0ee..36f8aa7ab106 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