Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3416843rwa; Tue, 23 Aug 2022 04:32:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QMOnB7Zn+QA0gtuscKaHOFFr7Rq8nzzT9nGgwnLT0gf2Fa/A0Kl5ZiD32BMsP3HAUAjGX X-Received: by 2002:a17:906:6d98:b0:715:76eb:9e33 with SMTP id h24-20020a1709066d9800b0071576eb9e33mr16068407ejt.729.1661254378436; Tue, 23 Aug 2022 04:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254378; cv=none; d=google.com; s=arc-20160816; b=sGfpsBvSUs2F8ESjc+hB15WouzAxIXkZp2cvneo2QjPidjO9fAAbzU02aZ3cKg5XiI ov0kpPERq+U4HFtOZgq1HxzHAZ17Cb3qY5nvJ4iYO6SEyzh5lDw/VxBMVlAUgodasc4k a48rmGFdinCStQpfIywUWXpSSHJzNU8yD4Qk4ESaBhmB3BL7xd5WQtLDyBAVI5IaFnHc gEd5nqIxk/LWO5bgxAnAy1rbgtWcihRpUdEkaGQocQeyRvzmSAMYdzsp8T8jCDN+c2GI nSPy+FcFB3sXM8dbd/169Kj01Forkz79i07kPDhNxT89epk4T5AWkF1whk2UWt3DzcX8 CDZw== 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=s6lEOI1+f/ie1xfsTFWb/yTp3bXuPF6zwd1y3aNMlZUN6cmq+NnyzicnkvI0kux5av 0Syl/AUW9HfwOI8mu3VUSEv9uTRq3HhrU7duuvCbXPH3RIm+o+zFAZeS4MiyJlnxCaoO tm9vZmgag1GxgDNBTM1AzAFuWMi1zHo2JeNTXo76ZUqb/fAy1FC9n5ASIgRtEWS3RP7O E14If7COm/g+ppywgTT9AvXaaYIbGdjzWu1mr7wxlkBXX29aJLPYEgpCXBJ4SruF+kAD ie2f1oS2xECFtYHn7RDWxAVnTLa0LRDDDjM4P/j+ZHSAXyP+zfvzmcgwdvXQCtOVtb+x rKZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NrM3y7Aq; 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 cs15-20020a170906dc8f00b00733016bd060si6741280ejc.139.2022.08.23.04.32.29; Tue, 23 Aug 2022 04:32:58 -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=NrM3y7Aq; 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 S242969AbiHWJoW (ORCPT + 99 others); Tue, 23 Aug 2022 05:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352234AbiHWJlG (ORCPT ); Tue, 23 Aug 2022 05:41:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E01A379634; Tue, 23 Aug 2022 01:41:54 -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 EF33061538; Tue, 23 Aug 2022 08:41:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 037D7C433C1; Tue, 23 Aug 2022 08:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244074; bh=XZPsukZTb+hTMSm+/vEq+mEJkXlwXdR0DPErYIV/FtM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NrM3y7AqoNmqtXnElp4NLwNMMBtEH+Kow3n73sTFVdeAn77/ODI/5VzFI263ApZMJ MAkHdct+y440zcK6VuNoca0olCBVHptF7ZQHjuiDPKzuy2lzZRBhSedeTJmIjZgWUO +EqCFaLWyhtrmaGeqE55jeQ2OnE106MnwNQ+A67c= 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.14 082/229] can: hi311x: do not report txerr and rxerr during bus-off Date: Tue, 23 Aug 2022 10:24:03 +0200 Message-Id: <20220823080056.666348242@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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