mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 02/10] firmware: arm_scmi: fix async check
Date: Tue, 30 May 2023 13:18:24 +0200	[thread overview]
Message-ID: <20230530111832.1916542-3-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230530111832.1916542-1-s.hauer@pengutronix.de>

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




  parent reply	other threads:[~2023-05-30 11:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 11:18 [PATCH 00/10] ARM: Rockchip rk3588: eMMC/SD support Sascha Hauer
2023-05-30 11:18 ` [PATCH 01/10] mci: rockchip-dwcmshc-sdhci: Add rk3588 Sascha Hauer
2023-05-30 11:18 ` Sascha Hauer [this message]
2023-05-30 11:18 ` [PATCH 03/10] clk: rockchip: add missing pll_rk3588_core handling Sascha Hauer
2023-05-30 11:18 ` [PATCH 04/10] clk: clk-divider: fix CLK_DIVIDER_HIWORD_MASK flag Sascha Hauer
2023-05-30 11:18 ` [PATCH 05/10] pinctrl: rockchip: fix bias settings Sascha Hauer
2023-05-30 11:18 ` [PATCH 06/10] ARM: dts: rk3588s: Set CPU clock to 816MHz Sascha Hauer
2023-05-30 11:18 ` [PATCH 07/10] mci: rockchip-dwcmshc-sdhci: enable DLL only for clock >= 52MHz Sascha Hauer
2023-05-30 11:18 ` [PATCH 08/10] ARM: rockchip_v8_defconfig: Enable SCMI support Sascha Hauer
2023-05-30 11:18 ` [PATCH 09/10] ARM: multi_v8_defconfig: " Sascha Hauer
2023-05-30 11:18 ` [PATCH 10/10] ARM: rockchip rock 5b: drop no longer valid comments Sascha Hauer
2023-05-30 14:16 ` [PATCH 00/10] ARM: Rockchip rk3588: eMMC/SD support Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230530111832.1916542-3-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox