Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3409146rwa; Tue, 23 Aug 2022 04:25:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR62Xz62K9q1zQb5NrrqvkhoZPpOM3/9a/1yk7mS6pwWbLi44vIlE9YGnAgzgULBaKhD2+Q1 X-Received: by 2002:a17:90b:4c8c:b0:1fa:c44f:473a with SMTP id my12-20020a17090b4c8c00b001fac44f473amr2840935pjb.195.1661253899996; Tue, 23 Aug 2022 04:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253899; cv=none; d=google.com; s=arc-20160816; b=BnOmFozrmBAY20N/MdwKyt4QcYQlDypz2qzwbc62vYVIZ5K1VdqkjebVC/w8SVPZJq wp7RTbj8MXDKrBDO5TCP52Ss5YaleyvwQXJ41ObXNwwGwVYwxZivqMayKxmBWkwDxv/+ CSyUH2x6WB9gCHXtO3H7qmensV0NfnUkNcNr+X51FqjAIhZZ94TYJt45FTy3bV8GBsuU hJGaZx0ExRLqYIE3AxzbBbEXRPABry/N0Rp2hTLV37v4CA4GN7I8hMRB5CMUDmI9K5SR icztCSXZVRjJq/uRhs1QoVjDRT0qMut1NJBQZ0zB2TvEQn5TjV0BQBumVm2D7mFBam64 4ZuA== 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=b8rKfFDCR4pxw2DaSIuZguLQfeW8hQ0/oM1WfaRivq0=; b=LGy2GmRu2DInxoKQ+j7zOLpg1jLUYJM0trngBiI2Q1nmAF+DefcsHABTiEcoQ/TSOZ CclwWFjTRWXTZjU1KysTmvl9wJUbc8hNbaqMI+lGQAEmaUK0HefVn7YnHNYO1EEQSy7l waFW/W6XGubxNyxH0hPstasAi80J9jusk1piGhVrUa0zzzm+jrWbaNS4pFqQcGJ/Hu52 NetBbX5AbHO4JnhiHZucQBWGyJOj6rBemtoPtsvyJQzYZkWCRsJbKYHiYD/mGxEFc6RD ZU5I66BaQItLHLErdLTDnnV9DsPnjXBrZnvdax/oCy5aA9v/8HHlMwIyKqP+cJkGu1Fj qR8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DN5FpuZj; 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 t18-20020a17090ae51200b001f72e6d910fsi16843450pjy.15.2022.08.23.04.24.48; Tue, 23 Aug 2022 04:24:59 -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=DN5FpuZj; 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 S1355649AbiHWKkW (ORCPT + 99 others); Tue, 23 Aug 2022 06:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354383AbiHWKZ2 (ORCPT ); Tue, 23 Aug 2022 06:25:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D43832E9; Tue, 23 Aug 2022 02:04:59 -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 4591261584; Tue, 23 Aug 2022 09:04:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 407A9C433C1; Tue, 23 Aug 2022 09:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245498; bh=XZPsukZTb+hTMSm+/vEq+mEJkXlwXdR0DPErYIV/FtM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DN5FpuZjEq5qDRsucJaXEBT/Bk6iE+cd4URqYFTqpFJaVpxkLlmTag51F3+5avfc/ Pc+gGad3/K7pHrYqRTKzH0mNQQvUhEpM1CJDn8CsQHjdzNxh84aIJTPvneFCpOgB5+ aYA+BIzbis4MAO/fNya5XIdjoX0k0PKOkXDOQfUk= 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 097/287] can: hi311x: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:26 +0200 Message-Id: <20220823080103.623190342@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 a22bd630cfff496b270211745536e50e98eb3a45 ] During bus off, the error count is greater than 255 and can not fit in a u8. Fixes: 57e83fb9b746 ("can: hi311x: Add Holt HI-311x CAN driver") Link: https://lore.kernel.org/all/20220719143550.3681-6-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/spi/hi311x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c index 472175e37055..5f730f791c27 100644 --- a/drivers/net/can/spi/hi311x.c +++ b/drivers/net/can/spi/hi311x.c @@ -688,8 +688,6 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) txerr = hi3110_read(spi, HI3110_READ_TEC); rxerr = hi3110_read(spi, HI3110_READ_REC); - cf->data[6] = txerr; - cf->data[7] = rxerr; tx_state = txerr >= rxerr ? new_state : 0; rx_state = txerr <= rxerr ? new_state : 0; can_change_state(net, cf, tx_state, rx_state); @@ -702,6 +700,9 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id) hi3110_hw_sleep(spi); break; } + } else { + cf->data[6] = txerr; + cf->data[7] = rxerr; } } -- 2.35.1