Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3457227rwa; Tue, 23 Aug 2022 05:12:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR5GNh2eEVwLLucYb2du4xRmhbT5vhmwMW+1pPvZpVjdyLZ97/y0wa7ULnp7GjJhFyiHTYxf X-Received: by 2002:a17:907:3f23:b0:73d:a5a6:1630 with SMTP id hq35-20020a1709073f2300b0073da5a61630mr1081304ejc.730.1661256764787; Tue, 23 Aug 2022 05:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661256764; cv=none; d=google.com; s=arc-20160816; b=r8e3rbIQqRa2RWxwPk0m/MeOwQ223k7qbY8Mr9wGN07CyPGaZj5MQnGuiDW6Ky9O9Z Tw+5hK1RXjGNKoEVOWu3gOeGSLJo5/BcCYvYhbRjCEvKSvOBESBL4EfiZPcHGre3plgM cwlp6sJMJptUDVmEC+2SwibyskZ1zLuNp2/O6PHKW1BLcfrhydOKldOLCeHqwGaWp7Kr C3Qu4dg9ULWBEl7pLs5AsmfjFyzfVvxOKVzH6838g8aZvIgTIOtfO6u81a9PDJ5pqUWh fLdxiK839+PQ0t62mZVr2hUCwxZgyKgvoPvizK6vCyygFqp5oJH3IHhseG2NzrmUe/86 829A== 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=eBJkjqNA4TcaavKvhGyPiKeuEcYec5whdR9Mp9vDUcDRx7DleRmsJLCX1LuK21GuVv 1PO6/SUrhKFvrwcGaNp3uhYOTPD1QmToIjem6WwG+d8w08qOFsQ71PkyxKFm4+VGu7qy VZjeFbr3ibK9BAwPHBro1iHHP3Go0V1iFjXHpoRlhZnz2+Q6ooPBTVK3t7hcS1UAgGEg CK+SzellyH/LaK63LWNCtor8GZmJglpITwSO+i6Tqo6Nm+srm0hQekKumljIhMpSfr3r 5wAFdgvS4sLdkpKcgxTeDHby01+fZNs0cFvQP2PyS3rY6SBhFAkLQhpYgr2kAdpo6ChH J/DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KU3cAjPh; 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 ch8-20020a0564021bc800b004419b8cac8fsi1872591edb.509.2022.08.23.05.12.19; Tue, 23 Aug 2022 05:12:44 -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=KU3cAjPh; 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 S243683AbiHWJpV (ORCPT + 99 others); Tue, 23 Aug 2022 05:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351943AbiHWJkm (ORCPT ); Tue, 23 Aug 2022 05:40:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FC187960E; Tue, 23 Aug 2022 01:41:38 -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 71C4BB81C3E; Tue, 23 Aug 2022 08:41:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C917BC433C1; Tue, 23 Aug 2022 08:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244059; bh=DPuyn0vXH02KiwaX6fibOkAwgcLn6wDShe4JqCjHAHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KU3cAjPhLcF88hRRiAgE2Q7FBDie9qxf5I3I4SW33LA5d7bcOg8P+YZkQejrOHxJJ qYAWexziG19ZTcx3/eteaNbYC8B7ZkAyARbr0ddsPUWDGEy+FrlMX84/VOgWdsRxjl HlZksYaB3YD/HDtqzn8f8ph5VUAdPFYL022IZX1s= 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.14 080/229] can: rcar_can: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:01 +0200 Message-Id: <20220823080056.577409346@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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