netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/mlx5: Avoid MMIO when the error is detected
@ 2023-08-07  8:32 Ganesh Goudar
  2023-08-21 20:51 ` Saeed Mahameed
  0 siblings, 1 reply; 2+ messages in thread
From: Ganesh Goudar @ 2023-08-07  8:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, moshe, leon, mahesh, oohall, Ganesh Goudar

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);
 }
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net/mlx5: Avoid MMIO when the error is detected
  2023-08-07  8:32 [PATCH net] net/mlx5: Avoid MMIO when the error is detected Ganesh Goudar
@ 2023-08-21 20:51 ` Saeed Mahameed
  0 siblings, 0 replies; 2+ messages in thread
From: Saeed Mahameed @ 2023-08-21 20:51 UTC (permalink / raw)
  To: Ganesh Goudar; +Cc: davem, netdev, moshe, leon, mahesh, oohall

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
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-21 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07  8:32 [PATCH net] net/mlx5: Avoid MMIO when the error is detected Ganesh Goudar
2023-08-21 20:51 ` Saeed Mahameed

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).