diff mbox series

[net] net/mlx5: Avoid MMIO when the error is detected

Message ID 20230807083205.18557-1-ganeshgr@linux.ibm.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net] net/mlx5: Avoid MMIO when the error is detected | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1328 this patch: 1328
netdev/cc_maintainers warning 10 maintainers not CCed: kuba@kernel.org gal@nvidia.com saeedm@nvidia.com tariqt@nvidia.com ayal@nvidia.com pabeni@redhat.com jacob.e.keller@intel.com rrameshbabu@nvidia.com edumazet@google.com linux-rdma@vger.kernel.org
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1351 this patch: 1351
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ganesh Goudar Aug. 7, 2023, 8:32 a.m. UTC
When the drivers are notfied about the pci error, All
the IO to the card must be stopped, Else the recovery would
fail, Avoid memory-mapped IO until the device recovers
from pci error.

Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Saeed Mahameed Aug. 21, 2023, 8:51 p.m. UTC | #1
On 07 Aug 14:02, Ganesh Goudar wrote:
>When the drivers are notfied about the pci error, All
>the IO to the card must be stopped, Else the recovery would
>fail, Avoid memory-mapped IO until the device recovers
>from pci error.
>
>Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
>---
> drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
>index 932fbc843c69..010dee4eec14 100644
>--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
>@@ -221,10 +221,13 @@ static void mlx5_timestamp_overflow(struct work_struct *work)
> 	clock = container_of(timer, struct mlx5_clock, timer);
> 	mdev = container_of(clock, struct mlx5_core_dev, clock);
>
>+	if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
>+		goto out;
> 	write_seqlock_irqsave(&clock->lock, flags);
> 	timecounter_read(&timer->tc);
> 	mlx5_update_clock_info_page(mdev);
> 	write_sequnlock_irqrestore(&clock->lock, flags);
>+out:
> 	schedule_delayed_work(&timer->overflow_work, timer->overflow_period);
> }
>

Another version of this fix was already submitted and accepted:

https://patchwork.kernel.org/project/netdevbpf/patch/20230807212607.50883-10-saeed@kernel.org/

>-- 
>2.40.1
>
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
index 932fbc843c69..010dee4eec14 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
@@ -221,10 +221,13 @@  static void mlx5_timestamp_overflow(struct work_struct *work)
 	clock = container_of(timer, struct mlx5_clock, timer);
 	mdev = container_of(clock, struct mlx5_core_dev, clock);
 
+	if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
+		goto out;
 	write_seqlock_irqsave(&clock->lock, flags);
 	timecounter_read(&timer->tc);
 	mlx5_update_clock_info_page(mdev);
 	write_sequnlock_irqrestore(&clock->lock, flags);
+out:
 	schedule_delayed_work(&timer->overflow_work, timer->overflow_period);
 }