Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1083001ybt; Wed, 1 Jul 2020 18:26:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUTlLevr2g9jXOv33j0mAkU+6sOge63YYO0cUAVQFDX0puP4vyU9/e8kolQXsFq4N+T29T X-Received: by 2002:a17:906:d8db:: with SMTP id re27mr24869204ejb.554.1593653161921; Wed, 01 Jul 2020 18:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593653161; cv=none; d=google.com; s=arc-20160816; b=Ptz/WTCSZRkffRrxup2gZ0xtEv/rqKAIbKvedxH728jCV7jBuaKOvfFLM2Vp+tEj0i BoEm+WOL8qVahh/6rmSWF+fu+SodcVMpUkh8zCXhbd2BdSSl187B31I+x+TIRpuqnp+Q cI0n7avhQaCeNUFWMUOPjVQBBm4AQfxOkgqbjsG7Z1uxoAmW7v7x7tYfCUE04DSEQuUA QOZRp7YGlTzpPBhVprTSYumbGwuyZMgC0EP/Jfi5r2uPk8V2j8fA2PWqgZE0GzleirJp 1Klb1p0jTVGLIMeWuNC1T2768Q9r4tExTedcQicSD5lVAjYFQVPSikmxIU4ltP/xeS33 d1vw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=auAPtMj4TTAeESvqNmTYxL1DJ3EveYkGKQBihOymPq8=; b=aHN6+TiQdcce5PlVY4zfP4yMZR/Mvek2Uq28EdMiR2TXgp9pYEB0V+tcBm8QkLldxR QhgdU+j5V9sQ3ZUpbZWfohSYQPcUdd04nnxSGP/ivU1pBrDaFrggUKuN6XV7Z/roz+/u jI9ccNn/oswaLMAz3t86NILIIfHyntanEdGjmyY05Sjuwfgtgfmc6Enbv1HYv8qFl4uM 5sgcezPyHRcg5q+csj9iJON3rV55Pyacf0tbw6rJHN7aKUd4x82Ic8D2TO6pstBrDbvu eD+v5i1gCf84G7GK7RnyYoi/0Q9+KKlDc9MW9d9QFCeIkJqBEsUZeX7J7Vip0NaBu+sz brtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Km9usEWJ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si5006195ejx.87.2020.07.01.18.25.38; Wed, 01 Jul 2020 18:26:01 -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=@kernel.org header.s=default header.b=Km9usEWJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728384AbgGBBXd (ORCPT + 99 others); Wed, 1 Jul 2020 21:23:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728226AbgGBBXZ (ORCPT ); Wed, 1 Jul 2020 21:23:25 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D94182082F; Thu, 2 Jul 2020 01:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593653004; bh=/iKWu7yE1HMeDOswpVBK72JghZL76IlXEEd5Zx1knVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Km9usEWJPXBYG8qkO67I5YaIPIxrG/CyXZbLivsKycoMfkti9G9e3vNUrIEcjOE1C MjMcdeth2NsMnjsBG3+LUgsfxe9U3JGQATDTHdZZx7TmdeOUmko/WO3ivmnP3gY0bt y3hsB2Y+ckyYbvV0aGWwyggQBCTn38++kBe5il6A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Christensen , Michael Chan , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 24/53] tg3: driver sleeps indefinitely when EEH errors exceed eeh_max_freezes Date: Wed, 1 Jul 2020 21:21:33 -0400 Message-Id: <20200702012202.2700645-24-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200702012202.2700645-1-sashal@kernel.org> References: <20200702012202.2700645-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Christensen [ Upstream commit 3a2656a211caf35e56afc9425e6e518fa52f7fbc ] The driver function tg3_io_error_detected() calls napi_disable twice, without an intervening napi_enable, when the number of EEH errors exceeds eeh_max_freezes, resulting in an indefinite sleep while holding rtnl_lock. Add check for pcierr_recovery which skips code already executed for the "Frozen" state. Signed-off-by: David Christensen Reviewed-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/tg3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index ff98a82b7bc47..d71ce7634ac19 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -18170,8 +18170,8 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev, rtnl_lock(); - /* We probably don't have netdev yet */ - if (!netdev || !netif_running(netdev)) + /* Could be second call or maybe we don't have netdev yet */ + if (!netdev || tp->pcierr_recovery || !netif_running(netdev)) goto done; /* We needn't recover from permanent error */ -- 2.25.1