netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3] octeon_ep: explicitly test for firmware ready value
@ 2023-12-08  5:56 Shinas Rasheed
  2023-12-10 11:18 ` Simon Horman
  2023-12-11 10:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Shinas Rasheed @ 2023-12-08  5:56 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: hgani, vimleshk, egallen, mschmidt, pabeni, horms, kuba, davem,
	wizhao, konguyen, Shinas Rasheed, Veerasenareddy Burru,
	Sathesh Edara, Eric Dumazet, Abhijit Ayarekar, Satananda Burla

The firmware ready value is 1, and get firmware ready status
function should explicitly test for that value. The firmware
ready value read will be 2 after driver load, and on unbind
till firmware rewrites the firmware ready back to 0, the value
seen by driver will be 2, which should be regarded as not ready.

Fixes: 10c073e40469 ("octeon_ep: defer probe if firmware not ready")
Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
---
V3:
  - Removed unnecessary parenthesis around boolean return.

V2: https://lore.kernel.org/all/20231207074936.2597889-1-srasheed@marvell.com/
  - Fixed redundant logic

V1: https://lore.kernel.org/all/20231206063549.2590305-1-srasheed@marvell.com/

 drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index 552970c7dec0..b8ae269f6f97 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -1258,7 +1258,8 @@ static bool get_fw_ready_status(struct pci_dev *pdev)
 
 		pci_read_config_byte(pdev, (pos + 8), &status);
 		dev_info(&pdev->dev, "Firmware ready status = %u\n", status);
-		return status;
+#define FW_STATUS_READY 1ULL
+		return status == FW_STATUS_READY;
 	}
 	return false;
 }
-- 
2.25.1


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

* Re: [PATCH net v3] octeon_ep: explicitly test for firmware ready value
  2023-12-08  5:56 [PATCH net v3] octeon_ep: explicitly test for firmware ready value Shinas Rasheed
@ 2023-12-10 11:18 ` Simon Horman
  2023-12-11 10:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-12-10 11:18 UTC (permalink / raw)
  To: Shinas Rasheed
  Cc: netdev, linux-kernel, hgani, vimleshk, egallen, mschmidt, pabeni,
	kuba, davem, wizhao, konguyen, Veerasenareddy Burru,
	Sathesh Edara, Eric Dumazet, Abhijit Ayarekar, Satananda Burla

On Thu, Dec 07, 2023 at 09:56:46PM -0800, Shinas Rasheed wrote:
> The firmware ready value is 1, and get firmware ready status
> function should explicitly test for that value. The firmware
> ready value read will be 2 after driver load, and on unbind
> till firmware rewrites the firmware ready back to 0, the value
> seen by driver will be 2, which should be regarded as not ready.
> 
> Fixes: 10c073e40469 ("octeon_ep: defer probe if firmware not ready")
> Signed-off-by: Shinas Rasheed <srasheed@marvell.com>

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

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

* Re: [PATCH net v3] octeon_ep: explicitly test for firmware ready value
  2023-12-08  5:56 [PATCH net v3] octeon_ep: explicitly test for firmware ready value Shinas Rasheed
  2023-12-10 11:18 ` Simon Horman
@ 2023-12-11 10:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-11 10:10 UTC (permalink / raw)
  To: Shinas Rasheed
  Cc: netdev, linux-kernel, hgani, vimleshk, egallen, mschmidt, pabeni,
	horms, kuba, davem, wizhao, konguyen, vburru, sedara, edumazet,
	aayarekar, sburla

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 7 Dec 2023 21:56:46 -0800 you wrote:
> The firmware ready value is 1, and get firmware ready status
> function should explicitly test for that value. The firmware
> ready value read will be 2 after driver load, and on unbind
> till firmware rewrites the firmware ready back to 0, the value
> seen by driver will be 2, which should be regarded as not ready.
> 
> Fixes: 10c073e40469 ("octeon_ep: defer probe if firmware not ready")
> Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
> 
> [...]

Here is the summary with links:
  - [net,v3] octeon_ep: explicitly test for firmware ready value
    https://git.kernel.org/netdev/net/c/284f71762241

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:[~2023-12-11 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08  5:56 [PATCH net v3] octeon_ep: explicitly test for firmware ready value Shinas Rasheed
2023-12-10 11:18 ` Simon Horman
2023-12-11 10:10 ` 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).