Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1864346rwb; Fri, 19 Aug 2022 10:39:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yGPb9q3kFl3C7yirYObuIa9F4Sj3kGRx7AFXBGVauIIPRE51k9oly28Mmk9AILSg455Qz X-Received: by 2002:a63:8b4c:0:b0:422:9cef:9573 with SMTP id j73-20020a638b4c000000b004229cef9573mr6941481pge.21.1660930760549; Fri, 19 Aug 2022 10:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930760; cv=none; d=google.com; s=arc-20160816; b=wIIhFdKO2447btH6kMZ6iFWDTH7cWDqw0sMVbFviF72J+SeV+e8qKgK25WgMvywrT4 B1oenEMBjs9uq6npP2OCohNR0mbRLu/RmHALoC6TA7Sycjd1bVk15q1VFsUWJXUqKmbn n1bQbTRBWJqQzzBt8+b41RBlezw78TkT4SkN7xoy7Jts+5dqlMWquzkAxpQkK+s+/Uy7 5heduCFiOF90pX4ntfnXZ6V9+Wojbph5jF7ifoDXx0t5f7AL0g0FGOuswBibQIloyB/F L7prkQxaBFUN+v/cCK0IFJEma8uauoTbA1teRF3BgV5fFSQDL1rtJyI/dlGUaO8g0a/s H+wQ== 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=XsIlcZieIpEab0pANiEElWgHVWkqN0XokHN6LSrpX0E=; b=ESJFDRc5CKhGoCzMYqOKJBDYWq7a5AipC1llGKxcqz7vkn+Uk9Uldm6HSMWAeJNlxh D8Mqp8oUFDP8ATgwKSwhEzFWaSMVHhySjdCLdZ/p/mfyu3InAHdalKrFYeT3kveOJ+nh v2qqflOfIiIhfVg0O5V31leq05kzoGP48qWl27haplhEBbUobdAIUbrVb+C3HHkdkoA5 apCu+7ClQORLh9G9kM9VfJD2ZkGIu5Gu6vGNDKqERmRyKO1RzCkEfOWqUwji/zN24eTV UxJdN1bERcDKeZgygUkRlyLgPXhR/SyrsDmzCsZycbdZpIPM1XNnQI0poPN6jeTGF67H zgYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="LLsoSIq/"; 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 k16-20020a637b50000000b0041d322ad7dfsi1928879pgn.326.2022.08.19.10.39.09; Fri, 19 Aug 2022 10:39:20 -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="LLsoSIq/"; 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 S1351753AbiHSQO0 (ORCPT + 99 others); Fri, 19 Aug 2022 12:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351657AbiHSQNr (ORCPT ); Fri, 19 Aug 2022 12:13:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F776115214; Fri, 19 Aug 2022 08:57:58 -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 79BACB8281A; Fri, 19 Aug 2022 15:57:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA513C433C1; Fri, 19 Aug 2022 15:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924663; bh=+7o2r0aJqaeH7HNBtLIJ3QHNTeo1M/iksaW/zsRdm0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LLsoSIq/j62FsklsWMUyT6d2Nah1JEkpiFjbXECKKHM85FWA/nU53ikwTZePsMcHY 5MFWNtb9wE9TFHqVtjt7O2tgVKOUsfYfvZZf/6Q6p6gU7ZNnm7yAlpx5Wc5ueVMBFa /t6YoY1CCBE20IWK6jfVvJibdVCMeQmqCiBpYyaQ= 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 5.10 242/545] can: usb_8dev: do not report txerr and rxerr during bus-off Date: Fri, 19 Aug 2022 17:40:12 +0200 Message-Id: <20220819153840.187606733@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 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 985e00aee4ee..885c54c6f81a 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c @@ -442,9 +442,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