From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C3FB606A31A for ; Tue, 1 Dec 2026 20:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=y3wc8Id1; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YXSdvuYU DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=0ql7yTSXHTRdaO1xytSyZqqppvV7dYZUBrOm5HuQYKk=; b=y3wc8Id1Wja6FvAx71011Kq4Tw cBvB/ykb+97mE20mjvv3FAUOeJTrf6EfKt75ys/SQURY9BaLq+otEbaUFG17WZbPOSYYybhMAEiIL JVRu22VOQYmjOsLQji2LVzJpcpbv7AQqLjaQgOoVMkrRszNTI4Rrh4niGSwwMW3mWSHnbS48YozPz yrGAfbbTtwEjWOsk/gm2FyK/tpOQgHKewubZySu//TGO41Q+3Gj9dMwEoF6u6UVy8zAVMor+w1CCm DWIFtOFgbUHAtYTE58rkhExl9VoUIkcSYwyfvFfzuTw3M/AfF99B6v7GCjlvh6aT5+Uv+xYvHdfuu 0bGn1tng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYUve-00000009Rf5-1ZSx; Tue, 01 Dec 2026 20:58:22 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYUvY-00000009Rea-0l2I for linux-riscv@lists.infradead.org; Tue, 01 Dec 2026 20:58:18 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 649F542A5B; Tue, 1 Dec 2026 20:58:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 334D91F000C1; Tue, 1 Dec 2026 20:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796158695; bh=qqw2Zlrw4WmqXI5u+J33hDSqXTLSHr6KAGYMSo2Qnvk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=YXSdvuYUC3/Jv69C92BvrT4kLOyGGYjofe8lhZsPpgJwL1NXvdLviXUVBmPdm95ja cmHwtZFSCk4M6tFlc/J9SsSfuEhExJxjj525Rg95ye4XWRIo4evdw+IO+a2kKh3M2y PtCzLXQj25jH9P02ocCzXlJDKi9+SvvXiRa6FfVgcj7osQdQBrKIko6UH7gUykrzR3 wbV2jU08ZiBPQPBICGTxs7sS/lhOdRXzQcvVamFtBa3KCSx9Y6Wk2QT4UjkAlN6k3+ bXAlpA4REeXuJk1Apfz3Ig95Lb9yvHoIRDr+Yl7REpK576Oh1oz1LO9EU79OpNjD/w XVFxKaXf+FZGA== Date: Tue, 1 Dec 2026 13:58:09 -0700 From: Nathan Chancellor To: Paul Walmsley Cc: wang.yechao255@zte.com.cn, linux-acpi@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, zhanjie9@hisilicon.com, aou@eecs.berkeley.edu, alex@ghiti.fr, rafael@kernel.org, viresh.kumar@linaro.org, zhenglifeng1@huawei.com, pierre.gondois@arm.com, palmer@dabbelt.com, lenb@kernel.org Subject: Re: [PATCH] ACPI: RISC-V: Fix false warning in cppc_read_ffh() for same-CPU reads Message-ID: <20261201205809.GA1860806@ax162> References: <20260609192856874Y8AaPpKL5TnmbgiWI8DI3@zte.com.cn> X-Archived-By: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, Nov 30, 2026 at 06:18:16PM -0700, Paul Walmsley wrote: > On Tue, 9 Jun 2026, wang.yechao255@zte.com.cn wrote: > > > Commit 997c021abc6e ("cpufreq: CPPC: Update FIE arch_freq_scale in > > ticks for non-PCC regs") changed the CPPC Frequency Invariance Engine > > to read AMU counters directly from the scheduler tick for non-PCC > > register spaces (like FFH), instead of deferring to a kthread. This > > means cppc_read_ffh() is now called with IRQs disabled from the tick > > handler, triggering the warning. > > > > This is the same fix as commit df6e4ab654dc ("arm64: topology: Fix > > false warning in counters_read_on_cpu() for same-CPU reads"). > > > > Fixes: 997c021abc6e ("cpufreq: CPPC: Update FIE arch_freq_scale in ticks for non-PCC regs") > > Signed-off-by: Wang Yechao > > Thanks, queued for v7.4-rc. This patch breaks the -Werror clang build in -next with: drivers/acpi/riscv/cppc.c:112:8: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 112 | if (WARN_ON_ONCE(cpu != smp_processor_id())) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/bug.h:119:33: note: expanded from macro 'WARN_ON_ONCE' 119 | #define WARN_ON_ONCE(condition) ({ \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 120 | int __ret_warn_on = !!(condition); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | if (unlikely(__ret_warn_on)) \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | __WARN_FLAGS(#condition, \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | BUGFLAG_ONCE | \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 124 | BUGFLAG_TAINT(TAINT_WARN)); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 125 | unlikely(__ret_warn_on); \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 126 | }) | ~~ drivers/acpi/riscv/cppc.c:120:7: note: uninitialized use occurs here 120 | if (ret) | ^~~ drivers/acpi/riscv/cppc.c:112:4: note: remove the 'if' if its condition is always true 112 | if (WARN_ON_ONCE(cpu != smp_processor_id())) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 | return -EPERM; drivers/acpi/riscv/cppc.c:100:9: note: initialize the variable 'ret' to silence this warning 100 | int ret; | ^ | = 0 1 error generated. Seems legitimate? -- Cheers, Nathan _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv