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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCADBC48260 for ; Fri, 16 Feb 2024 17:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uUVFygRqZ+40/8xtBOqni7LYMvxCahlCqO841MNCzck=; b=34HIUex/rghXFX cJ8FHAe5LPeIkELoBubPjwQtqJp1v5VKyKc3W8WDxhIuMgTC35z8VeL/36mA0eCYnR0BhASoGoNOV FVCK6vSKqLAGSu/2ILb+DQSkl8VuS3kjH2OjIN77wV+IgQ6We7f9qyQjko9PkeW5CZVt/FtXikKZ+ SGBPdSc9Qy8cUUfhU49CT37Hc9xx9lEPHuZQYcEO8TwLR5yE3DYUTDTYQbDWiOoynKXY0eG11ybd7 UG+R60YV9YkMmmIO7BP+lrbkw81wGR2xFzYJPEN8o/uqVptIB+NrXWvw3rcySu09jlS1V7+t5gJ+9 lAn0wDPLOnauXG+oe5Cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rb1mh-000000039UA-1Oky; Fri, 16 Feb 2024 17:13:59 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rb1mf-000000039TA-1QPM for linux-arm-kernel@lists.infradead.org; Fri, 16 Feb 2024 17:13:58 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-42ddd0caf20so3360491cf.2 for ; Fri, 16 Feb 2024 09:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708103635; x=1708708435; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pjvfE09Bk+j8kTulAxyHuFEo7lsn+ZYbAj8sdSsLEQI=; b=S5ESBitXaOhzzuhVS+zbpA3oqJJT1gEbZ8ERrfaGjHbAcMd7zaOQuzjpt68C7eMD/H KVJRHlMqQzwrn67cLdOY/RgfTYITAewi/LmCFQTlLhK9dFmxfDTVIrN40pJhdA347fql w0b1LVS2eYnlRK/yJ9jIGWKlpqu5q6kfFsk86ecNJK8i+xN5bE8GwAU+zOYbJFn8ZlYA ouQViVzWPovTX6b07u3Yi7WvtE7f/4k4pMZR994SHuC0wFRqmXRGGnrcwHP2huYv2jRx Wh8AHMyYuwNyQvlNqzou57ZAJcyVGkidsi2Z0QFubFSJDXkaFVu2DBOxNsIINFMWhNpd Sk6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708103635; x=1708708435; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pjvfE09Bk+j8kTulAxyHuFEo7lsn+ZYbAj8sdSsLEQI=; b=S4cgPfdHXGXKGSIWVoso8IGtLIHpxDu4stG9yjKPh91/2Aege5pGsYirMyy5dq41FA 2E4lstz8+f1JnWoI+lEVHjjXxMNndmC1Sq1RaFnGUfwOonzm0IijjdEbAcLpfa5khalg dtOgKGMDZVdZgVEv2aAoeG8tr2hFMobdRC/3yDBz+/QkvyABbRQbfyI3xoDS6ZWoZNMR d8gWzikl6FH/EX9rW7T2tlPH7nUD6d7Lv75g5q9wX6KbAqdJ1zx4H0awAf2rEtFeWonV 8bJxA2SJgB0kGzZLmfrp74ZSD/FE3IiLTw5S8Hjha1JeSD5GsQ7MLTYu2sh9bfezkq9W i1SA== X-Forwarded-Encrypted: i=1; AJvYcCV57rOtfE0IxkB2bLg71c8ECKHP71cofCxEhexiZp0XGgC7wgiz60p3kkB7ULf254XjwFzM0HRrLiYkDxjK42g6R9qQBYimXV7mw6KM8J5DzF3dzEM= X-Gm-Message-State: AOJu0YzxXY6dcycV7XKdrp4hq4F6Z4vLyjfgex6v6A4NYCkePnrE+efo iuTeq76/5NM2yFH7EJ4vLfgmMiTmxWLGWj7/gKR4aWSCPyETcqjz X-Google-Smtp-Source: AGHT+IGwY7as3MWB8rYJ4I9pgzQYCKHYP5+MPcdYB0dE1tHD/o8J8JD84q4msCMJqeg9XyYibSA/xg== X-Received: by 2002:a05:622a:15d6:b0:42c:7c75:b73b with SMTP id d22-20020a05622a15d600b0042c7c75b73bmr6001337qty.18.1708103635473; Fri, 16 Feb 2024 09:13:55 -0800 (PST) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id y20-20020ac85f54000000b0042c5512c329sm105660qta.17.2024.02.16.09.13.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Feb 2024 09:13:54 -0800 (PST) Message-ID: <61bdd802-abe4-4544-8e48-9493a6bb99c8@gmail.com> Date: Fri, 16 Feb 2024 09:13:51 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: stmmac: mmc_core: Assign, don't add interrupt registers Content-Language: en-US To: Jesper Nilsson , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@axis.com References: <20240216-stmmac_stats-v1-1-7065fa4613f8@axis.com> From: Florian Fainelli In-Reply-To: <20240216-stmmac_stats-v1-1-7065fa4613f8@axis.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240216_091357_412661_4D2DFE53 X-CRM114-Status: GOOD ( 20.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/16/24 07:24, Jesper Nilsson wrote: > The MMC IPC interrupt status and interrupt mask registers are of > little use as Ethernet statistics, but incrementing counters > based on the current interrupt and interrupt mask registers > makes them worse than useless. > > For example, if the interrupt mask is set to 0x08420842, > the current code will increment by that amount each iteration, > leading to the following sequence of nonsense: > > mmc_rx_ipc_intr_mask: 969816526 > mmc_rx_ipc_intr_mask: 1108361744 > > Change the increment to a straight assignment to make the > statistics at least nominally useful. > > Signed-off-by: Jesper Nilsson > --- > drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c > index 6a7c1d325c46..6051a22b3cec 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c > +++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c > @@ -280,8 +280,8 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc) > mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB); > mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR); > /* IPC */ > - mmc->mmc_rx_ipc_intr_mask += readl(mmcaddr + MMC_RX_IPC_INTR_MASK); > - mmc->mmc_rx_ipc_intr += readl(mmcaddr + MMC_RX_IPC_INTR); > + mmc->mmc_rx_ipc_intr_mask = readl(mmcaddr + MMC_RX_IPC_INTR_MASK); > + mmc->mmc_rx_ipc_intr = readl(mmcaddr + MMC_RX_IPC_INTR); So in premise I agree with the patch, that incrementing those is not the right way to go about them. However these registers are currently provided as part of the statistics set, but they should instead be accessed via the register dumping method. In either case you will get at best a snapshot of those two registers at any given time and I suppose this can help diagnose a stuck RX condition, but not much more than that. -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel