netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ganesh Goudar <ganeshgr@linux.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, moshe@nvidia.com, leon@kernel.org,
	mahesh@linux.ibm.com, oohall@gmail.com,
	Ganesh Goudar <ganeshgr@linux.ibm.com>
Subject: [PATCH net] net/mlx5: Avoid MMIO when the error is detected
Date: Mon,  7 Aug 2023 14:02:05 +0530	[thread overview]
Message-ID: <20230807083205.18557-1-ganeshgr@linux.ibm.com> (raw)

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


             reply	other threads:[~2023-08-07  8:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07  8:32 Ganesh Goudar [this message]
2023-08-21 20:51 ` [PATCH net] net/mlx5: Avoid MMIO when the error is detected 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=20230807083205.18557-1-ganeshgr@linux.ibm.com \
    --to=ganeshgr@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=leon@kernel.org \
    --cc=mahesh@linux.ibm.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=oohall@gmail.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).