From patchwork Fri Mar 22 15:58:09 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: 781855 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp1420528wrj; Fri, 22 Mar 2024 08:59:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWEL4Bytko4B1gcP36y5v+m7OJznha1UWrWH3WbDp+RhW+okDhr+vyqEccPVK17dj5gHcIDpSnuysEHwtfnADpM X-Google-Smtp-Source: AGHT+IFY6nERU+dJoXo7z2BU7EBKM9VNvyXUmAmf+Q4ktn987oV4aZ7bXpPaFa/VHkwuiywsxJ9A X-Received: by 2002:a05:620a:5375:b0:788:7a62:83de with SMTP id op53-20020a05620a537500b007887a6283demr2488452qkn.8.1711123145927; Fri, 22 Mar 2024 08:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711123145; cv=none; d=google.com; s=arc-20160816; b=hJjdcgnfAsNiMlMXGurpIv/GwBJaDtD9u+MFSD6QyjdZ1gLf8WmzXVeJEwLKl1GveO L41G/QtawRF1W7XG0XP399VxfxqvRNmcwzMfO0EDuoJ2xB7Mg6qL2HJvP3kGUqUt2K/N +HhnHZT8oXrIUXHtEXNVylXnwVRTG9LNxD+WzmQfHOSq3jJt//AxkTyjEcXGrfL+7vSY mvn3TpOSykrg1P7wlHxhsewg0aTHsM+oPZK0RPhp51k2mWgjmY352r/3laBd9f/hCjoa mGkpkgIthpFOEi+cgHHJEkpsxhuJXHPknEhFL2vlbFZwQ1dzFvt/NfuRi3jkQWIvNpjg 1XKA== 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=2TU+ztvKvf1LMC2G6CQqJztGFsXq/Nhw2cglRUoGn74=; fh=ehv+kQt6ZRcwDkQ1XgUh3GNAfxStVE1Rl0SRcGWy25Y=; b=LOKAqUOMJxKVp1BZ+jgqhjDWTnza9yC6W9YWzEdSKtCpjv9dUPiVqz1KrIfeiyo5cV PcM9SkIaioJSgc7+bNcNe5nm2Qze3sisgfV/9ZKEN5uPSPJObgdb+IIh+sf0XWZ+yprK VkqWWqavHp0chwUbJ/gPBVDiJw4lX8dKzcKPZ1rF+VTB6l3gtC2AXIiA+/f01peTy4xH kVIkCo42W2PMH/AbKCE1UMhBM/sKE07pLJqE0XeXkWl6QiD1/CtNLnDsqDxgnQSeR4+N oZxVaXtBc7pn+Q/nQbknxtey4f5lcAmqTMAQIziZs2ikF62LAPzirouKJHvpfh4qhv8/ d95g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IRj4kd+G; 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 wx26-20020a05620a5a5a00b0078a02492a81si2225022qkn.760.2024.03.22.08.59.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Mar 2024 08:59:05 -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=IRj4kd+G; 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 1rnhHp-0001AJ-8A; Fri, 22 Mar 2024 11:58:29 -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 1rnhHk-00017o-4z for qemu-devel@nongnu.org; Fri, 22 Mar 2024 11:58:24 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnhHi-0005cE-8P for qemu-devel@nongnu.org; Fri, 22 Mar 2024 11:58:23 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41477e77151so10493935e9.2 for ; Fri, 22 Mar 2024 08:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711123100; x=1711727900; 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=2TU+ztvKvf1LMC2G6CQqJztGFsXq/Nhw2cglRUoGn74=; b=IRj4kd+GPrthWtyOnlnyX43CyFb4Te1FWMpz+4OyGJqkZnyFynoLvD/46mcWJ2E25y UXM3+3XM69RmdSLX5FyOJ+xmEFbJrt6bD4iR4KqYYp2UERTwPuwNwZXuQO5i5GULOc4M ocTeNcnLEH45R0NTTTd6CxTQEFlEDsXMEP82u6aK0Yt1MH/GZlcsl5m7YxhatXUf5rJi fU1FpqCeLSfB61gU4vuNqCX6P39HejAxA3KuUCpwhW2ztUw6KX39gIpu1xizd7YKxTlA HdIVUAAKlLdkNqfbCI9MthZ4putL6Ww3FvJiE1E047gfypzs1XiIZe9ZwojBNAhYiYaJ wYYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711123100; x=1711727900; 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=2TU+ztvKvf1LMC2G6CQqJztGFsXq/Nhw2cglRUoGn74=; b=h0YQFs3udpzbDZjpwK3sNQtUHxYV924oxXQUsRBURG0SR3NBhojG5FH2ZfU7ob9w8q Fq4GBZ8YWTxW1Qr/7QBN+OhhFWeAIern6lJCePJ16g2bR3MzfwbUpn05Gfiwsv93w+qv X0X9xPYb9NJ1/vetDifxkQEI9SvaTrq4PYTWqogkVcnOvjlE7918dkHco2UQv9RV8tjs F6ECBmopDRZOXqlVk+Rgw8RHmW2g/tktQlN/l+lwMhnKVUKBWU+T3QqnO2tRUA9Fh2b+ 0jPfvjcSNOaSFdAHyfjn8kU2pQeTpgNGBLvHah+I8wTcwmnmZ5wH2fuMyM/ZhPqdtv+t eLqg== X-Gm-Message-State: AOJu0YySUFCUHTnRt6TibqVuQ8TBd0WoFZXXgthN+5FtKF3PEFabBVIJ qMwz4B/z6OWv9xm6RVDbvxFc8G/hYRBtR2CSKpRPOmDazJ/pcv6FFrfOtZiMRfYd3GiPouhdab/ 5 X-Received: by 2002:a05:6000:884:b0:33d:4966:fa8f with SMTP id cs4-20020a056000088400b0033d4966fa8fmr1957943wrb.46.1711123099991; Fri, 22 Mar 2024 08:58:19 -0700 (PDT) Received: from m1x-phil.lan ([176.176.178.251]) by smtp.gmail.com with ESMTPSA id v9-20020a5d43c9000000b0033ec9007bacsm2331559wrr.20.2024.03.22.08.58.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 22 Mar 2024 08:58:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Luc Michel , Luc Michel , Damien Hedde , =?utf-8?q?In=C3=A8s_Varhol?= , Arnaud Minier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 1/2] hw/clock: Let clock_set_mul_div() return boolean value Date: Fri, 22 Mar 2024 16:58:09 +0100 Message-ID: <20240322155810.5733-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240322155810.5733-1-philmd@linaro.org> References: <20240322155810.5733-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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-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 Let clock_set_mul_div() return a boolean value whether the clock has been updated or not, similarly to clock_set(). Signed-off-by: Philippe Mathieu-Daudé Acked-by: Luc Michel --- include/hw/clock.h | 4 +++- hw/core/clock.c | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/hw/clock.h b/include/hw/clock.h index bb12117f67..eb58599131 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -357,6 +357,8 @@ char *clock_display_freq(Clock *clk); * @multiplier: multiplier value * @divider: divider value * + * @return: true if the clock is changed. + * * By default, a Clock's children will all run with the same period * as their parent. This function allows you to adjust the multiplier * and divider used to derive the child clock frequency. @@ -374,6 +376,6 @@ char *clock_display_freq(Clock *clk); * Note that this function does not call clock_propagate(); the * caller should do that if necessary. */ -void clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider); +bool clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider); #endif /* QEMU_HW_CLOCK_H */ diff --git a/hw/core/clock.c b/hw/core/clock.c index d82e44cd1a..a19c7db7df 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -143,14 +143,20 @@ char *clock_display_freq(Clock *clk) return freq_to_str(clock_get_hz(clk)); } -void clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider) +bool clock_set_mul_div(Clock *clk, uint32_t multiplier, uint32_t divider) { assert(divider != 0); + if (clk->multiplier == multiplier && clk->divider == divider) { + return false; + } + trace_clock_set_mul_div(CLOCK_PATH(clk), clk->multiplier, multiplier, clk->divider, divider); clk->multiplier = multiplier; clk->divider = divider; + + return true; } static void clock_initfn(Object *obj) From patchwork Fri Mar 22 15:58:10 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: 781856 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp1420668wrj; Fri, 22 Mar 2024 08:59:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV8zKsTD7jBdhMv+Sha3epveBFAAztj5K4hpNPuwmM7zDjvq8kv2/1SGdIvUXR654fU/Z3BH4GAQLwfcyNeJU7p X-Google-Smtp-Source: AGHT+IHae5nDNesq+onE5YWJZhSaYw6DB/jAUizlTriaFKUPZW697ziGsBxEwxZ8+9tGRx69rPCH X-Received: by 2002:a05:620a:f14:b0:78a:205e:f72b with SMTP id v20-20020a05620a0f1400b0078a205ef72bmr3291219qkl.28.1711123170303; Fri, 22 Mar 2024 08:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711123170; cv=none; d=google.com; s=arc-20160816; b=zUAbYzNdyKL6zVRVNWx2Y1S3guZm4c1Mm+U6Oy2OUXBWD7GEnhwSmzKAjTBUyAt/el BtwNUhvIkh/h9cz4B2mgGvIkbiLQjxmcLOydo/NN1Orvm+kk0KEidGTEdVsLQOYs5WhD wc98t2EGtH7KihXy11y+i1xVy4OC4cKhQwTKr9ZpJUy/mHK5g6+t33uUtdnclBtLMZ5n yD2k/lE9LH+/8CpsDGacuD7f0Xep/K35EQD5wAuTnT/Liy/g0o28nwW/sI8vziOkiNFA mKP8ZDokctzZpuUZxsIWX2yiDR7BoLimr4zDxPX4nKMZjVdpgsH36yCFKaqFlb/oHcuT 9R1w== 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=UxjY8qQEnjtbAhkgYiOeCHJsc+3HFQ5wgndLMK/z5QQ=; fh=ehv+kQt6ZRcwDkQ1XgUh3GNAfxStVE1Rl0SRcGWy25Y=; b=QnT3i1m4QJdPDdnwNjJFqI7dqx/7Mb7koMlYfd+aQ57tGxEoMIMdGB/rhidERXWZ/8 ATyqeKzWyYC539/C64hecr4QzQdp/jniDX9hsDTrmzAjVX4jzd+kROqZulM86pFUbFlL sOR5CBJPiPY1jvc5j8qzFosiPW6JzfqT/YFZshN2Oc2Wf4M9iWcmSt9Y9SntQ3czwOY4 Ay/PE0pFCWaQGheqQT7e+tgFA61e9wq6+TUw2HBWvL07XS5VoR6P1cCzUBQKiGcpT9Yv xohxVimjBIgZEgvQXq7acdT/DhrzAjinethXPQ8zOU7rrsmakg8on4lZuXEibaTe6rmz 2ufw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R8r5hRY6; 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 l11-20020ae9f00b000000b00787ec0dffa0si2214954qkg.447.2024.03.22.08.59.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Mar 2024 08:59:30 -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=R8r5hRY6; 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 1rnhHt-0001Cj-GC; Fri, 22 Mar 2024 11:58:33 -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 1rnhHq-0001Av-TH for qemu-devel@nongnu.org; Fri, 22 Mar 2024 11:58:31 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnhHo-0005eQ-E4 for qemu-devel@nongnu.org; Fri, 22 Mar 2024 11:58:30 -0400 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2d228a132acso31043861fa.0 for ; Fri, 22 Mar 2024 08:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711123106; x=1711727906; 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=UxjY8qQEnjtbAhkgYiOeCHJsc+3HFQ5wgndLMK/z5QQ=; b=R8r5hRY6gwbZVFB1TBsELt667RJ6iOqB98kN5CMLlnMD5ufnNEOZArHovNoWw7R63I wO9L/NLD0TNQSiE/lGgYYwH8D5IXPMyu3wT8yhPj0Qffl96HmY5E3rMo97+wmY+8oyqS RCInRUQNNJoUuBxyfmkRL503TD1fcSoTVmjwRrZmheak9oq84i2nJzGFbjPtOSeCdgIi +VeThnHK/yL8Mui08oaJui16LH1ROUnxT8NRnXEsaaC3pQJ9ftZUKbv33wHQnYJTaS0U wSkjynO3Vk2z2MujaDaaWP3M8NeAtNCEAtlyk6/I4itHa4fuSv4R5Rb+5TecmGKoU1Xm aIHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711123106; x=1711727906; 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=UxjY8qQEnjtbAhkgYiOeCHJsc+3HFQ5wgndLMK/z5QQ=; b=Vp2BoLZM6gzbFXRJKd1piwyh2NkSsRECoEqN7IyZWzeUeXG4PnDHRNlsWIUMT4kE/v q4en2dvuCmgarkcBPEbP1k+NEZpI3lQMTgJXbIfbzED6fZyJr354gNo+OK1iGp8E3bSe 0W9sc7I6BWDHpzE/D1+HPet2rbWdvjDxJTi9DqKaz9a5Axmv7VpW9vyjaLX1YmQLHUxN KSklVWTimC+M/66JY+6aJxzVDvmaagwWC0wA7jWQUpHlnZFQqr963nGs14XXGHJvukEO X6LFpjT38XuG297VTJgWQK/mw5kFeSw79KyxG5GIuRy7XTdjXOCR4cpd+1YmxdNhEfQR OH2Q== X-Gm-Message-State: AOJu0YyrIU/RGfaVLzvNwUA7NnI9BfarlEjoQeGAeBZLY7UfdiWml0ny CHbkXOkSIhdaiX8wHmKAHZ+EYMUn0jMKd+0TGFcDNp0omjf2fLlB7NpYilp9iXmAITmml+kPDFu G X-Received: by 2002:a2e:8ed1:0:b0:2d4:74c5:2cd3 with SMTP id e17-20020a2e8ed1000000b002d474c52cd3mr2166352ljl.41.1711123106159; Fri, 22 Mar 2024 08:58:26 -0700 (PDT) Received: from m1x-phil.lan ([176.176.178.251]) by smtp.gmail.com with ESMTPSA id h11-20020a05600c350b00b0041477e76ec6sm3486777wmq.2.2024.03.22.08.58.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 22 Mar 2024 08:58:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Luc Michel , Luc Michel , Damien Hedde , =?utf-8?q?In=C3=A8s_Varhol?= , Arnaud Minier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 2/2] hw/misc/stm32l4x5_rcc: Propagate period when enabling a clock Date: Fri, 22 Mar 2024 16:58:10 +0100 Message-ID: <20240322155810.5733-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240322155810.5733-1-philmd@linaro.org> References: <20240322155810.5733-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=philmd@linaro.org; helo=mail-lj1-x22a.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 From: Arnaud Minier The "clock_set_mul_div" function doesn't propagate the clock period to the children if it is changed (e.g. by enabling/disabling a clock multiplexer). This was overlooked during the implementation due to late changes. This commit propagates the change if the multiplier or divider changes. Fixes: ec7d83acbd ("hw/misc/stm32l4x5_rcc: Add an internal clock multiplexer object") Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol Message-ID: <20240317103918.44375-2-arnaud.minier@telecom-paris.fr> [PMD: Check clock_set_mul_div() return value] Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/stm32l4x5_rcc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/misc/stm32l4x5_rcc.c b/hw/misc/stm32l4x5_rcc.c index bc2d63528b..7ad628b296 100644 --- a/hw/misc/stm32l4x5_rcc.c +++ b/hw/misc/stm32l4x5_rcc.c @@ -59,7 +59,10 @@ static void clock_mux_update(RccClockMuxState *mux, bool bypass_source) freq_multiplier = mux->divider; } - clock_set_mul_div(mux->out, freq_multiplier, mux->multiplier); + if (clock_set_mul_div(mux->out, freq_multiplier, mux->multiplier)) { + clock_propagate(mux->out); + } + clock_update(mux->out, clock_get(current_source)); src_freq = clock_get_hz(current_source);