Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407070rwa; Tue, 23 Aug 2022 04:22:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR5zznXxbLRvvr3/claxfxKPjoeWykYSPIAr1GiBaqNqSx0x1DXSgJwcmhMT8YU0K+WL8QLU X-Received: by 2002:a17:902:ead4:b0:172:bdaf:72d0 with SMTP id p20-20020a170902ead400b00172bdaf72d0mr20815050pld.18.1661253768989; Tue, 23 Aug 2022 04:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253768; cv=none; d=google.com; s=arc-20160816; b=0btOeTx4fUG6ZY2wsvAGvoDLRC7Eefya4G72792sx+Im0bDeDZyIFi+zLkFsCSeXlQ ZR6gemVaxEyPD6IupsQ9G8SFvvmKxPela0Nd1l3YGy+gnIPryg2onF5YXKQnD76mveXa D9T/RQNd+J9HWBbMEUVpV3CTNekhUpStE8XxrKw1ta5X5dCT+ekNXMhj6lq3a8m3fxFr IOOKhO+eEd/TfhzOG4+Ua6UenSaE9f1eUgcLVTcpl09s0VJSG2m9WJbljGDnXcFkyMIw oGH5fSiq7DnliCel+46ZnTThioyfVuCPp3EKqOUnNvmbESTTNBL7kwmYeY7cR0OXnPL3 F+1g== 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=Gtk1zRSWN8wP6MH9HZFRC+gSFjAzZ7MCqBUAFlQgPvI=; b=CNSqpESCRvUfRMJPBZXRuPxE/kraYfN2AZhzWaEIM4Udxd5CS3BeYQimkiuUiLhoyA /V2Cj9W3Smtj9UyrtXSDeR3FaCVp7bQNTrHPwD5F/DJGLip9YC+3mC+Ys/5r8xg8JJVK 0hCnfetti6KVDA/L/vaZUiVaGD6QTHccPJq13iaimo1nmT1mvNns3hPzm06+uX++fPFr RedIuxUjGuWDEG+s40VILNyFgiL+Y5Xabsx2ro1J4DDWIHOq7AKDzYpJ6rA77hJzCcfZ iRiUc1jaPlR1er3kVjacMyiif8FJOEsE4PQ4VOhe8ZjdWzf5SLLrAC2bpxnrCvxeLHfy 1N4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=17fsAOGY; 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 oj15-20020a17090b4d8f00b001fab8938920si5709724pjb.152.2022.08.23.04.22.36; Tue, 23 Aug 2022 04:22:48 -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=17fsAOGY; 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 S240596AbiHWJnz (ORCPT + 99 others); Tue, 23 Aug 2022 05:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352084AbiHWJkz (ORCPT ); Tue, 23 Aug 2022 05:40:55 -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 081F545041; Tue, 23 Aug 2022 01:41:47 -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 75F99B81C69; Tue, 23 Aug 2022 08:41:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9B5FC433C1; Tue, 23 Aug 2022 08:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244087; bh=6o7dFMo7ClTdnFjrVOtoQR+dS9HFFHcI3I/lUGs2dLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=17fsAOGYS3LkFdWTsVaFOCRC+uwAp9DAL9B2UDD6rg19XE1ZMK8EC21dotMlXqKMe K2/sXgVkv26rWp87er0NNmOxP6ELg338TNTAZAeaWenyZgkWauDkaP7j1IDX02RNOk 3ooP05QRGGimmFhbo/WhB4EVv/ByLj3081ihjOck= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Mailhol , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.14 084/229] can: usb_8dev: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:05 +0200 Message-Id: <20220823080056.731785849@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 aebe8a2433cd090ccdc222861f44bddb75eb01de ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices") Link: https://lore.kernel.org/all/20220719143550.3681-10-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/usb/usb_8dev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c index 232f45f722f0..5cb5be4dc941 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c @@ -453,9 +453,10 @@ static void usb_8dev_rx_err_msg(struct usb_8dev_priv *priv, if (rx_errors) stats->rx_errors++; - - cf->data[6] = txerr; - cf->data[7] = rxerr; + if (priv->can.state != CAN_STATE_BUS_OFF) { + cf->data[6] = txerr; + cf->data[7] = rxerr; + } priv->bec.txerr = txerr; priv->bec.rxerr = rxerr; -- 2.35.1