Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3398203rwa; Tue, 23 Aug 2022 04:14:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR425DyQdvTieuFamUeO+A0TeL0ndXAY8+onRO+XWb5q4efb6sTysxybK4mJYCphdwXYtnoh X-Received: by 2002:a63:154:0:b0:42a:5176:bd74 with SMTP id 81-20020a630154000000b0042a5176bd74mr14762296pgb.521.1661253255989; Tue, 23 Aug 2022 04:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253255; cv=none; d=google.com; s=arc-20160816; b=DP5mlbTWJO4qNH2tNyu4XZIWVfyQ45yGpE6q98pOubbHcGi2JWzh3UvvPUfk9dzvps r5lRkGIJEziIU4sOe/K3z2WdEMTWNrSKswCGQjQp4N88jvKU11IsyLwK2MBl9S5kSv5v L1bvs/f0owKxIw+bwFtoXadc+FE1TAxIDorodIFb6AX0Dk2xTIbBEpn124DjhinxeIeN 3GZSHAMRF52DsdDw6FUbgRGjEsLX6mvFflOSlOkedC/z0aoFTGMfBYTtQJOZo3T4oGUw +Jaqj9rSkMg0cY77rInsw9ZxUqYtcALbEl5LLu7rDJ9JkkX0BKdIuFAMlxfkfMVCrAbs KuUg== 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=Roneccnp+h0AEKu+dIricodbnek2nXja/sUDoWua+aEErSdj6wrs2VpSaY/j9p+egD I3BE9z8qyph2c/jnSIpkPc/vjAnBVwoiuP84GIGz6urmfwO8K3PwlD3y5oipMAp3vGow qgeivJkvns3ud6pXnmfBKp/AeaHWcydpKL94GC57KJmnK9xabkj5V8k4mFl8qJb8z8LG Fy3spFjffL703My4+1EGl4JyUNMSbj0sGSLcXAmuwMK+6G2wfpVOWb2ubwD9kata55AJ s9NOYrj2Vf3CVGKiuIW0uNWUxUXuIffJUCuKEx/05OuHsykIU+1Co9HguZXdOqUxbr0V oUdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZEPOJGR3; 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 i7-20020a655b87000000b0041d00d8df51si14499241pgr.406.2022.08.23.04.14.04; Tue, 23 Aug 2022 04:14:15 -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=ZEPOJGR3; 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 S1355769AbiHWKks (ORCPT + 99 others); Tue, 23 Aug 2022 06:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354536AbiHWKZw (ORCPT ); Tue, 23 Aug 2022 06:25:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F27C8307D; Tue, 23 Aug 2022 02:05:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 10DB461538; Tue, 23 Aug 2022 09:05:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15016C4314B; Tue, 23 Aug 2022 09:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245514; bh=6o7dFMo7ClTdnFjrVOtoQR+dS9HFFHcI3I/lUGs2dLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZEPOJGR3XMrlCwDHqJDwaWJf9ausndDZ8NnZI/sL59DRCVja5aaG4tUuMtJuttL7K J5HE0sGB6AOaXDMpwvZwix+JDK9z3Yy4+LuuaImtJ2R6b7Y5dtTD76h2scpAlc8tw6 8hfGUvCB5gtawuKCBU1NTar6btOkoFwH84UHMfEs= 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.19 101/287] can: usb_8dev: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:30 +0200 Message-Id: <20220823080103.767855881@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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