From nobody Sat Sep 26 19:12:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790337340420432.62845497064416; Fri, 25 Sep 2026 04:55:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA4WU-00085r-K3; Fri, 25 Sep 2026 07:55:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xA2qB-0006mO-Jh; Fri, 25 Sep 2026 06:07:39 -0400 Received: from pmg-auth-smtp2.teksavvy.com ([76.10.175.140]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xA2qA-0000HH-0h; Fri, 25 Sep 2026 06:07:39 -0400 Received: from pmg-auth-smtp2.teksavvy.com (localhost.localdomain [127.0.0.1]) by pmg-auth-smtp2.teksavvy.com (Proxmox) with ESMTP id C84F6813AA; Fri, 25 Sep 2026 06:07:34 -0400 (EDT) Received: from visor.logiclrd.cx (unknown [104.246.135.111]) by pmg-auth-smtp2.teksavvy.com (Proxmox) with ESMTPSA; Fri, 25 Sep 2026 06:07:33 -0400 (EDT) From: Jonathan Gilbert To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jonathan Gilbert Subject: [PATCH] hw/misc/bcm2835_cprman: correct register index in test for mux update Date: Fri, 25 Sep 2026 05:07:26 -0500 Message-ID: <20260925100726.1546566-1-logic@deltaq.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: softfail client-ip=76.10.175.140; envelope-from=logic@deltaq.org; helo=pmg-auth-smtp2.teksavvy.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 25 Sep 2026 07:55:25 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1790337345148158500 Content-Type: text/plain; charset="utf-8" After each register write handled by cprman_write, function update_mux checks each of the clocks to see whether the supplied register index applies to it, calling clock_mux_update if so. Each clock has two registers, so it needs to check the base cm_offset for CM_CTL and then the next slot for CM_DIV. But, it was checking for cm_offset plus 4, as though it were a byte offset when it's a logical index. Signed-off-by: Jonathan Gilbert Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/bcm2835_cprman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/bcm2835_cprman.c b/hw/misc/bcm2835_cprman.c index 8220f7a6b4..f9a77ff9bb 100644 --- a/hw/misc/bcm2835_cprman.c +++ b/hw/misc/bcm2835_cprman.c @@ -508,7 +508,7 @@ static inline void update_mux_from_cm(BCM2835CprmanStat= e *s, size_t idx) =20 for (i =3D 0; i < CPRMAN_NUM_CLOCK_MUX; i++) { if ((CLOCK_MUX_INIT_INFO[i].cm_offset =3D=3D idx) || - (CLOCK_MUX_INIT_INFO[i].cm_offset + 4 =3D=3D idx)) { + (CLOCK_MUX_INIT_INFO[i].cm_offset + 1 =3D=3D idx)) { /* matches CM_CTL or CM_DIV mux register */ clock_mux_update(&s->clock_muxes[i]); return; --=20 2.53.0