From nobody Fri Sep 5 20:17:57 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 181FDC32792 for ; Tue, 23 Aug 2022 11:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240496AbiHWL2Q (ORCPT ); Tue, 23 Aug 2022 07:28:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347313AbiHWLVw (ORCPT ); Tue, 23 Aug 2022 07:21:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 945B32DA9E; Tue, 23 Aug 2022 02:23:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E618461174; Tue, 23 Aug 2022 09:23:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2418C433D6; Tue, 23 Aug 2022 09:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246605; bh=LK9FEJt2DMx/tCwauwzG4AoLVuPurOBOmC2rc6Ar3CA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h1RmEbBmUWypxnBEmUE2aFR2x1Rduppy+6DDzb+YTd5Qc40wKAwQmGgZ9ZG7zGW1h 2Z0B/NUliFib5qS4HJQtvZsRdYwmJvF/D2q4QVyJrrz78Q6sTuvnnlOHBWKkjuoVHs USMjF77Kv8bSoSU+0Yy0WyC77A+XDQ0a9IXeOSvo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Mailhol , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.4 132/389] can: rcar_can: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:23:30 +0200 Message-Id: <20220823080121.137636456@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Vincent Mailhol [ Upstream commit a37b7245e831a641df360ca41db6a71c023d3746 ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: fd1159318e55 ("can: add Renesas R-Car CAN driver") Link: https://lore.kernel.org/all/20220719143550.3681-3-mailhol.vincent@wan= adoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/rcar/rcar_can.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_ca= n.c index ac52288fa3bf..b99b1b235348 100644 --- a/drivers/net/can/rcar/rcar_can.c +++ b/drivers/net/can/rcar/rcar_can.c @@ -235,11 +235,8 @@ static void rcar_can_error(struct net_device *ndev) if (eifr & (RCAR_CAN_EIFR_EWIF | RCAR_CAN_EIFR_EPIF)) { txerr =3D readb(&priv->regs->tecr); rxerr =3D readb(&priv->regs->recr); - if (skb) { + if (skb) cf->can_id |=3D CAN_ERR_CRTL; - cf->data[6] =3D txerr; - cf->data[7] =3D rxerr; - } } if (eifr & RCAR_CAN_EIFR_BEIF) { int rx_errors =3D 0, tx_errors =3D 0; @@ -339,6 +336,9 @@ static void rcar_can_error(struct net_device *ndev) can_bus_off(ndev); if (skb) cf->can_id |=3D CAN_ERR_BUSOFF; + } else if (skb) { + cf->data[6] =3D txerr; + cf->data[7] =3D rxerr; } if (eifr & RCAR_CAN_EIFR_ORIF) { netdev_dbg(priv->ndev, "Receive overrun error interrupt\n"); --=20 2.35.1