From patchwork Mon Mar 25 13:32:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 782336 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1176456wrt; Mon, 25 Mar 2024 06:34:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXfofBBPuT/Ym430swW7hg9XjxeAAS2rszvsVhE6HLP7aJunXKkGnimXKO6XMHlbCYnSi1kqvc3VjC/MpLGf2n+ X-Google-Smtp-Source: AGHT+IHo4WARRxh2ZZ9ttT4HayCLljbXLBeHFYz8YfUa6AzRdPnhEqRl/tkdnwhu9e9fSCVGHUKa X-Received: by 2002:a05:620a:1a:b0:788:2ada:3a3d with SMTP id j26-20020a05620a001a00b007882ada3a3dmr7154384qki.24.1711373690366; Mon, 25 Mar 2024 06:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711373690; cv=none; d=google.com; s=arc-20160816; b=B1V+PeJcH7AANsCUBCQKbMqLqGpP5f7sMLeFcx6cMXJUyoC3i3CHoao1OIDyklyq4x ctIgocrWUKDAfudPEaiRDRb6tnCgp6eR54aoUVEbBdap45YVL7JEZ+obfDZicGbWHe16 hxScZTqarmSoUgcZE3OPMF8V4Tb35LCcY3PWZSAZzegbB/FpISh4OW/HTnOVa+bY7Yac MRJkpHydMAIyB2p65qn4Dlqfm67zbD0H5JpfR5vJ1chxxyZc7PpRiio1cbFYTfK/k2f8 K0dnQosBpF2E3VKumckpjhJkbIoln8vSCzsLT3dFv7duZvd1NI5vwBYyieKvasxX16IN vRbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ECmMULAo7ez5jaBxa5Wjvt8SfPbxgHkevNpFi8ZZgIM=; fh=Z6ebApcLFJbaZHsWuXWH2AHWI2xWYXqDDJv2NwjBOYY=; b=1HtR/r8PeGWbSMN02icRLCodx9M6CGOEBHUK7GjvGFdJXDwOKaLuxfHfDtotMU8zoU mkf75NkLDpc/5gNpe2Q3XDBLDPx5D8FvKNKHeUW0drbdd8q6VXHinMo0m4d+r5Fm38fG YPY22KoE2ICyttvYql+WnFVEP3L4isLBdPOWK+3JVzwYezkmnvK4e+GrEZtyH7MaCAq7 kGHDX0Nii7YnPwNarZhoBfBe1LfP70SbUwLGGjTFry6gPpE5wTCiSDyqUlJvw6JjMufu //Rf4rv5ZT5pSEX4smQoglqZYWEZtxTJNuCQ3u9EI4FuUob1VzpqoezURHnc/pgatw7O nVXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LWZt6tpq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id vu22-20020a05620a561600b007883eac4395si5390142qkn.490.2024.03.25.06.34.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2024 06:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LWZt6tpq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rokSP-0003EG-FE; Mon, 25 Mar 2024 09:33:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rokSN-00037Y-J5 for qemu-devel@nongnu.org; Mon, 25 Mar 2024 09:33:43 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rokSL-0007QQ-QT for qemu-devel@nongnu.org; Mon, 25 Mar 2024 09:33:43 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-513da1c1f26so5469475e87.3 for ; Mon, 25 Mar 2024 06:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711373619; x=1711978419; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ECmMULAo7ez5jaBxa5Wjvt8SfPbxgHkevNpFi8ZZgIM=; b=LWZt6tpq8WlS3qrd9yC0vjOon2RtjlV/kpiGcYDPto/i2m2brHGJYw4bnoswlYEVTh i+nPU8Arb5RumI6cvT9qkkZSnjfgLPALq+b6mWQmC7LSTSkn95EkhBRNngOLNeG+xSBh VmGi1o7tj9Ncx1rfac3AdHc7yaNSjTD+mGPTk4eC2telqYrf/XITDa44N/5ksWn6/1g4 tpQ1kUTGaunJyxoc5l+oBTXORBr27DqD/DFWIwTFZ76WLBhO1X6hGXG1H7qamxmJRo6x Uh4vhysIPFnv+UBsuJcZJp55Aioas82JoP1Def3hnMlnNjmB1vBlmYxAGwG//6HL/LLw v7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711373619; x=1711978419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ECmMULAo7ez5jaBxa5Wjvt8SfPbxgHkevNpFi8ZZgIM=; b=vif7BbbHss7hu6uCPp2ZMK7mseSWCul8xs9oWaNMlJP2xF6aME8hm8K3yoE7bAYTh1 54sgtavMvfP26dnjpEfCFaoZKc6gV9CqEjcwV5ku4iAtFWcY9fDeQVGbYAmeSLaWBaos P1V3he4+SYUYZj05Op9IvFgVfkFdbPD1n+77+anbswywXkiWg98p6pEs0+P8yPf/eQxi g3q47UxRfPOujug1CIRfx/efgvsqx7xzuueD8yS5y4B0AeMOAl//rBNMj0opLaTKj6yY N/VdDeYLgJtDQPzGQerM3SdRM1alTwG3nitdv7F1OcGrgQ451DBBBvysnEi6laslh90+ d+NQ== X-Gm-Message-State: AOJu0YxzN6U/qqGkH1/3TzZgdtYpIpeLjcVHkUVP4My6ugSN6fVneAsz FxoyhEHcMBjID1W6B4gKWuxEfjyo5yu9f21nCakWSS4RPjefgNfR4A+uH0BKeTKfDGR9i4w2LIE UeIE= X-Received: by 2002:a05:6512:55c:b0:513:184a:ff5f with SMTP id h28-20020a056512055c00b00513184aff5fmr5010410lfl.50.1711373619372; Mon, 25 Mar 2024 06:33:39 -0700 (PDT) Received: from m1x-phil.lan ([176.187.208.214]) by smtp.gmail.com with ESMTPSA id en7-20020a056000420700b0034174875850sm8133536wrb.70.2024.03.25.06.33.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 25 Mar 2024 06:33:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?In=C3=A8s_Varhol?= , Arnaud Minier , Damien Hedde , qemu-arm@nongnu.org, Peter Maydell , Alistair Francis , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 v2 6/8] hw/misc/stm32l4x5_rcc: Inline clock_update() in clock_mux_update() Date: Mon, 25 Mar 2024 14:32:56 +0100 Message-ID: <20240325133259.57235-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240325133259.57235-1-philmd@linaro.org> References: <20240325133259.57235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=philmd@linaro.org; helo=mail-lf1-x12d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Trivial inlining in preliminary patch to make the next one easier to review. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/stm32l4x5_rcc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/misc/stm32l4x5_rcc.c b/hw/misc/stm32l4x5_rcc.c index f01113308a..8852b434db 100644 --- a/hw/misc/stm32l4x5_rcc.c +++ b/hw/misc/stm32l4x5_rcc.c @@ -48,6 +48,8 @@ static void clock_mux_update(RccClockMuxState *mux, bool bypass_source) uint64_t src_freq; Clock *current_source = mux->srcs[mux->src]; uint32_t freq_multiplier = 0; + bool clk_changed = false; + /* * To avoid rounding errors, we use the clock period instead of the * frequency. @@ -60,7 +62,10 @@ static void clock_mux_update(RccClockMuxState *mux, bool bypass_source) } clock_set_mul_div(mux->out, freq_multiplier, mux->multiplier, NULL); - clock_update(mux->out, clock_get(current_source)); + clock_set(mux->out, clock_get(current_source), &clk_changed); + if (clk_changed) { + clock_propagate(mux->out); + } src_freq = clock_get_hz(current_source); /* TODO: can we simply detect if the config changed so that we reduce log spam ? */