From: Gal Pressman <gal@nvidia.com>
To: lirongqing <lirongqing@baidu.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/mlx5: Fix wrong register access in mlx5_query_mtppse()
Date: Mon, 15 Jun 2026 15:02:58 +0300 [thread overview]
Message-ID: <054e047e-84a3-4dab-ad5d-604d16fc347d@nvidia.com> (raw)
In-Reply-To: <20260613153654.1810-1-lirongqing@baidu.com>
Hello Li RongQing,
On 13/06/2026 18:36, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> In mlx5_query_mtppse(), the result of mtppse_reg query should be read
> from the output buffer 'out', not the input buffer 'in'. The function
> currently reads event_arm and event_generation_mode from 'in', which
> contains the uninitialized query parameters rather than the actual
> register values.
>
> Fix by reading from the correct buffer 'out'.
>
> Fixes: f9a1ef720e9e ("net/mlx5: Add MTPPS and MTPPSE registers infrastructure")
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/port.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c
> index ee8b976..2ab6a6a 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/port.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c
> @@ -921,8 +921,8 @@ int mlx5_query_mtppse(struct mlx5_core_dev *mdev, u8 pin, u8 *arm, u8 *mode)
> if (err)
> return err;
>
> - *arm = MLX5_GET(mtppse_reg, in, event_arm);
> - *mode = MLX5_GET(mtppse_reg, in, event_generation_mode);
> + *arm = MLX5_GET(mtppse_reg, out, event_arm);
> + *mode = MLX5_GET(mtppse_reg, out, event_generation_mode);
>
> return err;
> }
This is clearly completely broken, which pointed me to the fact that
mlx5_query_mtppse() is not used anywhere.
Can you please submit a patch to remove it?
next prev parent reply other threads:[~2026-06-15 12:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-13 15:36 [PATCH] net/mlx5: Fix wrong register access in mlx5_query_mtppse() lirongqing
2026-06-15 12:02 ` Gal Pressman [this message]
2026-06-15 13:09 ` 答复: [外部邮件] " Li,Rongqing
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=054e047e-84a3-4dab-ad5d-604d16fc347d@nvidia.com \
--to=gal@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.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