Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1860102rwb; Fri, 19 Aug 2022 10:34:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR6JX10K1rEX2fV4SoOQLQnz353Dbg4Rp2hH8FvaBNbJ+0pU4cEPt+Oe/LfEqB86fZhSS2zf X-Received: by 2002:a63:fb56:0:b0:429:983f:b91e with SMTP id w22-20020a63fb56000000b00429983fb91emr7173737pgj.399.1660930490492; Fri, 19 Aug 2022 10:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930490; cv=none; d=google.com; s=arc-20160816; b=cZ0fziK9/HymlszD3xDX83t4QDOqz9MOH5Zz/Uo/P5JVJRnTSeDSQTNGDuY+w0lkkq VKofggb1z3I73uXeCgj8Yd/T23u1MbYuq24vxrG6ulN6vggi9Ua217cj9RYsccAIIhPH Bs9H5FMnP02PCrl+FtxXnztKvG5q2AgNEhkasAj/x97bjlfKreLk6oX6C5peaMZYhvj5 ed31ZR7L0+me/bNMdlCR/C01N8AIwRSsh6Zo7DvnkvyrwX0tPp9y30EKDyHCGB21BaDT Ej+OXN+dewHQIomi0HTFJjN0UW4kMmM4RIJcvywvuOFLvOYFnOp3i+iiTN43Wbh/O4TS NaZg== 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=vIGIOVO2k1vmTE6jLTdn17r5BNJ/zhWye+gi3mUOP3w=; b=p8GNXtwq5JzOMY1Fm9rTSECT5KXXgExExiQiAq9sHj6+Zw8YuCcRcWilQGVU8TJY3l q8LP9aziRUU+SOMP6/J8IaSB1LH30M1kZ56yQ488N0QORhpVvBS/TGLdZ7DMH8sqMCHV B4/WS1DlvgsHC94pDtAmIhVbF8DOM+Ffsl1WXnkgMLfmn+UieZAow31hBvoBYsz4KI34 xl7U8lV3rr3ZcbypIpnzizpM6rC8vmLR1Oia/Pdys+ZSOsZaQLIJNvfWbm5B2wSXK899 wZf5gwhI97KqyDe9ofKzjF0P7zyswfVd/4u79fMkVcdOYF12q3mG1sc7mwFFjpzgIv+4 aBCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oNVjxT2F; 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 u186-20020a6385c3000000b00429fb1ac37dsi1540625pgd.222.2022.08.19.10.34.39; Fri, 19 Aug 2022 10:34:50 -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=oNVjxT2F; 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 S1351770AbiHSQNx (ORCPT + 99 others); Fri, 19 Aug 2022 12:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351829AbiHSQM3 (ORCPT ); Fri, 19 Aug 2022 12:12:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 779E8114A59; Fri, 19 Aug 2022 08:57:45 -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 61DC9B82816; Fri, 19 Aug 2022 15:57:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B74B0C433C1; Fri, 19 Aug 2022 15:57:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924654; bh=rJ+PhV+/cLp8Cp3pnU/YhwUnctyHEVl368DUQpC7H6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oNVjxT2FMzXg1/8iRdsO/ZcIeJ4RpmPX0fkHah6cJZlafuGvyBDyHECD+mCZod2nC foZBIqrgW+Bvh1vNCigm6qzzQryTkwW0kt/w+zEf0erkbD3WLS6AH7EVeUKKed2KM/ v8uurN20zv4IBP6UA5fJ9eCldL4bFLrigyGXpD9M= 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 5.10 239/545] can: sun4i_can: do not report txerr and rxerr during bus-off Date: Fri, 19 Aug 2022 17:40:09 +0200 Message-Id: <20220819153840.058651593@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 b3f2f4fe5ee0..39ddb3d849dd 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