Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3404306rwa; Tue, 23 Aug 2022 04:20:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR6CPOeq9/SxoA/vtAJTavmUtNZLTmplE+KJShMnc7zJtoKV1IWWpf/OY0EzLHxZ8Em5Bbs/ X-Received: by 2002:a62:158b:0:b0:536:460d:80a5 with SMTP id 133-20020a62158b000000b00536460d80a5mr16089579pfv.26.1661253607083; Tue, 23 Aug 2022 04:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253607; cv=none; d=google.com; s=arc-20160816; b=Yc9UZWCNLhMb2o1VfkDzyd/P0lmAipvqYXa8thpABWncx5XETWWHSTY49De3ya93+a uSKlTHHcnZBjYufwBJ0B9mbGtxpc/9n/NaFhM5NGV0CIkc7w23rZTIjTvLpPgdQX72LE HwB+5p7jP2rEyC4FOZs005HCNXcRQWa3+Q9NWIjCeriRxyJYB7ROGg1NFdhAZqR6zUxt w2DzQ0TCoEanKIE6hxCPTuFQOyrWELF/QrW+PysdnvnLFmVlcRnSxCNtrQ8V/qRkJ1g2 HSRXl6POkwh2h+wEVTA95SFMdSm9Nrs5XBxa2wG+UqBWp737EGSF9/MkN7g/uJRIlsv3 hAng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3CNArRv4rSkgC3t5yAbMHurhYxUmOi9k/YODnNxbevo=; b=RUsz30kllws2RpnLPEg/mwdfxIN8DWkilHZKuoth/j4zF3dfBfdkczcFfkee2E7nMq VzaqafoD00o1OaXrEZReo5c+nQC3PVfqikaMsNfyzlwknTCv4NEO8oC2VoVoUbh+S2mu q53x8u9aY8kbtfguPG0Sl0niBHYjE1vaGmDurNQUUFvoCXOiD9NWMG1IiP5E5kdbbO8x O2lQmigxvq3XwC06OSWtJ+ZXIfFNuRg9CiODJwfE3+fEVHLtnoDhS4nVZdxJOF+vtyaP HIp4CkU52UGnT2wQpYWufD/v2ib5ZPnMLOsxVZrL1pnc2iUg+B3B0ytr3awDtn8ucDTC pPHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gmWMDAxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a63cd42000000b004292e659b6fsi15714695pgj.123.2022.08.23.04.19.56; Tue, 23 Aug 2022 04:20:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gmWMDAxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355633AbiHWKkR (ORCPT + 99 others); Tue, 23 Aug 2022 06:40:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354302AbiHWKZW (ORCPT ); Tue, 23 Aug 2022 06:25:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 321E3832E1; Tue, 23 Aug 2022 02:04:55 -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 ams.source.kernel.org (Postfix) with ESMTPS id D793AB81C65; Tue, 23 Aug 2022 09:04:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DCE9C433C1; Tue, 23 Aug 2022 09:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245492; bh=DPuyn0vXH02KiwaX6fibOkAwgcLn6wDShe4JqCjHAHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gmWMDAxk0NyHLCeFosBJvJgffr5gNykNs733vqxRMAd62HJ73mg+ypdMPGEzTPj4R FWn+IvWxO/YANgyrNj09uWRtwZtp4hbiCTIvNvWWOBmUih9awv0+UtrAtfTE0xdJ8q 9TcHl2qQHKUvjdHVP/N9Bosa5THUAMKSR6CwtU7Y= 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 4.19 095/287] can: rcar_can: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:24 +0200 Message-Id: <20220823080103.542142960@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: 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@wanadoo.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_can.c index 963da8eda168..0156c18d5a2d 100644 --- a/drivers/net/can/rcar/rcar_can.c +++ b/drivers/net/can/rcar/rcar_can.c @@ -233,11 +233,8 @@ static void rcar_can_error(struct net_device *ndev) if (eifr & (RCAR_CAN_EIFR_EWIF | RCAR_CAN_EIFR_EPIF)) { txerr = readb(&priv->regs->tecr); rxerr = readb(&priv->regs->recr); - if (skb) { + if (skb) cf->can_id |= CAN_ERR_CRTL; - cf->data[6] = txerr; - cf->data[7] = rxerr; - } } if (eifr & RCAR_CAN_EIFR_BEIF) { int rx_errors = 0, tx_errors = 0; @@ -337,6 +334,9 @@ static void rcar_can_error(struct net_device *ndev) can_bus_off(ndev); if (skb) cf->can_id |= CAN_ERR_BUSOFF; + } else if (skb) { + cf->data[6] = txerr; + cf->data[7] = rxerr; } if (eifr & RCAR_CAN_EIFR_ORIF) { netdev_dbg(priv->ndev, "Receive overrun error interrupt\n"); -- 2.35.1