From patchwork Fri Oct 11 16:23:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3567 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6F4D941386 for ; Fri, 11 Oct 2024 18:23:48 +0200 (CEST) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-539e03bfd4asf831821e87.1 for ; Fri, 11 Oct 2024 09:23:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728663828; cv=pass; d=google.com; s=arc-20240605; b=eZZ7NkCuPWFFcHa487ibpDhRNP0ZRczVWUvJni31Z5FgLg+mR6SdnzONfRJO4LLikr tjqLIX0OAnmm9gsvYaCb82uVuET3g0EZXezBOsLvHcBha/yE1dq8Zqdmktzr2P1F8bGD i2EGWZWVZP4/9xvgGdwCwjLbgBjuacdKaR+x3h6lIYROkNwRNaQNc/+QCl3oXS1s+EIZ tVNpbeHy7ewDsKE0NOPsJ4W/pt6wsN9swsVJTyX1nekZqfdR/O+qjH/CWbHb6Udv/3Ek muH/QKWppRh3REaI0TC8roKstg6HL7JkWz51W2GNvl62WzHnv9ACBH5ungKmxQJhGzc8 0FWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ngk2e/VtOITkeO+47v2e3jDI5KspNE294ld7gRqxGk0=; fh=F8leb90HEB7Zx3rhjzMYXNrRgRPknbRyTaw+FTLcudw=; b=HNWtjh8hmUWoxcy9H+UT8RH+sORdaCor47wwkaPEVCJ+Z9AmBh+AoBi2EdoMWY6UJl OToTq8NxOREmF2H7ml3KthPQjNSeu44rFV0D8+EnFRKuc8fnBAWAyOaSgte+nzoaGgx8 YKmyEOLTsNYpSfKUYX0fEYcu0/CUz1eYWfzyJQq6rgtfGt03kqS41k2KFGh1dY+YW8UT 2tXIHX1s0A1R2hShg6ijqa3ErT1G4hOexQuTnzmXKT136fyjYpHq7badpG5CwYB5dxrh ebxT4IpDmSIxSduXMGu8wafAvZfZ6wdQWPZFVgDIc0AQkagfNhbdRDeXq0it6ARoTGhF 2f8g==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="n/inYlnd"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728663828; x=1729268628; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ngk2e/VtOITkeO+47v2e3jDI5KspNE294ld7gRqxGk0=; b=hVfXBqr3/HCtpNW77BH8US42Z9VcceYSTiH48FD73QkVhbsR9YswI6T2jvHfo0BJ3f IqGeEGxnmr8NFS7N9IWQ+CnfUpgAiN07ZAI2BGeeQO9NkcWqgSrezLzlaWqRsczBnhh7 nnhCe9EsLMvmsDiTwd5UhlB2Ab0/An4Yme/Io= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728663828; x=1729268628; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ngk2e/VtOITkeO+47v2e3jDI5KspNE294ld7gRqxGk0=; b=hRsdFgMo/jXl2SGL5J8JD0S24LYTFdkzW9RH8TP1WrvHyyJEEWIxHy3zm5FG9P+pwQ VIhnN+TORGRa3lx1Zb7+TCKwQKOZVG8DG36Va4bowH4PKKryz8IESNsg/1+nb10pTSMw 3ZFoSoAxMaroCIZWx7f1ZVsVGoMM9Qcmen5EdnD78nHQdxckYyD7WxTwPkZNqGUwA5rH agO6L+lBKaVl3B2xM2lipF7NpVmwkWLy05oOw9TC41JviDHuwSKkTeXktjLhDytDOMVp 3UzDkY76y304z9qR8Z4OAfFrQYfmLH5o4jg+sqMhLwlKnswvIGAi/XCCIGQmOoKa2poS sXtA== X-Forwarded-Encrypted: i=2; AJvYcCU0UdyqwzFLna0kEcs7ttCYWU7JQAbRqwRxlWMfS3Pm3TP0vfVZPRjJ0P9qDv6DKlPmCegP8ET2YVL0MVKD@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yy3gOL0n2ADqWxUHmKGAGJu8LpPY7o4LpHhYcn70KukKzMb7Ari cjdC7XzbtsaOC0fJh1RF6IcV8GikEWcUB3onYlQcW9FqGbuNNi+VX+fp0wLt1Kidyg== X-Google-Smtp-Source: AGHT+IHweC/S4y2MkmTWKdh1cBcsx0PDpx1vYLkNLao4+yCsYZwE2H9Wqx1dBS5qg9XDlP7hjvjxXA== X-Received: by 2002:a05:6512:3b9c:b0:537:a7d8:2425 with SMTP id 2adb3069b0e04-539da599296mr1499189e87.60.1728663827324; Fri, 11 Oct 2024 09:23:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:3d0e:b0:536:53c2:bc36 with SMTP id 2adb3069b0e04-539c9bd81e0ls167503e87.1.-pod-prod-07-eu; Fri, 11 Oct 2024 09:23:46 -0700 (PDT) X-Received: by 2002:a05:6512:3d8e:b0:52c:e17c:3741 with SMTP id 2adb3069b0e04-539da3b68bbmr2119617e87.5.1728663825616; Fri, 11 Oct 2024 09:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728663825; cv=none; d=google.com; s=arc-20240605; b=RHP15476FOf/hMDju4BfoTMSQTKUFGNQf907EkcpPbN+3YMqYffawervQn9V21Kc5k yk+zPDcXU8e1u0nzB3m3KZaiQuuIrhIM5CNNYnydaKartQiSji4jwaacGvJeDibhGEkT s0jNfoi7BEseL3juTyAlJN78BFiwJlgxubUwusOSrjqPgIENJs+ljbqI9gokNB2oHBhs N8P6B/T6fxD2uqHyAKgvb3cu5vpM9prNCVaj7vTAxQSnIVv91JZ0CbJrQiPQKKX3KtQE JmppM85DH7A6MrtPr/U1eUIdxaTAKtmg3gkTxG799JrnTDZXxTSEZtOsozjWOPwgYcRE jLJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BnAJ5yzfxpuQb3ROFH03KP/0bIS5fcE6s0IUJTXZdMA=; fh=bW3oFOv0XHBefUz3obU0AkR4GIxgTUcq9BdItYoBfi8=; b=YlfhICgO9Jb6NuUlU41+rc96FVXZu3SkYHSuxHn90KC+kr/5BOj+mNzc7AWFi2WIvd 61ng8G709A1JR/vTpFXELzG5iZ56gYpzsRcwEReFlrmPU1b3njSgh+OhxsDRT3RMxkmE Xps/I6j8yFxnzgAOH2lVvwwEu/m3E98Vutm7iX2cA78lVdhVGLMlSC0xSmgejrLgIcXY Y7cS5yqXEBCU2pKXfEFvnKlttb6Ydb1CltjJRxhvUxWLPtl0oMFGlhx+XCQ/4WsC7UoR 0gpQuE36pzwf6sITcOovRTHG0NAYL7XDScs8xgchbOCDe3PGsiBuXEV0ibMmKNGWQD+f N+aQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="n/inYlnd"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 2adb3069b0e04-539cb8da260sor1416378e87.29.2024.10.11.09.23.45 for (Google Transport Security); Fri, 11 Oct 2024 09:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6512:3408:b0:535:6992:f2c3 with SMTP id 2adb3069b0e04-539da5479b9mr2104416e87.41.1728663824837; Fri, 11 Oct 2024 09:23:44 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.40.11]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80c0222sm229891266b.140.2024.10.11.09.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 09:23:44 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Cc: michael@amarulasolutions.com Subject: [PATCH 2/6] can: flexcan: use can_update_bus_error_stats() Date: Fri, 11 Oct 2024 18:23:37 +0200 Message-ID: <20241011162341.606443-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241011162341.606443-1-dario.binacchi@amarulasolutions.com> References: <20241011162341.606443-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="n/inYlnd"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Dario Binacchi Change-Id: I897083c23f61d9b51c54f663dee9c2836aa07339 --- drivers/net/can/flexcan.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index d2625f79b033..a67b1a26200f 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -571,7 +571,6 @@ static void flexcan_irq_bus_err(struct net_device *dev, u32 reg_esr) struct flexcan_regs __iomem *regs = priv->regs; struct sk_buff *skb; struct can_frame *cf; - bool rx_errors = false, tx_errors = false; u32 timestamp; int err; @@ -586,41 +585,31 @@ static void flexcan_irq_bus_err(struct net_device *dev, u32 reg_esr) if (reg_esr & FLEXCAN_ESR_BIT1_ERR) { netdev_dbg(dev, "BIT1_ERR irq\n"); cf->data[2] |= CAN_ERR_PROT_BIT1; - tx_errors = true; } if (reg_esr & FLEXCAN_ESR_BIT0_ERR) { netdev_dbg(dev, "BIT0_ERR irq\n"); cf->data[2] |= CAN_ERR_PROT_BIT0; - tx_errors = true; } if (reg_esr & FLEXCAN_ESR_ACK_ERR) { netdev_dbg(dev, "ACK_ERR irq\n"); cf->can_id |= CAN_ERR_ACK; cf->data[3] = CAN_ERR_PROT_LOC_ACK; - tx_errors = true; } if (reg_esr & FLEXCAN_ESR_CRC_ERR) { netdev_dbg(dev, "CRC_ERR irq\n"); cf->data[2] |= CAN_ERR_PROT_BIT; cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ; - rx_errors = true; } if (reg_esr & FLEXCAN_ESR_FRM_ERR) { netdev_dbg(dev, "FRM_ERR irq\n"); cf->data[2] |= CAN_ERR_PROT_FORM; - rx_errors = true; } if (reg_esr & FLEXCAN_ESR_STF_ERR) { netdev_dbg(dev, "STF_ERR irq\n"); cf->data[2] |= CAN_ERR_PROT_STUFF; - rx_errors = true; } - priv->can.can_stats.bus_error++; - if (rx_errors) - dev->stats.rx_errors++; - if (tx_errors) - dev->stats.tx_errors++; + can_update_bus_error_stats(dev, cf); err = can_rx_offload_queue_sorted(&priv->offload, skb, timestamp); if (err)