Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3081608rwb; Mon, 15 Aug 2022 17:40:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR4FSPWOylqtq6jQu2KBxUNZn29jhGbvTukXDaXJfjGvrUArhV/5WeiqUTOI1IGjpOT5wVAw X-Received: by 2002:a17:907:6295:b0:703:92b8:e113 with SMTP id nd21-20020a170907629500b0070392b8e113mr12016847ejc.594.1660610425164; Mon, 15 Aug 2022 17:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610425; cv=none; d=google.com; s=arc-20160816; b=NgggyXGWoruYhHQC+ok35LTWpojsQxxPaNmD2eWVDfomUsEn+bdJLSq/nJiiBwvi5q fT9VJiR51OfrtQXiQPa2JRrEyKeT6UYdqAR4utQrXU0roma2ZI3jt3UQOJwkYlQYyNlm DF1uJ9EZ6EqcTGIfov7M3NeE+ocJTvrZxw8/fjppBzIgXNahZWMko0gPBML7ZT+OA3TK exSFRvajXz8XyREF6+rjgPdRhvT4EULLyJphQWkxmw545tuYLjzVYQuODh9DNwMH/EW1 A3C9w+tBQQ6EwJjF6Vp6yg7Flk3fbnq3Y5L0h8bnst40cl+qegUEocxH2oYHlwhANTVc qeBw== 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=I09atBygUWNt3zBXAJKRyVGd8HyePGihMB7iu03NDqo=; b=y4QA5fN1GH2v4gSJN2a2cDRlA42TjsuLZo4N5HE4cUBQFLUAVPGXTCi9e0r8HMbm25 hXnMq4zxRqeBItRZBmQa692FrLwXdfP4bRecrz+OOgww7y0bAZSG3igtdK3TZTugA5F/ MFAG1pL98Ygs7EVACRHIi8JUjI30i4r48E07CCwZ7yI1VhyG+LCHzlMfzM6PRMnuqfHQ /W5CSf+qZSGzJy9ksLlFchQYNvUoAMtF7CgkZrDQDE0EV9PA3eEespRoXQ1hQo2hvVxw BV6Q128mOCnetYPgyHc17bPEOnSo23a2iXnOZS8FrGyMhhYjvO9iLMB4yDUgehZrYXPE vD3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="d0u/AoS8"; 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 24-20020a170906329800b007330202ea43si7775348ejw.394.2022.08.15.17.40.00; Mon, 15 Aug 2022 17:40:25 -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="d0u/AoS8"; 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 S1355603AbiHPAA7 (ORCPT + 99 others); Mon, 15 Aug 2022 20:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355975AbiHOXx0 (ORCPT ); Mon, 15 Aug 2022 19:53:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67CA515BBB8; Mon, 15 Aug 2022 13:18:09 -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 0622BB81136; Mon, 15 Aug 2022 20:17:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 136ACC433C1; Mon, 15 Aug 2022 20:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594673; bh=RzAaO9CyuzAmwHMfmCigLcQWCCAfjT2ur0aWeipoZ8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d0u/AoS8Rqw/wxZXufgl/4bDgEG9pqy8OuO4+uWfMpY92fXx3IdiQoKvPYlXJaDKQ /Pe2+3/gAOo3REULeLIu4CWURlE8IEu8cZjwDaYOgKvkJI2ihV1IQfnqAKDD82c7vh lsmCNZ9EunCp2FcY5zP+HBm1WykzO+RXvCZcQN7A= 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.19 0523/1157] can: usb_8dev: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:57:59 +0200 Message-Id: <20220815180500.593961196@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 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 f3363575bf32..4d38dc90472a 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c @@ -438,9 +438,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