Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp548513rdd; Tue, 9 Jan 2024 11:53:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHikLvptGhnUvXyTunVVkI39lwSsq79ziwNz8plxzvjCa7jowZQSwvDCJfL6PzPj1rEaba6 X-Received: by 2002:a17:90a:d252:b0:28c:ece4:f3e3 with SMTP id o18-20020a17090ad25200b0028cece4f3e3mr2777270pjw.85.1704830013982; Tue, 09 Jan 2024 11:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704830013; cv=none; d=google.com; s=arc-20160816; b=qK9x/ZqMnxmZ8HGrj8ZpU9Phh3rwHlrr3Q3mUicvKieoA9/JGkLmUCu3EKjW87sq5p 3Fhl7uk+/65ZTzAIbcWFjTZZRMOybysOT/dsOZ4C60ElCgjPX9RWwSKpUkCFKw4ovNBn 9v+uTKm7pKoyqkddfVGTC9prPgIlnU0SMH7c11mZ5ebzcfAKkH5fMtbx+I+FcfB1zB0q TGE/8zJL73Qlh44gLh98o1j/+GYcgttwNPDLM6OZbS8/Tx5fD7uQcSnadu+7mosV0DbH HId+qG0GD3luEhpsAEvnlfWpVuc+P7Kxw+DLIYeLHcQFSxwli5BNyRYir/iAuy77ReZZ Nzrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=M2bCGGcHnVzLUte1tx7A8Dnphq9ybEzGexSt3BjXLjk=; fh=r6b7/SQSDfsMHPhzECYzKr4o3N+AKfIy0VDih1MefsU=; b=sH5xYidXeqgs/QDhL6o78XBLF7+RNu7j203rx/c3VeNaralKJGIOLCBle7zEitZDFP rd13mKasEF9vhCzSbwqi3wvbMwuLP0y/WJgcuDlb1puVymmr4v/lmEE8qTx1Zg63B4XA bWeG72UAl4hmYf0BOOMAUscoS2vhDmknc1rklWxqGOEitB9+rbkGnNLkSkODMkjhnoce TmdaojSlcFwJ1g6J0FfuBrag6nqe9m17er5jWvuVdr01r42pJELlvQyAGUku/Y3sHtFP TW1uBno6AWYaGvoz87gQAn9gLBTB9DN76UAychr1lUMcuuUBtASwCU/UTXS1JwwiO0Nc yXoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-21361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21361-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z15-20020a17090a468f00b0028d2a726a77si1989836pjf.181.2024.01.09.11.53.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 11:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-21361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21361-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BF8E8B25930 for ; Tue, 9 Jan 2024 19:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28C653D3B7; Tue, 9 Jan 2024 19:51:41 +0000 (UTC) Received: from authsmtp.register.it (authsmtp14.register.it [81.88.48.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC6A83D38C for ; Tue, 9 Jan 2024 19:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=eventsense.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=eventsense.it Received: from krn.. ([138.197.190.30]) by cmsmtp with ESMTPSA id NI3PrbEZDI6zQNI3UrWDYw; Tue, 09 Jan 2024 20:46:33 +0100 X-Rid: andrea.fois@eventsense.it@138.197.190.30 From: Andrea Fois To: Cc: andrea.fois@eventsense.it, Pavan Chebbi , Michael Chan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , George Shuklin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] tg3: add new module param to force device power down on reboot Date: Tue, 9 Jan 2024 19:45:51 +0000 Message-Id: <20240109194551.17666-1-andrea.fois@eventsense.it> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfPQXaKfWonfFB+huClQ/fRPZupeMxuV2ZGs2JvtZNp6KWdzBy33NZVJ5hWxdsJ0tjVWKiZk64ih5pAuh7HWzC536Jepm3XfweVct7qH53x+FUCMfRxLs CuzwR4jkEzE/ew5VpS9clVLigiJOPjNt3FINZMABfH8P70Ak60f138aQX1KtZhnJsAlUts/2A8cHh6VCtuA+aRZVu/fSObtdzN12rjtiVwLSdTiMtFF80pUt Th0ZWC4F/G98kYRyLzRP0+qxFAYfRwuVkIh/SRdmHfTuas2hNzyeU/Ps2jcKVIWnYfL/yPGuwsPdIIgUlKBa+YhoE05zLltwoDkogR+wmfVPaDLshljeWVGg nz5BaZ+5wDL6E13ZoHouCt/C7ZckrWE2VXRFJUI6aQ4JcnHnrQX2eNe50aPfgvqOaERd+LyeFXk8R6R193K8Iw26BVDXgiOBPwwo0Poxk0PvzxSZfhovrZ6X CizoNs56EXflwoE3 The bug #1917471 was fixed in commit 2ca1c94ce0b6 ("tg3: Disable tg3 device on system reboot to avoid triggering AER") but was reintroduced by commit 9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF"). The problem described in #1917471 is still consistently replicable on reboots on Dell Servers (i.e. R750xs with BCM5720 LOM), causing NMIs (i.e. NMI received for unknown reason 38 on cpu 0) after 9fc3bc764334 was committed. The problem is detected also by the Lifecycle controller and logged as a PCI Bus Error for the device. As the problems addressed by 2ca1c94ce0b6 and by 9fc3bc764334 requires opposite strategies, a new module param "force_pwr_down_on_reboot" is introduced to fix both scenarios: force_pwr_down_on_reboot = 0/N/n = disable, keep the current behavior, don't force dev power down on reboot force_pwr_down_on_reboot = 1/Y/y = enable, revert to the behavior of 2ca1c94ce0b6, force dev power down on reboot Fixes: 9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF") Signed-off-by: Andrea Fois --- drivers/net/ethernet/broadcom/tg3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index f52830dfb26a..287786357c9b 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -233,6 +233,12 @@ static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */ module_param(tg3_debug, int, 0); MODULE_PARM_DESC(tg3_debug, "Tigon3 bitmapped debugging message enable value"); +static bool force_pwr_down_on_reboot; /* false == Don't force the power down of + * the device during reboot, only on SYSTEM_POWER_OFF + */ +module_param(force_pwr_down_on_reboot, bool, 0x644); +MODULE_PARM_DESC(force_pwr_down_on_reboot, "Tigon3 force power down of the device on reboot enable value"); + #define TG3_DRV_DATA_FLAG_10_100_ONLY 0x0001 #define TG3_DRV_DATA_FLAG_5705_10_100 0x0002 @@ -18197,7 +18203,7 @@ static void tg3_shutdown(struct pci_dev *pdev) if (netif_running(dev)) dev_close(dev); - if (system_state == SYSTEM_POWER_OFF) + if (system_state == SYSTEM_POWER_OFF || force_pwr_down_on_reboot) tg3_power_down(tp); rtnl_unlock(); -- 2.40.1