All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Til Kaiser <mail@tk154.de>
Cc: netdev@vger.kernel.org, stable@vger.kernel.org,
	Petr Machata <petrm@nvidia.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Vadim Pasternak <vadimp@mellanox.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] mlxsw: Initialize register query payloads
Date: Thu, 15 Oct 2026 19:00:07 +0300	[thread overview]
Message-ID: <20261015160007.GB1836432@shredder> (raw)
In-Reply-To: <20261014173117.26305-1-mail@tk154.de>

On Wed, Oct 14, 2026 at 07:31:17PM +0200, Til Kaiser wrote:
> MFGD register queries can exhaust EMAD retries and leave Mellanox
> Spectrum switches stuck during boot or shutdown when running OpenWrt
> built with GCC 15.

I assume that you don't have CONFIG_INIT_STACK_ALL_ZERO enabled?

> 
> An example failure is shown below with the second line wrapped:
> 
>   EMAD retries (5/5) (tid=9b544fc100001f35)
>   EMAD reg access failed (tid=9b544fc100001f35,reg_id=90f0(mfgd),
>                           type=query,status=0(operation performed))
> 
> On an SN2100, the failure occurs during driver teardown on reboot.
> On an SN3420, it occurs while probing mlxsw_spectrum during boot.

Can you share the firmware versions?

> 
> The register query API transmits the supplied payload to the device
> before replacing it with the response. Both MFGD callers pass an
> uninitialized stack buffer, so the request contains arbitrary register
> field values and reserved bits. This makes the request depend on stack
> contents and compiler code generation.
> 
> Initialize both MFGD query buffers in the firmware fatal event
> configuration and reporter test paths. The initialization has been
> confirmed to eliminate the boot and shutdown hangs on both switches.
> The subsequent read-modify-write still preserves the other fields
> returned by the device.
> 
> Also initialize the FORE fan fault query and the MOGCR mirroring policer
> base query, which pass entirely uninitialized payloads. Restore the MTMP
> query initialization in the temperature history reset path, where only
> the slot and sensor index fields are set before querying the register.
> 
> This follows commit 5b0907407e7f ("mlxsw: core: Zero payload buffers for
> couple of registers"), which initialized other query payloads after a
> firmware field length bug caused firmware to consume uninitialized data.
> 
> Fixes: 7d83ee111008 ("mlxsw: core: Introduce fw_fatal health reporter")
> Fixes: 2c6a33cd334b ("mlxsw: core: Extend hwmon interface with fan fault attribute")
> Fixes: 4039504e6a0c ("mlxsw: spectrum_span: Allow setting policer on a SPAN agent")
> Fixes: b890ad418e1f ("mlxsw: core_hwmon: Extend internal structures to support multi hwmon objects")
> Cc: stable@vger.kernel.org
> Signed-off-by: Til Kaiser <mail@tk154.de>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

  parent reply	other threads:[~2026-10-15 16:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 17:31 [PATCH net] mlxsw: Initialize register query payloads Til Kaiser
2026-10-15  7:48 ` Björn Töpel
2026-10-15 15:59   ` Ido Schimmel
2026-10-16 10:56     ` Björn Töpel
2026-10-15 16:00 ` Ido Schimmel [this message]
2026-10-16 10:53   ` Til Kaiser
2026-10-20 21:20 ` patchwork-bot+netdevbpf

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=20261015160007.GB1836432@shredder \
    --to=idosch@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@tk154.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=stable@vger.kernel.org \
    --cc=vadimp@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.