From patchwork Tue Mar 26 15:44:57 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: 1916245 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=nYUTXbzf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V3vMH3MjXz1yWv for ; Wed, 27 Mar 2024 02:47:39 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rp8zj-0003nO-1V; Tue, 26 Mar 2024 11:45:47 -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 1rp8zi-0003mw-0o for qemu-ppc@nongnu.org; Tue, 26 Mar 2024 11:45:46 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rp8zg-0001CJ-8U for qemu-ppc@nongnu.org; Tue, 26 Mar 2024 11:45:45 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-34005b5927eso3979327f8f.1 for ; Tue, 26 Mar 2024 08:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711467943; x=1712072743; 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=nd+vMuVqiQfFDX5tDq7mwgsep0f8/HZ19ER+KJLjK2g=; b=nYUTXbzftBbnz39vmhFeITOPBmZR3OBT8VW3eTXivuz31s4KXPXsKqf0tGrNzbeE7u xqZSCpoIuml6KAW2Qe9z5jNezhSwzAflLYtqv53IRMb4nyJRjyyrD4IoCnvI6PHe8GFP JSv9u9gefjLYkEeOBkViKGzmdCYxRPBO3SrtyGkaYJuAzs2pM2xps0edXOom9/sZVlmk AyO+boVKBYkcsBixmc9x3UR5BAidimx7AZnRGyG/zDe0yzYWdAqX3ckFnx04bjXEGNEo w819Sy7tnuJHhuoBZAX6WqHzIIi/qTXu2LXz+uoxRa7j0p/11/FPKrQefonOPUSxWq/r ZT/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711467943; x=1712072743; 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=nd+vMuVqiQfFDX5tDq7mwgsep0f8/HZ19ER+KJLjK2g=; b=Ip8c96XAkYJuzmIZqPuTWvkIb/GKApBT8bbcCK/Pyl5Ixx1dFedBO4xfE8I4CRBa+Z SGBrqq9RQ/XpIVrCggIsfauu7G5WUyJIlcJ1Rmy7zH9a8vDtEmPB//lKGDiV/JUAN2q4 SC+PLwNvThUco5sajrYIyiaRC6VwdFwJAvcY5zTEGo0xx/KtqXyMyoRRbtGeffU7d2cY oQdAUvaNcrjL5nvz/VbaHOd9VV99Gtbv1a3q4dg6EJdT4npZFE71q0+rOICT7CXnWRkE jK9k34PZYYYZdDnwkBE1SEIG6vcTICsw/YQkefsnsXjuQ1zKOdUvepBsFUdWYa3ordKc CvVA== X-Forwarded-Encrypted: i=1; AJvYcCXLUxdx7BBnCvkNiDsputtzZeoc5JPMGpt3a7JpEo4EcnTFxtzRuGG2hsM4vCBARha3q8edBtDFPU0WhYG1EO2G0Ja6 X-Gm-Message-State: AOJu0Yx6dXeCAUZnIEL55bxvMraNhxM61iOEwiG+SkYcXfbJD8dd5mam xcprBIL6dRBDnTyLyzbJPHUQzqeWPrkJxdd3axHEro+dUv5d+KahH0JYkWGv6kmgzYz0cQfPwXd x X-Google-Smtp-Source: AGHT+IE2GvDWOFjl+Lb0ZUPMSQOY1ieA1J21BH5JpIoP11zJmq8qAE6vB5grDx2AQ+RuJG2JsaUemA== X-Received: by 2002:a5d:4c4f:0:b0:341:8efd:e206 with SMTP id n15-20020a5d4c4f000000b003418efde206mr1223655wrt.38.1711467942916; Tue, 26 Mar 2024 08:45:42 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.229]) by smtp.gmail.com with ESMTPSA id i5-20020a5d5585000000b0033ed7181fd1sm12471970wrv.62.2024.03.26.08.45.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Mar 2024 08:45:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Alistair Francis , Arnaud Minier , =?utf-8?q?In=C3=A8s_Varhol?= Subject: [PULL 06/13] hw/misc/stm32l4x5_rcc: Inline clock_update() in clock_mux_update() Date: Tue, 26 Mar 2024 16:44:57 +0100 Message-ID: <20240326154505.8300-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240326154505.8300-1-philmd@linaro.org> References: <20240326154505.8300-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Trivial inlining in preliminary patch to make the next one easier to review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20240325152827.73817-3-philmd@linaro.org> --- 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 bc2d63528b..49b90afdf0 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); - clock_update(mux->out, clock_get(current_source)); + clk_changed |= clock_set(mux->out, clock_get(current_source)); + 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 ? */