From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AF2BC71135 for ; Sun, 15 Jun 2025 18:03:44 +0000 (UTC) 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-Owner; bh=MvcirDmHSmRnboPvrhiZu5TkYXEEQGEZkenb9Wo2enk=; b=LeVjewKd2qjqr0 umfdGWN/Ay/sbOPH5o/5bPDmzzEjybLPCv+uJPaVN3XqHF2Ab2UVr+BOGeG4D//S0jEmEywJ0z6+g Jlle6H5FgIqjEGfTRT7p0kmoZZEMDPu/xQhVdhsq1l97BjOJ1oOaiDv53hZJ2yguKCdFx4MUZvCko w6+CikCQjVeeIjZVyf7AWOUs1jMbLYwqtP594tq/3KwnBMCHln6o3aXTstP2w1xw5XJORfL8M5BUh 0aICksOv7BIed2M/cA/y2tZD9bzZTisRDeWqmBEjgaYQ75h3Px6UJ9RQdGe/NW6sSp8ywVlkmJgTV 6gy9vCvAc9posuodBzYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uQrhf-00000002iup-0vKx; Sun, 15 Jun 2025 18:03:35 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uQrhb-00000002iuU-3IjP for linux-riscv@lists.infradead.org; Sun, 15 Jun 2025 18:03:33 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-748582445cfso2317827b3a.2 for ; Sun, 15 Jun 2025 11:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pdp7-com.20230601.gappssmtp.com; s=20230601; t=1750010610; x=1750615410; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3x1mZR75wgxhPUeoS08uV2B3ZSN0hsffb3DgZbseGCk=; b=puRPJdI17x71ulwxWrOb9Y+iepVG39p7ATtteRD4rCtJaYmXd/8NbOXTuul0DyBpS+ zmTS26PvPZlHFhKkOh4bJKKxPTVuhBrAtJ1l5a3nRnQaoew3nhQkrzEDAeoNyRqHvIj4 NxmCWKlJ2EaBFenMD7MeMO6C9k3Bt+9lR0CR2PItWQGXBTcSo+/epzxkYWAun2FEHxRy PQjS4VVlQ6etu4Xfdww9DO+58YDcjyExDeDWabzG9i3fz+oTyOpUqNG35WyGQ3pjR7t2 ci81Q3j1BtqPk35AYpUNUeFk+JidNI1IkK7HxcsxXG4Bh+toPjN4sSJUkmz34JUOAakZ NptQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750010610; x=1750615410; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3x1mZR75wgxhPUeoS08uV2B3ZSN0hsffb3DgZbseGCk=; b=Smei92PuhYAC04HzVRpxv/yg3PGnY8BLPOPeht57DXT8y7u5i9NiTwSKDiFY8bZoz5 QcYUDFJEgaDKvEiqWhKzxQWya42KJU+M8BGh9B6prQSUJEA5TIi0KXa589jFWTrG3xuk KMTpJxydLHcdWHFh6na46AYo+yrJGE5uokrOj+C46Qo9/jrE1eRqTvsVNcQSFrppPDha VawQnROLJm9jh7RGbi1+HTUtpYlYOCywNXPAPX5To7GpoHn4FtotNmWaede75+eqOXIu 2ednTSWoUSaJB7cZ61/rkVHq/j4mwjeZOg8lCyXNQx0SIeTqM8GXvmVEEtGLxJIUFHTm fFZQ== X-Forwarded-Encrypted: i=1; AJvYcCVW9AkDi7P7Z1Ggg+Ne00Fp76oUuAD/tgVLkcxFn9WzqAD6eir7VnAYcqhdMW+3unAkhTMPCCywhvzqAQ==@lists.infradead.org X-Gm-Message-State: AOJu0YxfNIgBuaHmGw2nYquKKEogaBZvGn5BEF59l2q6z4O7RXw1CwA6 jJaBgw/nG9eNasTR8VVdJ/xpFifeH89sO94Uq9kpVMV7S1qoPlqG0zl2oJZM6OATXTg= X-Gm-Gg: ASbGncvFyBfwKLou4qiV8u7pytiIUhwlW4bfaffmctyAItTzsI6bBdkMnyUctFAPApl tZtORlgcauaKru+UNoSvYYqufjwvg/38cTGKvlaGAG8o+7+AcfpoTUxFHAIIrgzAH0qFJ5uaT1w NOZAdrybOLrmb0O51PYavV75qCJeeO1XxxggthmlDv4EBMVKbFWJrKW23v1Fumy2xUNowSRWNS2 tIiyL8/VpYu74IFrITnbC6V3jzZiyuo278FKaqiV6ngjK6IFjx4ODKzVm5mXJV6er39eF2w7CmT 3SagSUk5GlofU0z0lrIB7eQ6u1rVed9MORwas6KG8R+KEFpzJoHHRHaPeWIDOFkuvSLzbcbvgrj GtuYoGyn7 X-Google-Smtp-Source: AGHT+IFpIn7TT0AiybQDiWVZF1Z4qdpPM6E8iz2nG1KaTGZ1pllTxFamD1VdBv+3cD8hZVxtHssjLQ== X-Received: by 2002:a05:6a21:8dc6:b0:1f5:9208:3ad6 with SMTP id adf61e73a8af0-21fbd5e0f1amr10461747637.41.1750010610502; Sun, 15 Jun 2025 11:03:30 -0700 (PDT) Received: from x1 (97-120-245-201.ptld.qwest.net. [97.120.245.201]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b2fe168987esm5294629a12.57.2025.06.15.11.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jun 2025 11:03:30 -0700 (PDT) Date: Sun, 15 Jun 2025 11:03:28 -0700 From: Drew Fustini To: Michal Wilczynski Cc: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Guo Ren , Fu Wei , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Marek Szyprowski , Benno Lossin , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v2 3/7] clk: thead: Mark essential bus clocks as CLK_IGNORE_UNUSED Message-ID: References: <20250610-rust-next-pwm-working-fan-for-sending-v2-0-753e2955f110@samsung.com> <20250610-rust-next-pwm-working-fan-for-sending-v2-3-753e2955f110@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250610-rust-next-pwm-working-fan-for-sending-v2-3-753e2955f110@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250615_110331_949491_DC448EB3 X-CRM114-Status: GOOD ( 21.40 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Jun 10, 2025 at 02:52:51PM +0200, Michal Wilczynski wrote: > Probing peripherals in the AON and PERI domains, such as the PVT thermal > sensor and the PWM controller, can lead to boot hangs or unresponsive > devices on the LPi4A board. The root cause is that their parent bus > clocks ('CLK_CPU2AON_X2H' and the 'CLK_PERISYS_APB' clocks) are > automatically gated by the kernel's power-saving mechanisms when the bus > is perceived as idle. > > Alternative solutions were investigated, including modeling the parent > bus in the Device Tree with 'simple-pm-bus' or refactoring the clock > driver's parentage. The 'simple-pm-bus' approach is not viable due to > the lack of defined bus address ranges in the hardware manual and its > creation of improper dependencies on the 'pm_runtime' API for consumer > drivers. > > Therefore, applying the'`CLK_IGNORE_UNUSED' flag directly to the > essential bus clocks is the most direct and targeted fix. This prevents > the kernel from auto-gating these buses and ensures peripherals remain > accessible. > > This change fixes the boot hang associated with the PVT sensor and > resolves the functional issues with the PWM controller. > > [1] - https://lore.kernel.org/all/9e8a12db-236d-474c-b110-b3be96edf057@samsung.com/ > > Signed-off-by: Michal Wilczynski > --- > drivers/clk/thead/clk-th1520-ap.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th1520-ap.c > index ebfb1d59401d05443716eb0029403b01775e8f73..cf7f6bd428a0faa4611b3fc61edbbc6690e565d9 100644 > --- a/drivers/clk/thead/clk-th1520-ap.c > +++ b/drivers/clk/thead/clk-th1520-ap.c > @@ -792,11 +792,12 @@ static CCU_GATE(CLK_AON2CPU_A2X, aon2cpu_a2x_clk, "aon2cpu-a2x", axi4_cpusys2_ac > 0x134, BIT(8), 0); > static CCU_GATE(CLK_X2X_CPUSYS, x2x_cpusys_clk, "x2x-cpusys", axi4_cpusys2_aclk_pd, > 0x134, BIT(7), 0); > -static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_pd, 0x138, BIT(8), 0); > +static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_pd, > + 0x138, BIT(8), CLK_IGNORE_UNUSED); > static CCU_GATE(CLK_CPU2PERI_X2H, cpu2peri_x2h_clk, "cpu2peri-x2h", axi4_cpusys2_aclk_pd, > 0x140, BIT(9), CLK_IGNORE_UNUSED); > static CCU_GATE(CLK_PERISYS_APB1_HCLK, perisys_apb1_hclk, "perisys-apb1-hclk", perisys_ahb_hclk_pd, > - 0x150, BIT(9), 0); > + 0x150, BIT(9), CLK_IGNORE_UNUSED); > static CCU_GATE(CLK_PERISYS_APB2_HCLK, perisys_apb2_hclk, "perisys-apb2-hclk", perisys_ahb_hclk_pd, > 0x150, BIT(10), CLK_IGNORE_UNUSED); > static CCU_GATE(CLK_PERISYS_APB3_HCLK, perisys_apb3_hclk, "perisys-apb3-hclk", perisys_ahb_hclk_pd, > > -- > 2.34.1 > I'm okay with fixing it this way for now and revisiting the parent relationships later. Reviewed-by: Drew Fustini _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv