From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Aya Levin <ayal@nvidia.com>,
Gal Pressman <gal@nvidia.com>, Moshe Shemesh <moshe@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net 12/13] net/mlx5: Fix access to a non-supported register
Date: Tue, 30 Nov 2021 22:37:08 -0800 [thread overview]
Message-ID: <20211201063709.229103-13-saeed@kernel.org> (raw)
In-Reply-To: <20211201063709.229103-1-saeed@kernel.org>
From: Aya Levin <ayal@nvidia.com>
Validate MRTC register is supported before triggering a delayed work
which accesses it.
Fixes: 5a1023deeed0 ("net/mlx5: Add periodic update of host time to firmware")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 +++-----
include/linux/mlx5/mlx5_ifc.h | 5 ++++-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
index 380f50d5462d..3ca998874c50 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@ -836,7 +836,7 @@ void mlx5_start_health_poll(struct mlx5_core_dev *dev)
health->timer.expires = jiffies + msecs_to_jiffies(poll_interval_ms);
add_timer(&health->timer);
- if (mlx5_core_is_pf(dev))
+ if (mlx5_core_is_pf(dev) && MLX5_CAP_MCAM_REG(dev, mrtc))
queue_delayed_work(health->wq, &health->update_fw_log_ts_work, 0);
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index e127c0530b3a..7df9c7f8d9c8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1071,18 +1071,16 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, bool boot)
mlx5_set_driver_version(dev);
- mlx5_start_health_poll(dev);
-
err = mlx5_query_hca_caps(dev);
if (err) {
mlx5_core_err(dev, "query hca failed\n");
- goto stop_health;
+ goto reclaim_boot_pages;
}
+ mlx5_start_health_poll(dev);
+
return 0;
-stop_health:
- mlx5_stop_health_poll(dev, boot);
reclaim_boot_pages:
mlx5_reclaim_startup_pages(dev);
err_disable_hca:
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 3636df90899a..fbaab440a484 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -9698,7 +9698,10 @@ struct mlx5_ifc_mcam_access_reg_bits {
u8 regs_84_to_68[0x11];
u8 tracer_registers[0x4];
- u8 regs_63_to_32[0x20];
+ u8 regs_63_to_46[0x12];
+ u8 mrtc[0x1];
+ u8 regs_44_to_32[0xd];
+
u8 regs_31_to_0[0x20];
};
--
2.31.1
next prev parent reply other threads:[~2021-12-01 6:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-01 6:36 [pull request][net 00/13] mlx5 fixes 2021-11-30 Saeed Mahameed
2021-12-01 6:36 ` [net 01/13] net/mlx5e: IPsec: Fix Software parser inner l3 type setting in case of encapsulation Saeed Mahameed
2021-12-01 15:00 ` patchwork-bot+netdevbpf
2021-12-01 6:36 ` [net 02/13] net/mlx5e: Fix missing IPsec statistics on uplink representor Saeed Mahameed
2021-12-01 6:36 ` [net 03/13] net/mlx5e: Sync TIR params updates against concurrent create/modify Saeed Mahameed
2021-12-01 6:37 ` [net 04/13] net/mlx5: Move MODIFY_RQT command to ignore list in internal error state Saeed Mahameed
2021-12-01 6:37 ` [net 05/13] net/mlx5: Lag, Fix recreation of VF LAG Saeed Mahameed
2021-12-01 6:37 ` [net 06/13] net/mlx5: E-switch, Respect BW share of the new group Saeed Mahameed
2021-12-01 6:37 ` [net 07/13] net/mlx5: E-Switch, fix single FDB creation on BlueField Saeed Mahameed
2021-12-01 6:37 ` [net 08/13] net/mlx5: E-Switch, Check group pointer before reading bw_share value Saeed Mahameed
2021-12-01 6:37 ` [net 09/13] net/mlx5: E-Switch, Use indirect table only if all destinations support it Saeed Mahameed
2021-12-01 6:37 ` [net 10/13] net/mlx5: Fix use after free in mlx5_health_wait_pci_up Saeed Mahameed
2021-12-01 6:37 ` [net 11/13] net/mlx5: Fix too early queueing of log timestamp work Saeed Mahameed
2021-12-01 6:37 ` Saeed Mahameed [this message]
2021-12-01 6:37 ` [net 13/13] net/mlx5e: SHAMPO, Fix constant expression result Saeed Mahameed
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=20211201063709.229103-13-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=ayal@nvidia.com \
--cc=davem@davemloft.net \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@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;
as well as URLs for NNTP newsgroup(s).