Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3468864rwa; Tue, 23 Aug 2022 05:23:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR52tP4IvUAj1qitHnctD4X/nDhPqZ+TEAY4il58fruaGLQ6qds8JjQ+pFlSQm6qQ5YCB44W X-Received: by 2002:a17:90b:3d90:b0:1fb:151b:b5cb with SMTP id pq16-20020a17090b3d9000b001fb151bb5cbmr3133576pjb.210.1661257414932; Tue, 23 Aug 2022 05:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257414; cv=none; d=google.com; s=arc-20160816; b=DdcIc6D8OHaMb6GDbATNr+TLQjsKox4nfAownMgjgdbaXbHS94JZG2W+TyWKiAgP7m cN+EjWNq0zaLRdfIhIMrzbEkZw3BP2b/JpeXFj58rhb9cMmTfcEsUMTEgxUFMMz+sZJ0 MYpdnNT11lrBig/tbGDjhgqHuJFPi8ezDQK/rxAkl9rUYCuibKFo/EUVgRDy5n13L1Bc vxmLpN/KstRTULlN4+4qpautF7+CwTau0k+SgalefeUUOld84l3ROTUOBNOwX+Fia2NV chsPc/e2f84Lant3KT2egnwGwLbTBW/3bvRRc7e7dy/m1a1ttVfY/g5XxljHH7Ar2a6z IE+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=ApMQcx/usQxHpBY9ifPs5hCbWXnotesbXI+qAUhTXdY=; b=yhXLGu4nKVzZJ4KJ1LDmchDtitVHA7liTtw+RkLphgRagChQIo7KL5RL5oz69MOeOF 492nl1U2Oe+AZILi1FeeUqL3kzt3cQw5wcKuhpu+1gRxE78Kq9fXD9PBDNivmpCpl3z8 6O3zzxYGnE64Vh01+LP+aGcWLKalkWaRWbljiTgRShwLI4juc8W/pCJ/c/3h1Sd0sGna S/6b7Z8CKD1nIEBkxKzMPh2CtDgWG+kJi64GAzX6o+EPuajhO9dld69i1Tn/CFwphasd sHiNsNcbiJsM1kxRI6ImHbj5YiSctuTrAQ8MEWLFW30LWkYH52+rhqyzCOp5XBXFx3Vq lncA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jDMENSr9; 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 j6-20020a63cf06000000b0042a36364c46si13154188pgg.385.2022.08.23.05.23.23; Tue, 23 Aug 2022 05:23:34 -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=jDMENSr9; 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 S1349072AbiHWKkH (ORCPT + 99 others); Tue, 23 Aug 2022 06:40:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354207AbiHWKZM (ORCPT ); Tue, 23 Aug 2022 06:25:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03330A405C; Tue, 23 Aug 2022 02:04:52 -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 6A51CB8105C; Tue, 23 Aug 2022 09:04:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE4D2C433C1; Tue, 23 Aug 2022 09:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245489; bh=DWD3GZq6j5zEbQtORBVne/OcWKHdw1NZa8O3C6p2FYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jDMENSr9znHagoxOCSTAhblZbcbb0DB1Xuspaakv+NFVA5Da8OLhM4sUDdotPIKA8 0CJHSytTT/hoSTI+ukNEbfLua8RiPu4G8hdUrOPo6pJZNTxzQMswwK0d+dgUiQUskY 1YwZpDNRJZY1YyT/UT6y4AY2nTjtRc1zmm0YKDnU= 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 094/287] can: pch_can: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:23 +0200 Message-Id: <20220823080103.494719635@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 3a5c7e4611ddcf0ef37a3a17296b964d986161a6 ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: 0c78ab76a05c ("pch_can: Add setting TEC/REC statistics processing") Link: https://lore.kernel.org/all/20220719143550.3681-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/pch_can.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c index ced11ea89269..3e1d71c70b0d 100644 --- a/drivers/net/can/pch_can.c +++ b/drivers/net/can/pch_can.c @@ -507,6 +507,9 @@ static void pch_can_error(struct net_device *ndev, u32 status) cf->can_id |= CAN_ERR_BUSOFF; priv->can.can_stats.bus_off++; can_bus_off(ndev); + } else { + cf->data[6] = errc & PCH_TEC; + cf->data[7] = (errc & PCH_REC) >> 8; } errc = ioread32(&priv->regs->errc); @@ -567,9 +570,6 @@ static void pch_can_error(struct net_device *ndev, u32 status) break; } - cf->data[6] = errc & PCH_TEC; - cf->data[7] = (errc & PCH_REC) >> 8; - priv->can.state = state; netif_receive_skb(skb); -- 2.35.1