Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3020863rwb; Mon, 15 Aug 2022 16:17:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR5wrm/4TIYqUmOpo3+qNE7UbDMc9WMRhsMNUAQlvqgMceS8Ua+9PF7EvlgnD3RJlrK/Goo7 X-Received: by 2002:a05:6a00:181f:b0:52d:87ef:f9bb with SMTP id y31-20020a056a00181f00b0052d87eff9bbmr19126382pfa.70.1660605478230; Mon, 15 Aug 2022 16:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605478; cv=none; d=google.com; s=arc-20160816; b=RPIwuq1VfdACCbfZW3lBn3I8XHHdBMwXJUZOxPHbLpLum2gh5zyq4nFdfnAS9AJuSb efTzQil41/gqQKpmmZfi3YZdzWC40UBCAkOyePGOALlvBBFQgDAYcHUFYXUOHOIIdCCa 2ii2QMbDmoU8V2ywJsIfl9L2wxBV5v6P0Pjbq79N9KY0UpwIykyRsOppMsfJdXZL4bmz oMObSWU9djfBQUjfBl7aIHM26UiMnlWYHUsH7j9XEvZ+CpsDz8bHnnirprRrc6kgKn0s HaEjDSqhpVaRmmz5jeNrCxEO0ZEbbON9p18qw7gTUwgGnge3OV3giC9fx3t6MT4ZepXd 00pw== 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=xVRTN/OQogdYJs1CDzH4b0h36CPsT9Rkby/HgJ3eXu8=; b=yqAAHStB+AWIiy3W5F5aENffJz7wN/DmrZYx0Zc9CvkV3ckIgytuLuHZ/EeSoIspgV l537TrIdFJn8Z7pk8B5jJWweYuRXZmPk3931xYh8iSuaHVPU6yKqSNlyJU5WXbekB8xH 1sv+lx1HWMXIBBwKlu+bOwR+eiS0aEq0ddWT0gEH2H9L/RKxEpjLA/4NYMfD8bTHQja8 g4xYLVv8l+baDI9CkUYhXIPSLglfivOQrNVrywHpzBIulzqv1uiGqdqJWKWuwAHYm+Br FhrH25GJ0FLgkQdrjDOX8DlkdLQklIor1bMpi2JpitCVn5eHFSX8a5GBUiK9xIJNrtig hSRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="TV/4Go1+"; 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 d1-20020a170902e14100b0016d5cfc6fd8si10207979pla.32.2022.08.15.16.17.47; Mon, 15 Aug 2022 16:17:58 -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="TV/4Go1+"; 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 S243519AbiHOVTv (ORCPT + 99 others); Mon, 15 Aug 2022 17:19:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344327AbiHOVLi (ORCPT ); Mon, 15 Aug 2022 17:11:38 -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 4644CD8B21; Mon, 15 Aug 2022 12:19:21 -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 4BCC5B810C6; Mon, 15 Aug 2022 19:19:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D529C433C1; Mon, 15 Aug 2022 19:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591159; bh=KjpTREGfDX1i7sYjb8h6LrLMdereyImHgHdSfSNAH0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TV/4Go1+ZXalXbN2cmdAqM5W1Pyfub1JKgaK5dGhfMAWN77C2GcZb0Y40UJaGOA1J ER/DDAMK7kT4OoDGFUDyRALl0j13y/kL97jFTHc/3gK4VaXmFGi6GKggN/gGO+VYIk hH4vj101M4NmPGHlIGLqLENiIBb65+C/spjGJaHg= 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.18 0490/1095] can: kvaser_usb_hydra: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:58:09 +0200 Message-Id: <20220815180449.809307035@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 936e90595376e64b6247c72d3ea8b8b164b7ac96 ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: aec5fb2268b7 ("can: kvaser_usb: Add support for Kvaser USB hydra family") Link: https://lore.kernel.org/all/20220719143550.3681-8-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_hydra.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c index 5d70844ac030..404093468b2f 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c @@ -917,8 +917,10 @@ static void kvaser_usb_hydra_update_state(struct kvaser_usb_net_priv *priv, new_state < CAN_STATE_BUS_OFF) priv->can.can_stats.restarts++; - cf->data[6] = bec->txerr; - cf->data[7] = bec->rxerr; + if (new_state != CAN_STATE_BUS_OFF) { + cf->data[6] = bec->txerr; + cf->data[7] = bec->rxerr; + } netif_rx(skb); } @@ -1069,8 +1071,10 @@ kvaser_usb_hydra_error_frame(struct kvaser_usb_net_priv *priv, shhwtstamps->hwtstamp = hwtstamp; cf->can_id |= CAN_ERR_BUSERROR; - cf->data[6] = bec.txerr; - cf->data[7] = bec.rxerr; + if (new_state != CAN_STATE_BUS_OFF) { + cf->data[6] = bec.txerr; + cf->data[7] = bec.rxerr; + } netif_rx(skb); -- 2.35.1