Skip to content

Commit

Permalink
astlpc: Clear OBF during binding initialisation
Browse files Browse the repository at this point in the history
Whatever the buffer ownership state was previously, it is now irrelevant
as we're initialising the binding. Ensure that we don't accidentally
block initialisation due to the host failing to consume the previous KCS
command (which implies OBF is set and therefore we would block on
sending the dummy command).

The relevant callsites for mctp_astlpc_kcs_set_status() were aleady
setting KCS_STATUS_OBF in the status value passed to the function,
therefore it's not necessary for the function to set it explicitly.
Removing the explicit KCS_STATUS_OBF from mctp_astlpc_kcs_set_status()
to make way for correct use in mctp_astlpc_init_bmc().

Signed-off-by: Andrew Jeffery <[email protected]>
Change-Id: I54266ee4459115e993af2ad6665252887c27ab3e
  • Loading branch information
amboar committed Oct 28, 2020
1 parent 96d5449 commit b3b55a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions astlpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ static int mctp_astlpc_kcs_set_status(struct mctp_binding_astlpc *astlpc,
* interrupt is triggered, and can be ignored by the host.
*/
data = 0xff;
status |= KCS_STATUS_OBF;

rc = mctp_astlpc_kcs_write(astlpc, MCTP_ASTLPC_KCS_REG_STATUS, status);
if (rc) {
Expand Down Expand Up @@ -414,8 +413,12 @@ static int mctp_astlpc_init_bmc(struct mctp_binding_astlpc *astlpc)

mctp_astlpc_lpc_write(astlpc, &hdr, 0, sizeof(hdr));

/* set status indicating that the BMC is now active */
status = KCS_STATUS_BMC_READY | KCS_STATUS_OBF;
/*
* Set status indicating that the BMC is now active. Be explicit about
* clearing OBF; we're reinitialising the binding and so any previous
* buffer state is irrelevant.
*/
status = KCS_STATUS_BMC_READY & ~KCS_STATUS_OBF;
return mctp_astlpc_kcs_set_status(astlpc, status);
}

Expand Down

0 comments on commit b3b55a6

Please sign in to comment.