[PATCH 02/10] firmware: arm_scmi: fix async check
Sascha Hauer
s.hauer at pengutronix.de
Tue May 30 04:18:24 PDT 2023
Originally the Linux code had atomic_inc_return(&ci->cur_async_req).
atomic_inc_return() returns the new variable value after increasing it,
so the equivalent is ++ci->cur_async_req, not ci->cur_async_req++.
This fixes a case where the code erroneously chose to do an asynchronous
clock rate change on RK3588.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/firmware/arm_scmi/clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index 8f9017206c..4fd642dad3 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -250,7 +250,7 @@ static int scmi_clock_rate_set(const struct scmi_protocol_handle *ph,
return ret;
if (ci->max_async_req &&
- ci->cur_async_req++ < ci->max_async_req)
+ ++ci->cur_async_req < ci->max_async_req)
flags |= CLOCK_SET_ASYNC;
cfg = t->tx.buf;
--
2.39.2
More information about the barebox
mailing list