Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2927408rwb; Mon, 15 Aug 2022 14:12:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4HtXBNyjSrLr7kWwF5YUqv0snB/VqGS8jwwhWBFhssM+Tlka/dk3KncncmTBNNRE+ZcNxc X-Received: by 2002:a63:8a42:0:b0:41b:de9c:2106 with SMTP id y63-20020a638a42000000b0041bde9c2106mr15159661pgd.6.1660597970528; Mon, 15 Aug 2022 14:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597970; cv=none; d=google.com; s=arc-20160816; b=MhvBqx3D39RLO5szDf8IyIfgDFk6hU2aO8V6Gnjl9x5JfWN9xhj+ro8iDVMQJpSiXL CRgj9tvi0Kpfr6vO2qvUYG5AoWdMZ/8rEzYFYEObD/nyZYsBsaU418lCU19dD5oO4wSG 4x12OaCvUUvwSaL6j0odX9rbWa8ZwQGnthNL2yozQ1uY0/ow6wO/sqHbp+xZWxPlwcBL aLCZ3nUp9E212ul/tgIAXun9BaJ6IoiNmzsHYXBZ6qtR7dfwynW4gLc79H6xT3MaHNt1 Hlf9lyF442xIoVJxlEEYS74SuLYtJf5z8I/I+05P+D/OnvwroNPuC7yf2vnsChvHFhv+ 8s3g== 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=YvncVjjHgkuuCa5bV4J8ts62bKtCEUIjMiNkLyU7gd8=; b=o4QXriJluow+NwJDALed+nnPpxBH7YnuJtSGBbaHMIw7RbTZbjOhRV19HfkaEQBe3g +YkoiVLzcbnLHgtF0tkNhV94uuTTJql3JLE/R0OD0fyTGbSqw8WIrQ11Y+k//PIrV3Zz O1y1yUud/pR1d50x/W4c6JALgCFUMg5cGy24xDnQeUaAIznR905Gbds3UYw99tr6KtH8 yn4wq1WYQmB2RSCAmrD2JHAnX91VlYdt5gEhfb5yTOWFY4zyv885sj474K3W6OoRzCoD M0rk950XLb59i1f87WQcgOhSn8wFsgKr3sZrVFq/iLi/X1GSp9GCzIm1hCzPSFrSABre Vxgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N920RhCH; 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 p14-20020a65490e000000b0041c35254230si11274744pgs.452.2022.08.15.14.12.38; Mon, 15 Aug 2022 14:12:50 -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=N920RhCH; 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 S245155AbiHOTDj (ORCPT + 99 others); Mon, 15 Aug 2022 15:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245047AbiHOS4f (ORCPT ); Mon, 15 Aug 2022 14:56:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54A6A13E89; Mon, 15 Aug 2022 11:31:20 -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 03019B8106C; Mon, 15 Aug 2022 18:31:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64524C433D6; Mon, 15 Aug 2022 18:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588277; bh=pra7bgqG8B0oe80z4hTPgBltj34wEKu3m3tEpNh2ngg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N920RhCHM6u4L3yKUwL6HpJYxpmBp8TGducSWsCDCXjyW5xWpp98RAFdFi/TlA3Qd k/mil9UaZYUVJhDwVugfuEkMfYTYp5OTSX20hEcrrV/KvII/t6Bpa0+n7TJCvGA5Ch OvAv5cTqVQYxYu+05HzwhRUTnG9esux2vrOnTSVE= 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 351/779] can: pch_can: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:59:55 +0200 Message-Id: <20220815180352.245349523@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 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 964c8a09226a..f20e75eb1ce0 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