Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2886358rwb; Mon, 15 Aug 2022 13:19:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR7K4VwfVuD88DDLvERVx7d0oVnr+i1H7gNWpqygBWgHSX5I2JGEBnQ7VRFRiPy7FTXaSI3A X-Received: by 2002:a05:6402:424d:b0:43e:95d8:eb46 with SMTP id g13-20020a056402424d00b0043e95d8eb46mr16235967edb.306.1660594743346; Mon, 15 Aug 2022 13:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594743; cv=none; d=google.com; s=arc-20160816; b=UMSeykMFWWV0HOa5hKSWPHcWPmpIrIJDQNabridhBvsHaBI04jVPTUMv7H4VKqVV1y ODOOZk5qh2bMQ2RLximH/enJRhiJKUPGunN6S7OTRpUMLFwIGkluaq7cPW0pYXmDdBUz lNql7BTVPaHipiAiZM9ucVq8YFPmSyAZOZmrVd5Fsam3J8cODO22Z7W/NYaT+Tc/iAi2 V/xTQihdLQ1nJlsAtjvGx3ywLCWBAFqRdKv+M7kpRclu+NeyxToKBReFXiGX7fic72dE tBDZUrLtMNS56W0KFcSyNJMv2/hHjQZdCML6hs8mRJAPhn59jwboRCdqX5SRKuOkAPeg ozTw== 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=wQ7YMPNNsSm5HQ4UPmGFTQacNN1UhTkamyeWUmQmMyU=; b=mL1S+u9xHP8EAHm+fGxwBgKMcYb6BuQhbnGcoAKcG6tlqR/L8Iq/bISwlVkh3o0kRg RFZH72JH3AjT4GqbBtEukC2jOVEZpH91Rt20hjCJBMRIt58NZsAqRiOh/NVDMPuI/GUv X5il63SDry6LqYcbtru7hBoF4vJFK5/Gu/q6OY5iU3HKF1z5Vo8QaK+xTyiuxhI4LUT9 1ctFEYggCQ/QpKLPLRAQo3idiTMuzr9IrlDMPTEL5hb22CLdX46Uwq2tylVmlyyaU8fx 29/vGzVz9OK+N3BhFqy5/g8hZXvgffTYzRSjsTanmeyho6cs17I74PfI9NV6IKA55SIz hntg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="woIop/JX"; 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 qf8-20020a1709077f0800b00730412fe4d5si10460066ejc.740.2022.08.15.13.18.35; Mon, 15 Aug 2022 13:19:03 -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="woIop/JX"; 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 S232367AbiHOTEQ (ORCPT + 99 others); Mon, 15 Aug 2022 15:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbiHOS6W (ORCPT ); Mon, 15 Aug 2022 14:58:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75C4B4A83D; Mon, 15 Aug 2022 11:32:35 -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 B3CF8B81081; Mon, 15 Aug 2022 18:32:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D877C433C1; Mon, 15 Aug 2022 18:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588352; bh=JTRANzMjaPOW8Ur2YW7iccu5qz+t3mRlHrXJ+b2dZcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=woIop/JXeBjcsD7IkWuFXg0QR42LLNN2NaLpzdfWKJ83LkBHyAx+C0O60VK6J/bnW h1iWFdFBBWLoeBtTYnkn031RKHVoF8bTTFMMnxtnbduTOzOf9BhpeQG0AnLNSyfa6u tPcyVu4nMNw9oxZyTEZuF4QXFipXvb4OvmZtFcRs= 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.15 358/779] can: usb_8dev: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 20:00:02 +0200 Message-Id: <20220815180352.539459225@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 d4c8f934a1ce..a5dee2ee2465 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