Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2935998rwb; Mon, 15 Aug 2022 14:23:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4HQ2HFXi3OunubfyFINf7811X/BUpyegUwfa0TgA6r/UcirltdykKuKSLtuUS/nqTvMtev X-Received: by 2002:aa7:c3d1:0:b0:43c:c713:fac8 with SMTP id l17-20020aa7c3d1000000b0043cc713fac8mr16200052edr.371.1660598607960; Mon, 15 Aug 2022 14:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598607; cv=none; d=google.com; s=arc-20160816; b=t2kHT48YH1dXVwivkWUfwfWV4QH+JxyFjBodFY4v3fo7BbOFi8x05Srf7dIcgnSdDw FR2wf/6dIKSo8e4e9Ghq7vB+Vub87A+laZLsnwQFhdTJu/F56FqCsNSeNdi+DgD7kHaP DonzaVWDMRNxAlAqTszdK8zgLkCLDQW1PuZIhe2OoF6mOpsBI4ik9sJ+M6kQXc5ITDGj L+rzY2xnMlBaaevqgkNvF8ZiwcamkROMhG8f7J7d3Wn87yDoGHymNT7cf4TPr89laAxT BbfATkwdPmK+xd0gGHFMs3twbrt5x/SjspsT++GISQJ8Y3EdPNDa3+EnehOSPSvcuL3D Ewug== 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=GhuGV0qdV+mldKMErCxQq2X/hLMHi3h60KQqR1KmUO0=; b=Bbc2Z5CKauSRxaqCoCBwRNQnek8+DnQmjwyJuLqS9MEGn7yyyxrraPc0xayYL/6jAw EnklKbFKkxEo8PPJkDgSwxMDda4Sb+WN5Ts5pPkITKqOyfrgmjReEwCtk7NFaYmva63n 0gBjtwZzZa6xHRTEUsPf2NHZyjCWxQtyN8poKhmS4/BWJVPINg9TA9v/3awLyzHOKAob ROGTjsQ3T8HAsOvBL1lEUBGSY7hOM2MKKu6OLSdhyNJeFG6W+HoleU4mwfF9vdxr1CbR Lgliyx9pxo8CB8bAAuUi34YSIDQGt7xYD4g1GjhCXcM7EKtch7xe5ykA/xFVqYkU819G /psQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X4ewcEFr; 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 w2-20020a1709061f0200b0072f4b12916fsi7187448ejj.395.2022.08.15.14.23.00; Mon, 15 Aug 2022 14:23:27 -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=X4ewcEFr; 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 S243003AbiHOVTg (ORCPT + 99 others); Mon, 15 Aug 2022 17:19:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245264AbiHOVLS (ORCPT ); Mon, 15 Aug 2022 17:11:18 -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 EE7FD564C7; Mon, 15 Aug 2022 12:19:08 -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 61D1FB81128; Mon, 15 Aug 2022 19:19:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E0BDC433D6; Mon, 15 Aug 2022 19:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591146; bh=Mc5px7yuSl0vtm8jgs5tSOtHfACObvjp6R7zxjWog5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4ewcEFrzXkGhAO6jobjsMCO07ILyEFlzSMqiDXQhY2mfLuhmEYksyeZJ7ysHjMmC uaWmso5TrKv9QLWGrv0oXspqTZQ+R6U6t1BC/V/ozt46Qb2ikjvFrKNN20IrOSceUc mt6BckBZ3q3vp+1ckC+u5PCqH5omt7NPoZgg7cQc= 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.18 0486/1095] can: rcar_can: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:58:05 +0200 Message-Id: <20220815180449.659850915@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 33e37395379d..4ca5b09f1e5d 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