Skip to content

Commit f9559d8

Browse files
brettcreeleykuba-moo
authored andcommitted
pds_core: Remove unnecessary check in pds_client_adminq_cmd()
When the pds_core driver was first created there were some race conditions around using the adminq, especially for client drivers. To reduce the possibility of a race condition there's a check against pf->state in pds_client_adminq_cmd(). This is problematic for a couple of reasons: 1. The PDSC_S_INITING_DRIVER bit is set during probe, but not cleared until after everything in probe is complete, which includes creating the auxiliary devices. For pds_fwctl this means it can't make any adminq commands until after pds_core's probe is complete even though the adminq is fully up by the time pds_fwctl's auxiliary device is created. 2. The race conditions around using the adminq have been fixed and this path is already protected against client drivers calling pds_client_adminq_cmd() if the adminq isn't ready, i.e. see pdsc_adminq_post() -> pdsc_adminq_inc_if_up(). Fix this by removing the pf->state check in pds_client_adminq_cmd() because invalid accesses to pds_core's adminq is already handled by pdsc_adminq_post()->pdsc_adminq_inc_if_up(). Fixes: 1065903 ("pds_core: add the aux client API") Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Brett Creeley <brett.creeley@amd.com> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20250421174606.3892-4-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 2567daa commit f9559d8

File tree

1 file changed

+0
-3
lines changed
  • drivers/net/ethernet/amd/pds_core

1 file changed

+0
-3
lines changed

drivers/net/ethernet/amd/pds_core/auxbus.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ int pds_client_adminq_cmd(struct pds_auxiliary_dev *padev,
107107
dev_dbg(pf->dev, "%s: %s opcode %d\n",
108108
__func__, dev_name(&padev->aux_dev.dev), req->opcode);
109109

110-
if (pf->state)
111-
return -ENXIO;
112-
113110
/* Wrap the client's request */
114111
cmd.client_request.opcode = PDS_AQ_CMD_CLIENT_CMD;
115112
cmd.client_request.client_id = cpu_to_le16(padev->client_id);

0 commit comments

Comments
 (0)