Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3329245rwa; Tue, 23 Aug 2022 02:59:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR5sXGZhSOk+s7CHIBwUTh7sMAyVY0Lxef4uEZPSB1ERSMHRqZiIdOS3IvJei7B5nSPPD6/P X-Received: by 2002:a17:907:7628:b0:73d:5917:1f4 with SMTP id jy8-20020a170907762800b0073d591701f4mr11123004ejc.139.1661248745455; Tue, 23 Aug 2022 02:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248745; cv=none; d=google.com; s=arc-20160816; b=b3VVjUV71J0wsERD1AWZD1bLCa6CfywKmodeqtX2BVQUQj7QePEEZZrpHimnLQoj1B Q39zT984hIVuKudxt9RX824kZUTaAn4wBRiJzBoE9+GY3UThFYAH5MGUcJHYD0wA866G TNCYdjsNpRmEPzjqMDVfAE7d7bXgwATPtQJrOpANDB0d/UTCEK1pVFw8z2DURYUtPEW3 J7u2A9XCNvdBfnW4kkjCajocdStn9GOeRjh9Wjim7GSaiVq0kSipQrcoTl+DAVuo8GWh f8E93o/lK1T7IJUOxnbgYS+OX2irQQI8wq7o+UaX18CBRwqmNGHrQFwTMALZsD/JgAV0 IYcQ== 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=oT0fBODJPOCZMLHX7zmS4339Mzk9CuJawLH+bOOqriM=; b=nGjEltyWytOgtyWH+yWFzzdga1AB4315bB2cXU3BgUCymkjdB0HzwUBDQ1CDVm+29z QOwWR0ufvX1/9vYHJ/XF7v+xuroCEskQWYauITBVWxSvNPi7viBGeFqWUnlsLydivEAF F3QVragz7+5O2gYxLloOcvVJoAOWwIByORn+CXTgRlR9rFSQ4JvyMfNGf1lC52+KVFvv dc4QI56cn4N/KKp2bNUZnIOp75uMKnl+E2HWVcvs9S1tUoOyQnj8ZpqU67soPra6a9Al ZuGLOrTTBOmYZ7Ns+bZmVE9z9yrsTXmdBJUzbJSgBPbo5YxDn9I1OAKzjgxq8muUbDRX 5sRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="P7k0Fjq/"; 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 s12-20020a1709064d8c00b00732fce8c673si1234246eju.883.2022.08.23.02.58.37; Tue, 23 Aug 2022 02:59:05 -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="P7k0Fjq/"; 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 S235232AbiHWJo0 (ORCPT + 99 others); Tue, 23 Aug 2022 05:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352263AbiHWJlI (ORCPT ); Tue, 23 Aug 2022 05:41:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18D2B98D3D; Tue, 23 Aug 2022 01:42:02 -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 23F71B81C62; Tue, 23 Aug 2022 08:41:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 700BFC433D6; Tue, 23 Aug 2022 08:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244080; bh=iYhJD2UgRJR95NPqJWe+oX3OQWhXxLif3i/DPaAugS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P7k0Fjq/90i8A4Yw5xGHl+Yy0HymfByh0zT6hybYIP0BxgobgtimJ6OREgZ+cD/uJ hTnY7eMIOpjP8c9S51ktTfejQjcRECe4xgJkFHgWG/TPsVLyma3jQP0wwnUREistbv 8yquOLRv3dmDY+t1ps2fNhjgCfx9iq4iYZiARydw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , Vincent Mailhol , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.14 083/229] can: sun4i_can: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:04 +0200 Message-Id: <20220823080056.698887887@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 0ac15a8f661b941519379831d09bfb12271b23ee ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: 0738eff14d81 ("can: Allwinner A10/A20 CAN Controller support - Kernel module") Link: https://lore.kernel.org/all/20220719143550.3681-7-mailhol.vincent@wanadoo.fr CC: Chen-Yu Tsai Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/sun4i_can.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c index 1ac2090a1721..fea82be623b3 100644 --- a/drivers/net/can/sun4i_can.c +++ b/drivers/net/can/sun4i_can.c @@ -525,11 +525,6 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status) rxerr = (errc >> 16) & 0xFF; txerr = errc & 0xFF; - if (skb) { - cf->data[6] = txerr; - cf->data[7] = rxerr; - } - if (isrc & SUN4I_INT_DATA_OR) { /* data overrun interrupt */ netdev_dbg(dev, "data overrun interrupt\n"); @@ -560,6 +555,10 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status) else state = CAN_STATE_ERROR_ACTIVE; } + if (skb && state != CAN_STATE_BUS_OFF) { + cf->data[6] = txerr; + cf->data[7] = rxerr; + } if (isrc & SUN4I_INT_BUS_ERR) { /* bus error interrupt */ netdev_dbg(dev, "bus error interrupt\n"); -- 2.35.1