* [PATCH net v2] net/qed: allow old cards not supporting "num_images" to work
@ 2024-11-28 8:33 Louis Leseur
2024-12-03 9:59 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Louis Leseur @ 2024-11-28 8:33 UTC (permalink / raw)
To: Manish Chopra, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Louis Leseur, Florian Forestier
Commit 43645ce03e00 ("qed: Populate nvm image attribute shadow.")
added support for populating flash image attributes, notably
"num_images". However, some cards were not able to return this
information. In such cases, the driver would return EINVAL, causing the
driver to exit.
Add check to return EOPNOTSUPP instead of EINVAL when the card is not
able to return these information. The caller function already handles
EOPNOTSUPP without error.
Fixes: 43645ce03e00 ("qed: Populate nvm image attribute shadow.")
Co-developed-by: Florian Forestier <florian@forestier.re>
Signed-off-by: Florian Forestier <florian@forestier.re>
Signed-off-by: Louis Leseur <louis.leseur@gmail.com>
---
Changes in v2:
- Fix commit message (reference to 43645ce03e00, add Fixes tag, change
phrasing)
- Link to v1: https://lore.kernel.org/r/20241121172821.24003-1-louis.leseur@gmail.com
---
drivers/net/ethernet/qlogic/qed/qed_mcp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
index 16e6bd466143..6218d9c26855 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
@@ -3314,7 +3314,9 @@ int qed_mcp_bist_nvm_get_num_images(struct qed_hwfn *p_hwfn,
if (rc)
return rc;
- if (((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK))
+ if (((rsp & FW_MSG_CODE_MASK) == FW_MSG_CODE_UNSUPPORTED))
+ rc = -EOPNOTSUPP;
+ else if (((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK))
rc = -EINVAL;
return rc;
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net v2] net/qed: allow old cards not supporting "num_images" to work
2024-11-28 8:33 [PATCH net v2] net/qed: allow old cards not supporting "num_images" to work Louis Leseur
@ 2024-12-03 9:59 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-03 9:59 UTC (permalink / raw)
To: Louis Leseur
Cc: manishc, andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, florian
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 28 Nov 2024 09:33:58 +0100 you wrote:
> Commit 43645ce03e00 ("qed: Populate nvm image attribute shadow.")
> added support for populating flash image attributes, notably
> "num_images". However, some cards were not able to return this
> information. In such cases, the driver would return EINVAL, causing the
> driver to exit.
>
> Add check to return EOPNOTSUPP instead of EINVAL when the card is not
> able to return these information. The caller function already handles
> EOPNOTSUPP without error.
>
> [...]
Here is the summary with links:
- [net,v2] net/qed: allow old cards not supporting "num_images" to work
https://git.kernel.org/netdev/net/c/7a0ea70da56e
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] 2+ messages in thread
end of thread, other threads:[~2024-12-03 9:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-28 8:33 [PATCH net v2] net/qed: allow old cards not supporting "num_images" to work Louis Leseur
2024-12-03 9:59 ` 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