linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ionic: Prevent driver/fw getting out of sync on devcmd(s)
@ 2025-06-09 21:28 Shannon Nelson
  2025-06-12 13:08 ` Simon Horman
  2025-06-13  1:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Shannon Nelson @ 2025-06-09 21:28 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel
  Cc: brett.creeley, Shannon Nelson

From: Brett Creeley <brett.creeley@amd.com>

Some stress/negative firmware testing around devcmd(s) returning
EAGAIN found that the done bit could get out of sync in the
firmware when it wasn't cleared in a retry case.

While here, change the type of the local done variable to a bool
to match the return type from ionic_dev_cmd_done().

Fixes: ec8ee714736e ("ionic: stretch heartbeat detection")
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 drivers/net/ethernet/pensando/ionic/ionic_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c
index daf1e82cb76b..0e60a6bef99a 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_main.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c
@@ -516,9 +516,9 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds,
 	unsigned long start_time;
 	unsigned long max_wait;
 	unsigned long duration;
-	int done = 0;
 	bool fw_up;
 	int opcode;
+	bool done;
 	int err;
 
 	/* Wait for dev cmd to complete, retrying if we get EAGAIN,
@@ -526,6 +526,7 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds,
 	 */
 	max_wait = jiffies + (max_seconds * HZ);
 try_again:
+	done = false;
 	opcode = idev->opcode;
 	start_time = jiffies;
 	for (fw_up = ionic_is_fw_running(idev);
-- 
2.17.1


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

* Re: [PATCH net] ionic: Prevent driver/fw getting out of sync on devcmd(s)
  2025-06-09 21:28 [PATCH net] ionic: Prevent driver/fw getting out of sync on devcmd(s) Shannon Nelson
@ 2025-06-12 13:08 ` Simon Horman
  2025-06-13  1:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-06-12 13:08 UTC (permalink / raw)
  To: Shannon Nelson
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, brett.creeley

On Mon, Jun 09, 2025 at 02:28:27PM -0700, Shannon Nelson wrote:
> From: Brett Creeley <brett.creeley@amd.com>
> 
> Some stress/negative firmware testing around devcmd(s) returning
> EAGAIN found that the done bit could get out of sync in the
> firmware when it wasn't cleared in a retry case.
> 
> While here, change the type of the local done variable to a bool
> to match the return type from ionic_dev_cmd_done().
> 
> Fixes: ec8ee714736e ("ionic: stretch heartbeat detection")
> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net] ionic: Prevent driver/fw getting out of sync on devcmd(s)
  2025-06-09 21:28 [PATCH net] ionic: Prevent driver/fw getting out of sync on devcmd(s) Shannon Nelson
  2025-06-12 13:08 ` Simon Horman
@ 2025-06-13  1:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-13  1:20 UTC (permalink / raw)
  To: Shannon Nelson
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, brett.creeley

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 9 Jun 2025 14:28:27 -0700 you wrote:
> From: Brett Creeley <brett.creeley@amd.com>
> 
> Some stress/negative firmware testing around devcmd(s) returning
> EAGAIN found that the done bit could get out of sync in the
> firmware when it wasn't cleared in a retry case.
> 
> While here, change the type of the local done variable to a bool
> to match the return type from ionic_dev_cmd_done().
> 
> [...]

Here is the summary with links:
  - [net] ionic: Prevent driver/fw getting out of sync on devcmd(s)
    https://git.kernel.org/netdev/net/c/5466491c9e33

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-06-13  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-09 21:28 [PATCH net] ionic: Prevent driver/fw getting out of sync on devcmd(s) Shannon Nelson
2025-06-12 13:08 ` Simon Horman
2025-06-13  1:20 ` patchwork-bot+netdevbpf

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