From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrea Fois <andrea.fois@eventsense.it>
Cc: Pavan Chebbi <pavan.chebbi@broadcom.com>,
Michael Chan <mchan@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
George Shuklin <george.shuklin@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tg3: add new module param to force device power down on reboot
Date: Tue, 9 Jan 2024 21:31:24 +0100 [thread overview]
Message-ID: <d8ed4af1-5c83-4895-9fc3-9aea25724fd9@gmail.com> (raw)
In-Reply-To: <20240109194551.17666-1-andrea.fois@eventsense.it>
On 09.01.2024 20:45, Andrea Fois wrote:
> 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"
> <bool> is introduced to fix both scenarios:
>
Adding module parameters is discouraged. What I see could try:
- limit 9fc3bc764334 to the specific machine type mentioned in the
commit message (based DMI info)
- 2ca1c94ce0b6 performs two actions: power down tg3 and disable device
Based on the commit description disabling the device might be sufficient.
> 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 <andrea.fois@eventsense.it>
> ---
> 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();
next prev parent reply other threads:[~2024-01-09 20:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-09 19:45 [PATCH] tg3: add new module param to force device power down on reboot Andrea Fois
2024-01-09 20:31 ` Heiner Kallweit [this message]
2024-01-10 4:12 ` Pavan Chebbi
2024-01-10 7:09 ` Heiner Kallweit
2024-01-10 7:17 ` Michael Chan
2024-01-10 7:34 ` Heiner Kallweit
2024-01-10 17:01 ` Michael Chan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d8ed4af1-5c83-4895-9fc3-9aea25724fd9@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrea.fois@eventsense.it \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=george.shuklin@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).