Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090401rwb; Mon, 15 Aug 2022 17:53:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR579q+IPp981B5aSjW87wV7ry5gHhplrRly0rxaZfsV4e4u/1CPrrt7VK+K9eNJq7EAJC8N X-Received: by 2002:a05:6402:34c3:b0:43d:d8d7:a328 with SMTP id w3-20020a05640234c300b0043dd8d7a328mr16837740edc.297.1660611211017; Mon, 15 Aug 2022 17:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611211; cv=none; d=google.com; s=arc-20160816; b=OZZE6R9aZUCk9RbK67UR2Agc5DSSlesHWQwIbLq9MrwJ3SikWF2vQRd5+kEDDOQ1ha 7fHz6RIom3u9cNFH4DYRtqgQBkLRI3fd3tMMUTAx2W/G0tO09a09j2PoOu4UaaNg+ylN GmxTquNES4PVM4UWJ2vgF93Fe7AmMBNifYEKqZLj2ZHMqVDHKh0mDn5x3dsGnr78+bsm uj4hi3EFK/kCrkS1V0U5SqWdSrk26JG8f98WLSuDNJq8zs5LnD14ASVf6/Q6bh9VIKeF gIJ+GoxqTdf977xuv+j2eqMq0d4Qm61g1lX2DPe5GsoFzDZj/upOFrgjraJIX/mIGkkv 9gGg== 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=04T9FRiid00TQ5aPeCon+dcLb25mbmYATfZSsgKKgXM=; b=kUVphOkc/gdg253Httjj7E8d6mq5Zdn4TKNTKQzi66I6N1MoyitumkAEQPp42hIqem RYr/mosm8blKrvabDpELPQs9IPcD9zY2qXLuinX5tI0sZFc8zSvM493bJuDSi4k6Ekso soD4ub3kUDa3cLjjv2vtJ06y8fN3GyjwtfRkqvKCmelQ42KNZ5eqIchgawTyM90kpmwP 91bhOY9JJLFNH09ZeL/yG9lr78iXwedT22qG+IitUAkKQpm7qqnlyQ0jEut8enMeYMdm jnyDiWB750lPLUCIUUOTkltCciCvlMXU80KHODvknA/LH+fgD2TM+s83dVBrS/y+03c+ 8Jlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lpNa2a10; 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 hw8-20020a170907a0c800b007312bc3da99si8450086ejc.365.2022.08.15.17.53.06; Mon, 15 Aug 2022 17:53:31 -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=lpNa2a10; 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 S1356413AbiHPACX (ORCPT + 99 others); Mon, 15 Aug 2022 20:02:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356509AbiHOXyg (ORCPT ); Mon, 15 Aug 2022 19:54:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9478716101D; Mon, 15 Aug 2022 13:19:19 -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 AE769B81136; Mon, 15 Aug 2022 20:19:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11103C433C1; Mon, 15 Aug 2022 20:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594755; bh=R6stR1XDXcR4UhrtoDaEKY1aUuGWKo8noBF9JPYHjng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lpNa2a109kjWAFX65GydCQJcstB6AeEz8YSVDOEo9Y5kyOkafFP3IdlFJRXKR6Zu/ VxgUPwTGOz2YSLPeAZ05BsPKPv5wOTMNYavfJiu8z+jZi5Jyg4TfOCN0UTjDt1qOKT CnREGTsdUSo8pnAqLrjteL6K/LvdiaEmgCouoOlI= 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 0517/1157] can: rcar_can: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:57:53 +0200 Message-Id: <20220815180500.384810585@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-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 d45762f1cf6b..24d7a71def6a 100644 --- a/drivers/net/can/rcar/rcar_can.c +++ b/drivers/net/can/rcar/rcar_can.c @@ -232,11 +232,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; @@ -336,6 +333,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