[PATCH 02/10] firmware: arm_scmi: fix async check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux