Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3284277ybb; Tue, 31 Mar 2020 02:04:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuGTXihwu3L94FiN0yZW4Y2MHJ3CwGOfm7qV2CtDdWKEmiuk9VKCY/w2v6xApPtPZX6yCaV X-Received: by 2002:aca:ed54:: with SMTP id l81mr1402310oih.69.1585645489002; Tue, 31 Mar 2020 02:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645488; cv=none; d=google.com; s=arc-20160816; b=Sz0dKGraTgc2LXR1K8jkFwghyhX4n8MoljZ6UHm12anlTjo5FHi6x2yfiu6NUQtaEy k7iCN9DQnXBVHEsOgh19IZjJow1Gtmv/rc8T1lYRG7TatQPx82KAqFGDq/Llelm1NsQL D/nJl3KM5Q8M5GksUSEvokyrlVHE5mmX7V18rG1ydNGq0lQHz69ymKDrzUzbhhH925oT Dgol4iktV6Ji1nXV/WY7JBgoGuksUV5fp9HWgPJtJV9bmLD9oGU/7c4Z/V7phXqv1pDr EqM8FANhJjbFgN6yfyupuNPWQJ136w7XnyqSHbyZwrZyCWBIpU67sGOdsf04UvMoHXW6 hPOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IPoIRawe5rI3iUxg9BV+kT073JLsb2B55GgnF5JkCdA=; b=mz6Bg6fDHWBIZPyIJ3RSs8qA0lfaV3M0I1UL9wXLcGPvFCbpMR+STBh/AYp36OxTge WkKjnpEO4kBl5Okd6B+x6n1tj6v8fvA4gsDjzNfooSfP5XdC7HCFgDYAapxJXf083gjE hLakkr3qdZLa2HhBEx8iMGoJprIJyJDuIhS/9zVbVNmlFkdF/XDCsndBTLEuX4owHuvc U6MtdaYZblV8MQA/B1KRlvo48cbuB24+xNIgrAaN91YJ/IUn2aRauJY4rasHGdKR04aR v9KSwbJdV/UCtrJLep11ylR0cBxG8vNKutn9G3Qxr4sIjSn4tOsvf1O8G7b6hhV6kOol byRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pTRqATZO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si8398004oth.194.2020.03.31.02.04.37; Tue, 31 Mar 2020 02:04:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pTRqATZO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730884AbgCaJDw (ORCPT + 99 others); Tue, 31 Mar 2020 05:03:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:43616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730391AbgCaJDt (ORCPT ); Tue, 31 Mar 2020 05:03:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 154ED20787; Tue, 31 Mar 2020 09:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645428; bh=Po14qPslBUSQW5+rJhoPZzDlO390mhUWITIQyhjIjAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pTRqATZOojkYY3PG+fHC+7h4+3W4RXfgZqLHw8U461x8Dx/TOGcj0DBlVDdJqqTL9 XjQApSXedqINkSZy+5GAMykOHBNpryA5Q0bUFJwF8qqC8xhDYVTzGJB/u/Q+9L34Yp Be1mnPE4+moaBHk1Csi8NiRz1uBhH+Rfsyio52sY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Noam Dagan , Arthur Kiyanovski , "David S. Miller" Subject: [PATCH 5.5 050/170] net: ena: fix continuous keep-alive resets Date: Tue, 31 Mar 2020 10:57:44 +0200 Message-Id: <20200331085429.726319603@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arthur Kiyanovski [ Upstream commit dfdde1345bc124816f0fd42fa91b8748051e758e ] last_keep_alive_jiffies is updated in probe and when a keep-alive event is received. In case the driver times-out on a keep-alive event, it has high chances of continuously timing-out on keep-alive events. This is because when the driver recovers from the keep-alive-timeout reset the value of last_keep_alive_jiffies is very old, and if a keep-alive event is not received before the next timer expires, the value of last_keep_alive_jiffies will cause another keep-alive-timeout reset and so forth in a loop. Solution: Update last_keep_alive_jiffies whenever the device is restored after reset. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Noam Dagan Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2832,6 +2832,7 @@ static int ena_restore_device(struct ena netif_carrier_on(adapter->netdev); mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); + adapter->last_keep_alive_jiffies = jiffies; dev_err(&pdev->dev, "Device reset completed successfully, Driver info: %s\n", version);