Skip to content

Commit 7a0ea70

Browse files
teapot9Paolo Abeni
authored andcommitted
net/qed: allow old cards not supporting "num_images" to work
Commit 43645ce ("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: 43645ce ("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> Link: https://patch.msgid.link/20241128083633.26431-1-louis.leseur@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 77e6077 commit 7a0ea70

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/net/ethernet/qlogic/qed/qed_mcp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3301,7 +3301,9 @@ int qed_mcp_bist_nvm_get_num_images(struct qed_hwfn *p_hwfn,
33013301
if (rc)
33023302
return rc;
33033303

3304-
if (((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK))
3304+
if (((rsp & FW_MSG_CODE_MASK) == FW_MSG_CODE_UNSUPPORTED))
3305+
rc = -EOPNOTSUPP;
3306+
else if (((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK))
33053307
rc = -EINVAL;
33063308

33073309
return rc;

0 commit comments

Comments
 (0)