diff options
author | Andrew F. Davis <afd@ti.com> | 2019-01-04 12:49:16 -0600 |
---|---|---|
committer | Andrew F. Davis <afd@ti.com> | 2019-01-21 13:33:36 -0600 |
commit | 73522f0087cee4d3e290356e4ee6f2de5c516be4 (patch) | |
tree | 7029ed3e4fb5ce5af59b7fce02a96226c93748ca /plat/ti | |
parent | 2004552e62cb178a2b633e84371e459955aad150 (diff) |
ti: k3: drivers: ti_sci: Clear receive queue before transmitting
Send and receive currently must be be serialized, any message already in
the receive queue when a new message is to be sent will cause a mismatch
with the expected response from this new message. Clear out all messages
from the response queue before sending a new request.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'plat/ti')
-rw-r--r-- | plat/ti/k3/common/drivers/ti_sci/ti_sci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plat/ti/k3/common/drivers/ti_sci/ti_sci.c b/plat/ti/k3/common/drivers/ti_sci/ti_sci.c index b211bdf6..b4b120e4 100644 --- a/plat/ti/k3/common/drivers/ti_sci/ti_sci.c +++ b/plat/ti/k3/common/drivers/ti_sci/ti_sci.c @@ -158,6 +158,13 @@ static inline int ti_sci_do_xfer(struct ti_sci_xfer *xfer) struct k3_sec_proxy_msg *msg = &xfer->tx_message; int ret; + /* Clear any spurious messages in receive queue */ + ret = k3_sec_proxy_clear_rx_thread(SP_RESPONSE); + if (ret) { + ERROR("Could not clear response queue (%d)\n", ret); + return ret; + } + /* Send the message */ ret = k3_sec_proxy_send(SP_HIGH_PRIORITY, msg); if (ret) { @@ -165,6 +172,7 @@ static inline int ti_sci_do_xfer(struct ti_sci_xfer *xfer) return ret; } + /* Get the response */ ret = ti_sci_get_response(xfer, SP_RESPONSE); if (ret) { ERROR("Failed to get response (%d)\n", ret); |