ipmi: kcs: Poll OBF briefly to reduce OBE latency
authorAndrew Jeffery <andrew@aj.id.au>
Fri, 12 Aug 2022 14:47:41 +0000 (00:17 +0930)
committerCorey Minyard <cminyard@mvista.com>
Mon, 17 Oct 2022 14:51:26 +0000 (09:51 -0500)
commitf90bc0f97f2b65af233a37b2e32fc81871a1e3cf
tree155e10f90a880d36b5cf7ea8f7f2ec7ce74becc2
parentc25c782d349e10b1d6bcabf2e949111e0a8376cc
ipmi: kcs: Poll OBF briefly to reduce OBE latency

The ASPEED KCS devices don't provide a BMC-side interrupt for the host
reading the output data register (ODR). The act of the host reading ODR
clears the output buffer full (OBF) flag in the status register (STR),
informing the BMC it can transmit a subsequent byte.

On the BMC side the KCS client must enable the OBE event *and* perform a
subsequent read of STR anyway to avoid races - the polling provides a
window for the host to read ODR if data was freshly written while
minimising BMC-side latency.

Fixes: 28651e6c4237 ("ipmi: kcs_bmc: Allow clients to control KCS IRQ state")
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Message-Id: <20220812144741.240315-1-andrew@aj.id.au>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/kcs_bmc_aspeed.c