Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2877308rwb; Mon, 15 Aug 2022 13:08:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hIuG1aaShneU1Tmy/SEqXIVs2l2R2SV2PJZkanAXqUpRXkZCbcOMJHzNIbLPbXBuWTK58 X-Received: by 2002:a17:90b:1e0f:b0:1f5:37f5:159c with SMTP id pg15-20020a17090b1e0f00b001f537f5159cmr20046393pjb.189.1660594091694; Mon, 15 Aug 2022 13:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594091; cv=none; d=google.com; s=arc-20160816; b=wnLdBg+sB0lfV7L6x5uUj4Q8Vb8rmJ8uHDKy+wTRk2qvEyDZzlh2nV0a4cDy/5lwnY yzzLrcuj1+5YENYtAc6f1ZnfNA4cauzwN0NQqrE/NSgv6Jkd1l3y1sRjbimQxvE5hYKg Zp9447ltK3dwm56ttZFk5finr5GN3taRG+y/QFsJ+SErjPzmRh0miIXwZvQYO9hOmc0n NbZ2yk3ZVU/oUnpN23XobcTNju/mPiI4xNqRimlCkMMqPbtyWi3w8Kp+y16TE0tb01n3 aqhL93AvJ9UspLbbGk1qtveB4O0b+zC7NXcJ6aQqCuWNH5KphYTIHZDBZG2UrQGAzJm3 T5Sw== 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=lUzUNQvs9FKL0k1r+/gASKfT1fjZ51qkDeBJkhdmgL4=; b=xUSY8p/6d5/8SknDHJERCnyItd2/b1D0aNcbVidNhg6J9rk6z584pA7PFg1QGmjA6z PukVY/ZOT6U6hdCbhPxmbapCrAy41ypZRa/ufHnSL5RxobCTH56INS49dN1JEuq44p+F Zzo52/93QkhTV3LVwT3t/2QNAVGrin3kwsT7x9wCjtesdIvNBubK3oQaqybSdDs7VqiE HMFOzu1Jn9V7nihZGLG/2+UaxXSHTTnpO6GoLc44xi2ds8MC6Z4ymuyhAAUrc27TGdbF fJwYidsFm+fLzdj5FN5v31ty4IePEZssdEcuNbcFvOg3jZt/eXs0sIchP+kzCQ0iqWqo Lx8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LtJUTRCx; 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 y124-20020a62ce82000000b0052c5e4d5b4fsi8746954pfg.246.2022.08.15.13.08.00; Mon, 15 Aug 2022 13:08:11 -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=LtJUTRCx; 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 S244986AbiHOTAu (ORCPT + 99 others); Mon, 15 Aug 2022 15:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245092AbiHOS4k (ORCPT ); Mon, 15 Aug 2022 14:56:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02A65326EC; Mon, 15 Aug 2022 11:31:36 -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 A57D2B8106C; Mon, 15 Aug 2022 18:31:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F39D4C433D7; Mon, 15 Aug 2022 18:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588293; bh=krxEmlAhMWjFuXD+91ae82JjlUXKy2weARJAVJVH2KM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LtJUTRCxzTD1uINaYufDX5iGNr7Hcg5iMk/pZwMeuQet2hFICKg6vt0mZymbDlRmw +XGqqq4qwZQm1hY8dBEy2dw0QpJU2u9oNdA1/G08h8sVFhBt4STksscGQw4paizCbi dAJVzgRElh0XKpv4h1OjDCmovB3TTiT7OhzvDIXE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , Vincent Mailhol , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.15 355/779] can: sun4i_can: do not report txerr and rxerr during bus-off Date: Mon, 15 Aug 2022 19:59:59 +0200 Message-Id: <20220815180352.401450631@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 0ac15a8f661b941519379831d09bfb12271b23ee ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: 0738eff14d81 ("can: Allwinner A10/A20 CAN Controller support - Kernel module") Link: https://lore.kernel.org/all/20220719143550.3681-7-mailhol.vincent@wanadoo.fr CC: Chen-Yu Tsai Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/sun4i_can.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c index 54aa7c25c4de..ad8f50807aca 100644 --- a/drivers/net/can/sun4i_can.c +++ b/drivers/net/can/sun4i_can.c @@ -525,11 +525,6 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status) rxerr = (errc >> 16) & 0xFF; txerr = errc & 0xFF; - if (skb) { - cf->data[6] = txerr; - cf->data[7] = rxerr; - } - if (isrc & SUN4I_INT_DATA_OR) { /* data overrun interrupt */ netdev_dbg(dev, "data overrun interrupt\n"); @@ -560,6 +555,10 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status) else state = CAN_STATE_ERROR_ACTIVE; } + if (skb && state != CAN_STATE_BUS_OFF) { + cf->data[6] = txerr; + cf->data[7] = rxerr; + } if (isrc & SUN4I_INT_BUS_ERR) { /* bus error interrupt */ netdev_dbg(dev, "bus error interrupt\n"); -- 2.35.1