Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3027966rwb; Mon, 15 Aug 2022 16:26:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6EiulDm9hpb/v3M74r3Fmb4B0IECoz1YvdIJOLz/Hx896K7MF2wF7+s2jtNYaZbMQn3LWi X-Received: by 2002:a17:907:724d:b0:731:8022:94e9 with SMTP id ds13-20020a170907724d00b00731802294e9mr11875391ejc.172.1660605983268; Mon, 15 Aug 2022 16:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605983; cv=none; d=google.com; s=arc-20160816; b=uPdvvYnLwCap7zqszBHWqK5WJxaQSpJi4JnqAbPzruTMj4/YhcPvDHGEsF5lKowMJq PKssddIXeGrM7TJg0zLZOSgecpFwZVc+UUKqXdsRrAY3DejQJCgpMMw8jNr17J9NlRJ+ 3jf+svWLpw5rDZyX5pdfqMMytFoCFVm3Fg3fX/HvYmU/Mt4uaEXKpm58OyPOR7q1CcO/ r63n7qfgTk0orEk/sD3c06ruqpg4TF+HRyu8oDB2gaknFKBji74cjbQtLBss8B6YXVmu ecwaE/Vg5Ih0rf1K747yM4BRWxhoo7jBkJyVzzYbDQusm7W1Frvb9acvAA+H8055Dsod S++g== 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=WrDNpi4pLAvX2LuAyMvjO1ziW/XT/ETrM9Yc+taues4=; b=vRwo+FRNgp/q9LmB67YCrD2C93FSG+ZelQuA48H6LG7SVbNUk7GJsQOSbl+rYcx+qL /GhySKDTgv+8jSGY0E7tsBgESPE5PhBZBZ4QTtw0RXMQyztKWE6+cA6Gn0snlpt9k87g NCyuYLCuGsESY4QMwq13pgKlxn7MntnO1qdTM0gMLt4hddQurLXzwHva2O9GDtVGc9F9 qExi7CaYx/SQ+JJoP14xTGpd58bYBrijjwcrftroL0siKAML8c3jCY2RbU9csyFCcI3m FF5Xd8J6rpmWLemg+qmY5vBxz6z2Nnn2bt9atCvmmH7LDRlh4nATxNIhBlSk0SOPPhtM ytjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ION5jsm4; 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 ej2-20020a056402368200b0043d7242ef20si7462403edb.110.2022.08.15.16.25.58; Mon, 15 Aug 2022 16:26:23 -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=ION5jsm4; 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 S244657AbiHOVUT (ORCPT + 99 others); Mon, 15 Aug 2022 17:20:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344754AbiHOVLs (ORCPT ); Mon, 15 Aug 2022 17:11:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53BF9D9E8C; Mon, 15 Aug 2022 12: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 dfw.source.kernel.org (Postfix) with ESMTPS id AF31660FAD; Mon, 15 Aug 2022 19:19:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AABC1C433D6; Mon, 15 Aug 2022 19:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591168; bh=+LY3GhzYm1T5o5hEdNkydbAr4fEcREFXwhcZw2B5lhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ION5jsm4cNlRcOkqj8OXcyF8nVIjktfwnO3zoaHl0mSYrC3t6LgFmWuv9FcgDo3pK d9Z/DiRZgJRid8LAFxWAjgCF4L/vFMlEFU7VN6mNp0YcQLhis8iY419e09cEKE6JIn CaK7GCgnPJ5wHiwRAOnJT3jAFA+865zhjIQy+CYA= 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.18 0492/1095] can: usb_8dev: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:58:11 +0200 Message-Id: <20220815180449.888894818@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 b638604bf1ee..ea63dc687fdb 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c @@ -439,9 +439,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