astlpc: Clear OBF during binding initialisation
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 <andrew@aj.id.au>
Change-Id: I54266ee4459115e993af2ad6665252887c27ab3e
diff --git a/astlpc.c b/astlpc.c
index 103b48c..87a4cca 100644
--- a/astlpc.c
+++ b/astlpc.c
@@ -214,7 +214,6 @@
* 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) {
@@ -414,8 +413,12 @@
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);
}