Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3222774rwb; Mon, 15 Aug 2022 21:32:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4JGNOMovzAlrZNcOUhFxWQ6t3vPB2mAkKl89ssUncz8tRy8K8uTPvDNY70vXEljkR3zw8C X-Received: by 2002:a17:906:4786:b0:732:fc99:cf68 with SMTP id cw6-20020a170906478600b00732fc99cf68mr13256618ejc.18.1660624369790; Mon, 15 Aug 2022 21:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660624369; cv=none; d=google.com; s=arc-20160816; b=wjgAPZ61nLnkelujLVM70q2GQOdfBWGEBq1g7fm37tqoaYEV9tCkANLD+JU0Sob9nm ajQdjMZRBW8gywFdnyk3/zcjnM6uTab8Wre0kOQC1OrSL89R5Zin/i+X/UBjsMXoQZ2r N02HIxcvJ1wrruOoyDWczxECWrUcPSnGO0fbsanYtqAgWuL2XdxXE6gzt+/T53Nn7gci cVtNjsl1S7OXzIJVBiM4GfcqTSNJljUAyE+n8ImOjoi5H9LckPYEHGDQgKihFbbUcRiU 0yZjgkjny83ntQkSdcb7aI228Fpmvo7+T75JtMsAXtFT/8p22c0xYoAKEf9GbG4Gev0X T/PQ== 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=YbIZQd7m3DG1mBDVsnwZKLRTet7crZ56FsJOSiMmWyg=; b=SMUgrGJEM7FCZhmkujbUKhxtuBEyes26PoH1owHfzT6OADCrDz4PBGUkvAE6/nT8L3 UhHu0llKJz+xq1FyPuTaC2a27QA9/1jqLNnfdLJlLcnSQUoumXfQPjP0eBTBWm5zOfpd Pob9pJRLpNaX3yZ/HUuSrprR80D1rPqkaWMu5QlVZdz1okXiRr2TmvKo07ukLMh4LzhY 5FAebwgFiRqkQcuNxxeKN4sBebUOWK8RxX/ELsrqKvpe2JgK1tbE8dws7/BsVDjieSu1 jkFc54k6cYPX8vqqddFtROLtsCRKtfzprqfy46MGmbierSTHznm70clxTqzCyKbcU4Zx 2Tbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="HlVK/9HJ"; 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 y3-20020aa7c243000000b0043de91de57asi8393407edo.270.2022.08.15.21.32.22; Mon, 15 Aug 2022 21:32:49 -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="HlVK/9HJ"; 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 S229687AbiHPEa5 (ORCPT + 99 others); Tue, 16 Aug 2022 00:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiHPEaa (ORCPT ); Tue, 16 Aug 2022 00:30:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5B31607B8; Mon, 15 Aug 2022 13:19:14 -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 D6F3D60FD0; Mon, 15 Aug 2022 20:19:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC2D7C433D6; Mon, 15 Aug 2022 20:19:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594752; bh=uruAPTWq+uwmNsnotCboz8+40N/AfDji6438gd667fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlVK/9HJyd3SgcMyHvAZ6omdQPwZ4sTbCGZUg/vTz4BdQbBkx+IxHrzXXZkRMmCgd pPoZOMXfsCJqhgSl6PkdXdDmmY7uQ8nhudhOjMwDy+SSln81iJIOB00UnZiVvHNuIS rtL5lDEBcc/DANjZTNozn173FbNVPgJtbEn4A/wo= 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 0516/1157] can: pch_can: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:57:52 +0200 Message-Id: <20220815180500.339609662@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 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 fde3ac516d26..497ef77340ea 100644 --- a/drivers/net/can/pch_can.c +++ b/drivers/net/can/pch_can.c @@ -496,6 +496,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); @@ -556,9 +559,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