From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B59454C9E for ; Mon, 21 Aug 2023 20:51:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25334C433C7; Mon, 21 Aug 2023 20:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692651118; bh=ecMqphkvm4vlLe7IPHvpzub8d2SqyoBthIxSY81dEe0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PGVspEm+tpcI2Cf6GXSokRReQ9oB8WKZXUDTzxgSI/gCs/PH7EqSh+vxtfx+OcKMH SOlvVjsT5L86sTZg/WGQYc40f9SVc1/BKEjzYrzKwYEGi75NhrvhahY+5dLmviqqHG t0q5c5KxrzY/iZiqnAFitjbnsx7y3pXHGLNgTIEfra9/0oxnKuRR3w2Z/ol5DoThQu CY7aM30LtI8a6klmOdzAKGdR1zir4vqlj4T0h1UqL9kuJNRNrq6eJIu4eKdbeu4KnV kspNooKZf9vnbXY65SErIiMkAT01JAv/ZEbDAA7nDYtUagPjM5NLpgXh0+FupKVwQr YdSGxNBhuBjYg== Date: Mon, 21 Aug 2023 13:51:56 -0700 From: Saeed Mahameed To: Ganesh Goudar Cc: davem@davemloft.net, netdev@vger.kernel.org, moshe@nvidia.com, leon@kernel.org, mahesh@linux.ibm.com, oohall@gmail.com Subject: Re: [PATCH net] net/mlx5: Avoid MMIO when the error is detected Message-ID: References: <20230807083205.18557-1-ganeshgr@linux.ibm.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20230807083205.18557-1-ganeshgr@linux.ibm.com> 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 >--- > 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 > >