Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3078552rwb; Mon, 15 Aug 2022 17:35:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Jy/cNTz0LpMT+rMF2ty/da15eFYTZPG+xcx4XQgUXrz7h/cg+fZtWhDtSBhPeBpd0eiee X-Received: by 2002:a05:6402:3506:b0:43e:954b:bc8a with SMTP id b6-20020a056402350600b0043e954bbc8amr16941541edd.266.1660610146191; Mon, 15 Aug 2022 17:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610146; cv=none; d=google.com; s=arc-20160816; b=jtcZNLmI57WwyFBTW3aX1Ra/uK4rYkjwzDPN3sb0qfrgY9EEf6NFPv33HeU1M6NbpH cBoxtpFde3G3Jbmv8iVsO+N6xaLW+3+H3tClJJSKFpzHXOU2xMdokApvsAXsJxs7PoYH 1Flv8vi19YGjhjqs1fuBjM7F/oQkqaerIepzGfW8EBVFkXmreyqsToitvgQtkG7qcRAj feUTJ+SSTk8awomB9UDPUEwSzD/XdeaYb9vG2ytsH7AgU2Od12LUjjCfFHcM0b0rdX1e /2qFxJRDOZ4hkklx4KF+3Q5akHeKC9eHqqe3O/n1Z33U0YD45P8Rdjc3tppTBckRZZI2 /feQ== 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=Zh2/axJrbuWCH0pQpUJvMeePnZK1p01LWMkWyxnRD8LqzL0yKIXk1LGPcIXdxQGg2G 1CvETc4lZTq7bk9ly0tDUyM7nlNbE8wHz8NGolfoxUwQhjDbsjfJKubDwSk31N1SRfJs zZlnV5RGc81AgnDPUR+MUMkW4Rju6MMiUcjv9yX2M0uso+8WSXjbOUBuJl7/CwIzuRa7 0Hxxhg3DtuO6nWawM8v6SyrjE2YBVXo8IX0decxaAnubQvjfWptZ2Y74HBtS1rtEYYfP FMcAU8q3UBPltgpNgdJQerePLihLoJDBsARVDPnO97Qdpecc0oqvqaql6UWD82BXujTe IQ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0oTAkrJN; 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 d11-20020aa7c1cb000000b004403b2f0179si8328533edp.515.2022.08.15.17.35.21; Mon, 15 Aug 2022 17:35:46 -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=0oTAkrJN; 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 S1356539AbiHPACd (ORCPT + 99 others); Mon, 15 Aug 2022 20:02:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356531AbiHOXyi (ORCPT ); Mon, 15 Aug 2022 19:54: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 094EE1617E4; Mon, 15 Aug 2022 13:19:29 -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 825EEB81135; Mon, 15 Aug 2022 20:19:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB34FC433D7; Mon, 15 Aug 2022 20:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594768; bh=KjpTREGfDX1i7sYjb8h6LrLMdereyImHgHdSfSNAH0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0oTAkrJN0gzQtTI+6Via+2hKmw6TtwFsIO5r7PI7MaitD0KMijmb6djl1H69GP8Nx PhXGyzDYBhaEQQd94AOcnlme0LgzJZM21sQNHArTHUrmQD0rLDx32QaTbtbKl67Qr5 XM9UwP4RtvbScYSQT88VzJEPuNP942qLtCCSp5CE= 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.19 0521/1157] can: kvaser_usb_hydra: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:57:57 +0200 Message-Id: <20220815180500.535214341@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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