netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>
Subject: [net-next 01/15] net/mlx5: remove redundant clear_bit
Date: Mon, 13 Mar 2023 22:42:20 -0700	[thread overview]
Message-ID: <20230314054234.267365-2-saeed@kernel.org> (raw)
In-Reply-To: <20230314054234.267365-1-saeed@kernel.org>

From: Moshe Shemesh <moshe@nvidia.com>

When shutdown or remove callbacks are called the driver sets the flag
MLX5_BREAK_FW_WAIT, to stop waiting for FW as teardown was called. There
is no need to clear the bit as once shutdown or remove were called as
there is no way back, the driver is going down. Furthermore, if not
cleared the flag can be used also in other loops where we may wait while
teardown was already called.

Use test_bit() instead of test_and_clear_bit() as there is no need to
clear the flag.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 540840e80493..0ff0eb660495 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -191,7 +191,7 @@ static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili,
 		if (!(fw_initializing >> 31))
 			break;
 		if (time_after(jiffies, end) ||
-		    test_and_clear_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state)) {
+		    test_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state)) {
 			err = -EBUSY;
 			break;
 		}
-- 
2.39.2


  reply	other threads:[~2023-03-14  5:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14  5:42 [pull request][net-next 00/15] mlx5 updates 2023-03-13 Saeed Mahameed
2023-03-14  5:42 ` Saeed Mahameed [this message]
2023-03-16  5:20   ` [net-next 01/15] net/mlx5: remove redundant clear_bit patchwork-bot+netdevbpf
2023-03-14  5:42 ` [net-next 02/15] net/mlx5: Stop waiting for PCI up if teardown was triggered Saeed Mahameed
2023-03-14  5:42 ` [net-next 03/15] net/mlx5: Add comment to mlx5_devlink_params_register() Saeed Mahameed
2023-03-14  5:42 ` [net-next 04/15] net/mlx5: Implement thermal zone Saeed Mahameed
2023-03-14  5:42 ` [net-next 05/15] net/mlx5e: Correct SKB room check to use all room in the fifo Saeed Mahameed
2023-03-16  4:56   ` Jakub Kicinski
2023-03-16  4:59     ` Jakub Kicinski
2023-03-16  5:05       ` Saeed Mahameed
2023-03-16  5:13         ` Jakub Kicinski
2023-03-14  5:42 ` [net-next 06/15] net/mlx5e: Rename RQ/SQ adaptive moderation state flag Saeed Mahameed
2023-03-14  5:42 ` [net-next 07/15] net/mlx5e: Stringify RQ SW state in RQ devlink health diagnostics Saeed Mahameed
2023-03-14  5:42 ` [net-next 08/15] net/mlx5e: Expose SQ SW state as part of SQ " Saeed Mahameed
2023-03-14  5:42 ` [net-next 09/15] net/mlx5e: Add XSK RQ state flag for RQ devlink " Saeed Mahameed
2023-03-14  5:42 ` [net-next 10/15] net/mlx5: Move needed PTYS functions to core layer Saeed Mahameed
2023-03-14  5:42 ` [net-next 11/15] net/mlx5e: Add devlink hairpin queues parameters Saeed Mahameed
2023-03-14  5:42 ` [net-next 12/15] net/mlx5e: Add more information to hairpin table dump Saeed Mahameed
2023-03-14  5:42 ` [net-next 13/15] net/mlx5e: TC, Extract indr setup block checks to function Saeed Mahameed
2023-03-14  5:42 ` [net-next 14/15] net/mlx5e: Enable TC offload for ingress MACVLAN over bond Saeed Mahameed
2023-03-14  5:42 ` [net-next 15/15] net/mlx5e: Enable TC offload for egress " 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=20230314054234.267365-2-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@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).