From nobody Mon Sep 29 21:15:50 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 28E4AC25B08 for ; Tue, 16 Aug 2022 00:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356582AbiHPACi (ORCPT ); Mon, 15 Aug 2022 20:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356567AbiHOXyn (ORCPT ); Mon, 15 Aug 2022 19:54:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ECBA161037; Mon, 15 Aug 2022 13:19:23 -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 4D5136069F; Mon, 15 Aug 2022 20:19:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CA52C433D6; Mon, 15 Aug 2022 20:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594761; bh=aNjSJGXnTQe5vLNHB9O7l00/SFkzUdwvPVm8jLD4v0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnDJbRqaiQEORMa/RSOx7vY3W4k/J6M3NDcpAnJmfOvfZGlWYXJf9pzhqRnYkUEob ErYo5gz5JhdwNuffEEgZo/Cz7J7H7E95uVpi6HDn2faJXx/cFOcSUlqzEwiLr/uCRv xgXu0R4CovbUQXanLJHh8ko+JO4bCg72TnhDhpJw= 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.19 0519/1157] can: hi311x: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:57:55 +0200 Message-Id: <20220815180500.460981215@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 a22bd630cfff496b270211745536e50e98eb3a45 ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: 57e83fb9b746 ("can: hi311x: Add Holt HI-311x CAN driver") Link: https://lore.kernel.org/all/20220719143550.3681-6-mailhol.vincent@wan= adoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/spi/hi311x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c index ebc4ebb44c98..bfb7c4bb5bc3 100644 --- a/drivers/net/can/spi/hi311x.c +++ b/drivers/net/can/spi/hi311x.c @@ -667,8 +667,6 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) =20 txerr =3D hi3110_read(spi, HI3110_READ_TEC); rxerr =3D hi3110_read(spi, HI3110_READ_REC); - cf->data[6] =3D txerr; - cf->data[7] =3D rxerr; tx_state =3D txerr >=3D rxerr ? new_state : 0; rx_state =3D txerr <=3D rxerr ? new_state : 0; can_change_state(net, cf, tx_state, rx_state); @@ -681,6 +679,9 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) hi3110_hw_sleep(spi); break; } + } else { + cf->data[6] =3D txerr; + cf->data[7] =3D rxerr; } } =20 --=20 2.35.1