Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1858486rwb; Fri, 19 Aug 2022 10:33:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TRz1w+kzL2wv6zkwf+G4iM5XknKp57idaNtEW3AVh0LlktmIJHd9Ik65+O9CH/srG8adv X-Received: by 2002:a17:902:760c:b0:172:adc5:fc9 with SMTP id k12-20020a170902760c00b00172adc50fc9mr8484094pll.102.1660930390565; Fri, 19 Aug 2022 10:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930390; cv=none; d=google.com; s=arc-20160816; b=UvGPdYJqGuE27yJljhxAFG5v4wnDabuGtzK8A1eB9m96TbxgTj2dWlYypezvXBtU6S r85DL0Z4fn0fd0YE0YFESw6yt8WwpuLGHDEW18fb8GAEq8YVEnjfxWbfhMEDQULHocZj OVPPM3rQBVU5EO9GpNbC0YnSem6H18a/0Zg5ypd5C2piqPIgHUfDeTlMjIOsWR81aQFU B+6fAF4RRkb3F5xNTUwXvikoZ/9SfxUt7m5X695KlGWB5jiBbTLAF4b5/eR0igEKwi82 0TUBgsx2a0sy/q/1hjLwsFSHFHn6OQHtufI6a1PdeoEfH9cSNCPfHj1TaWy3KttMQHCF +LUQ== 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=DxJC3yspdbC866emCYgdMx2PCrfdI6lnEiHLATKFl9Y=; b=CupPflIF6s9Tf4cDIc/MGLI5tvV35XSZK3Hnc9+Q49JCnEyQP17YTsmlNGsr0Gsnfu Df29HmKqUwVajk4B90ylh33OapCBRpyLMsFl3wZNP7W7I+9Tla7rW1XEDAI5MQx2JMUW C1bXQfOiQW++KcsS/YK8EbOvHVh2rOJoHDTL8t3JYZi46XNtGIP/2sDJ6MB+v/6i6Q4M bRd2hZ8BFbt2vCQZvFe7iTf1weZ3glXtoJ/FEwFzwmMlyC+rQ3KLAsxAgCkRDEOb4u34 noEk0qFmYbMW6brYiBOxp2j9WYirRk17sTy2kvH/xM9PY/jPG/LhUKq7vnhLPSO0OaOv 5Kqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tsOBanzR; 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 e17-20020a170902d39100b0016e3d42897fsi801845pld.277.2022.08.19.10.32.58; Fri, 19 Aug 2022 10:33:10 -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=tsOBanzR; 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 S1351943AbiHSQOd (ORCPT + 99 others); Fri, 19 Aug 2022 12:14:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351938AbiHSQNw (ORCPT ); Fri, 19 Aug 2022 12:13:52 -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 BA6BA114A5C; 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 558BBB82818; Fri, 19 Aug 2022 15:57:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92A1FC433C1; Fri, 19 Aug 2022 15:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924660; bh=GqRCdQk5gcrQtkUm0Jh9s9TsuaLzbGufsrzGeFlIiVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tsOBanzRaisG77t8rigqPFIjBVoJTfMuVQb6CFYUFV+P+AR036BwwWYyKryItx1vN 9VmINeoTEYLQMxPorwjcLRsvuiQmaphr7p+WoccyXPmOX04W06vxauzNndeWNlNxg9 pEKEKyJ5icfmsz7/wBJS6ilWIMHiMCuasl4uKPRU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jimmy Assarsson , Vincent Mailhol , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.10 241/545] can: kvaser_usb_leaf: do not report txerr and rxerr during bus-off Date: Fri, 19 Aug 2022 17:40:11 +0200 Message-Id: <20220819153840.145312989@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 a57732084e06791d37ea1ea447cca46220737abd ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: 7259124eac7d1 ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c") Link: https://lore.kernel.org/all/20220719143550.3681-9-mailhol.vincent@wanadoo.fr CC: Jimmy Assarsson Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c index 0e0403dd0550..5e281249ad5f 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -857,8 +857,10 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev, break; } - cf->data[6] = es->txerr; - cf->data[7] = es->rxerr; + if (new_state != CAN_STATE_BUS_OFF) { + cf->data[6] = es->txerr; + cf->data[7] = es->rxerr; + } stats->rx_packets++; stats->rx_bytes += cf->can_dlc; -- 2.35.1