Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp691008pxb; Mon, 25 Oct 2021 16:44:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAHxx7Dg316GTkRrWZOKx9HG8T0PE1fMRNMLeWerqGUXC9sahyvUcG7dEsWCMDxjSm+jCP X-Received: by 2002:a50:c88c:: with SMTP id d12mr14050798edh.102.1635205459176; Mon, 25 Oct 2021 16:44:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635205459; cv=none; d=google.com; s=arc-20160816; b=uAKnF7jAiUOW4AU8yU/sP70Agg9xKNDx5K9m7zmFnKz75TGFdR222ptZikyhNlbxa3 ezFAHPYf7TPQxbj4I67fi5kYSZ+1rOdIk7CY4BOJ2G2Z+8RGfQKGkJJiMpfyTW38J0Ta kw1zacMoGD6NWC3LY/ohqvBjYKi2d04nbZgsorCu+GRGlRqx/6GWJjFBN7V80arfW0kV VhT+W4YaRDuHpvR0p1603pEVxkQOa+8I9sp40Q3Uw0gDlHDY+8eYmgFQpuAwWq9Lel3/ xgyxPaRWQKiIQdykQvFe5y6/3h6889BLUw+2MpChQHRnVlmRikCBu9tOcNNO72yh6wiW jMRw== 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=1Ico6nbxf1udX11GNGU/ZFx3SBK/ip6YRDLKb6vNcGc=; b=L/ev+1FluUSKOi3+yhyMBHy9FWdotVeIamWf1l0u7yXT1XSOKiQG6PO7qVS8TOaUuK qVL/e9bkMlw79Z0XJHQnWCV2AOKNvqvoAvuysKHK8B8U2fWYj3O0HP2gWdaMi/JZ+O6c bxkPSC3rkXng5sEunwsFaGaA1yLUv1dHfzVenHfKhM1zhMzZM29Z/rKpCam4ta38nT0W 4vJ7VwJgQeg/4qWSe8gYZ+i0v8NNutjX49ha7V5LF2DDYqnBUUm5JGQ8fA0F3NpkRP/K WACes1I5RSJw96exSl4wqJAhHdXsdw/Bd/rcYsNdDwBdtlpO/3al8nWoq045pn+seDRJ v9zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fndqZB0b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb28si15796279ejc.258.2021.10.25.16.43.55; Mon, 25 Oct 2021 16:44:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fndqZB0b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234166AbhJYTkI (ORCPT + 99 others); Mon, 25 Oct 2021 15:40:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:48384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235965AbhJYTar (ORCPT ); Mon, 25 Oct 2021 15:30:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 718B8610C9; Mon, 25 Oct 2021 19:27:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635190054; bh=K+b/FxmH+5elf00PaE0iTL9bqU+4t42Ah4rBCc5X/wA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fndqZB0bqiRHqdHFrxi+9MrVBCihFMJgx7SULRjuGQaQoIhuXwRZ+coCqezDy1a03 r8mc2F8yNhMClL55BlV2vs3KX/iPOVV+8EtDUAeGbS5zrcmu8lhRTvzFklZjaD67wN VSgZPcUHJA8xarksECLukAGKFRh7ZmDVAbUz3b6s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ziyang Xuan , Oleksij Rempel , Marc Kleine-Budde Subject: [PATCH 5.4 22/58] can: j1939: j1939_tp_rxtimer(): fix errant alert in j1939_tp_rxtimer Date: Mon, 25 Oct 2021 21:14:39 +0200 Message-Id: <20211025190941.145550242@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190937.555108060@linuxfoundation.org> References: <20211025190937.555108060@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ziyang Xuan commit b504a884f6b5a77dac7d580ffa08e482f70d1a30 upstream. When the session state is J1939_SESSION_DONE, j1939_tp_rxtimer() will give an alert "rx timeout, send abort", but do nothing actually. Move the alert into session active judgment condition, it is more reasonable. One of the scenarios is that j1939_tp_rxtimer() execute followed by j1939_xtp_rx_abort_one(). After j1939_xtp_rx_abort_one(), the session state is J1939_SESSION_DONE, then j1939_tp_rxtimer() give an alert. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Link: https://lore.kernel.org/all/20210906094219.95924-1-william.xuanziyang@huawei.com Cc: stable@vger.kernel.org Signed-off-by: Ziyang Xuan Acked-by: Oleksij Rempel Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- net/can/j1939/transport.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -1230,12 +1230,11 @@ static enum hrtimer_restart j1939_tp_rxt session->err = -ETIME; j1939_session_deactivate(session); } else { - netdev_alert(priv->ndev, "%s: 0x%p: rx timeout, send abort\n", - __func__, session); - j1939_session_list_lock(session->priv); if (session->state >= J1939_SESSION_ACTIVE && session->state < J1939_SESSION_ACTIVE_MAX) { + netdev_alert(priv->ndev, "%s: 0x%p: rx timeout, send abort\n", + __func__, session); j1939_session_get(session); hrtimer_start(&session->rxtimer, ms_to_ktime(J1939_XTP_ABORT_TIMEOUT_MS),