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 A412D606A31A for ; Mon, 23 Nov 2026 15:30:45 +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=EShIlDvh; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=JY/Va0iH DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID: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=42pe+2UMicZlITyFPJxiB15+3uk5mJXNcVaAM4zz0rk=; b=EShIlDvhSD5u13 7JHPdxaZxOJGQ1pcRsbGHgUwNsgOjo4TOgpjccTrkpu91JYiHUSUgwWZ5DoNnT2YSmSrc+oXMKzxH zIcF7fGu4oeJeJOCWj+RjihUaO1UtkiBSsT7WUY4zEW/rGnzwM2zEHQwofwdWgRRnFgdFQas6xoUd K/Wj/Z+lt8lNemr6azcawgxJi8RFeYXqMvVrHUfytrnVAuajnFFy1EKHSv8ROeFKvNyGs1MvwPCci mHfvcdKIF4JzM146Z1GO9fDk/W4siHtQ7hWWAN8tayuqEPqrs7weWCRkPJUWXPhdcgPNdmC3pRz0C 4iX3VD7LZh6DQ+bVme4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xVVz3-00000003zKL-2zyn; Mon, 23 Nov 2026 15:29:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xVVz1-00000003zJM-19P7; Mon, 23 Nov 2026 15:29:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 243B3143D; Mon, 23 Nov 2026 07:29:27 -0800 (PST) Received: from [10.57.63.212] (unknown [10.57.63.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7D9073F632; Mon, 23 Nov 2026 07:29:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1795447770; bh=0xbcGpMrwScqUYzspFMcy4M1QTBeI7Y5dmo8IAPpgqo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JY/Va0iH6nnTm3ZCQ1P7bWW987arEPgcPp0idnNLsxO1wSYW0dvJvX7Thmdqkcx+q bMbePNqN+MqqRt4ewHMzSstT+FzKDVWQibB5NCMakFs22XmyyGWpShlWFPpl2urfsP a1XUe6lSzAB2MI9MvwrAa+scQhKwHN97tfT+Kbxw= Message-ID: Date: Mon, 23 Nov 2026 15:29:25 +0000 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/panfrost: Gate the RK3399 GPU clock in runtime suspend To: Igor Velkov , =?UTF-8?Q?Adri=C3=A1n_Larumbe?= Cc: Boris Brezillon , Rob Herring , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org References: <20261030-panfrost-rk3399-pm-rt-v1-1-e94437159a9d@iav.lv> <20261104-panfrost-rk3399-pm-rt-larumbe-reply-1@iav.lv> From: Steven Price Content-Language: en-GB In-Reply-To: <20261104-panfrost-rk3399-pm-rt-larumbe-reply-1@iav.lv> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261123_072931_397041_024A3633 X-CRM114-Status: GOOD ( 32.27 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 04/11/2026 19:59, Igor Velkov wrote: > Hi Adrián, > > On 04.11.2026, Adrián Larumbe wrote: >>> On ROCK Pi 4A restore from hibernation hangs in genpd_restore_noirq() >>> of the GPU while panfrost is bound. With the clock gated in runtime >>> suspend, as on the Allwinner H616 and the Renesas parts, it restores. >> >> I find the wording in the preceding paragraph a bit confusing . Would >> you mind clarifying what 'parts' means here? I guess you refer to >> specific SoCs. > > Yes, SoCs: allwinner,sun50i-h616-mali, renesas,r9a08g046-mali and > renesas,r9a09g047-mali already use default_pm_rt_data. v2 will name > them. > >> Also, I wonder why not disabling the clocks would forestall coming back >> from a power suspension state. Have you raised this matter to the >> maintainers of the RK3399 SoC subsystem? > > The kernel that reads the image never binds panfrost, so after > clk_disable_unused() aclk_gpu stays gated. The restored image still has > it enabled in software (enable count 1 since probe), so powering the GPU > domain back on, whose clocks include aclk_gpu, only bumps the count, and > the QoS writes that follow in rockchip_pd_power() go to a gated block > and hang. I traced this for rkvdec [1]; for the GPU I see the hang at > the same spot, genpd_restore_noirq(), and gating in runtime suspend > removes it. I haven't raised it separately; Heiko is on To. > >> Would you also mind describing what you did to reproduce this >> resume-from-suspend issue? Lately we've been getting some fixes for >> similar SoC issues and I wonder whether mine also has it. > > It is hibernation (restore from disk), not suspend to RAM. ROCK Pi 4A, > drm-misc-next 33ed26235db9 plus [1], panfrost as a module, bound, GPU > idle, swap file with resume= and resume_offset=: systemctl hibernate, > power off and on. Without the patch restore hangs at "panfrost > ff9a0000.gpu: calling genpd_restore_noirq" 2 of 2, with it restores > 6 of 6. A quick check on another board: with panfrost bound and the GPU > idle, its core clock keeps enable count 1 in clk_summary. > >> If this patch depends on another fix being merged first, I think it's >> best you delay sending a v2 until it's been committed to its relevant >> subsystem tree and changes pulled into drm-misc-next. > > It applies and builds without [1]; [1] only gets this board through > restore up to the GPU. [1] goes through linux-media, so I'd rather not > tie v2 to it, but fine either way. > >> I'm not entirely sure about what patch submission guidelines say about >> testing information, but normally commit trailers must come about >> last. Would you mind then moving this to right before the S-o-b? > > The test notes are below the "---" on purpose, so they stay out of the > commit. > >>> + { .compatible = "rockchip,rk3399-mali", .data = &default_pm_rt_data }, >> >> You're effectively adding support to a whole new SoC. This made me >> wonder, are we sure suspension resumption not working is only because of >> GPU_PM_RT? Shouldn't we know first about its supplies and power domains, >> and any potential GPU quirks? I think this goes beyond my knowledge, so >> maybe Steven Price can pitch in. > > The node already carries "rockchip,rk3399-mali", "arm,mali-t860" and > binds through the fallback today. default_pm_rt_data differs from > default_data only in GPU_PM_RT; supplies and the power domain stay as > they are. The RK3399 GPU node has no bus clocks and no resets, so > GPU_PM_RT changes only aclk_gpu here. Steven's view is welcome. Sorry for the slow response, I've got quite behind on my emails. As you say the platform will previously have been able to use the fallback compatible. So this is such opting in this platform to use GPU_PM_RT. If we've got a report of this working (thanks for Igor) then I don't see why we wouldn't want to enable it. Basically we've taken the approach of being conservative until we see that GPU_PM_RT doesn't cause problems. I have to admit hibernation isn't something I've tested, so it's possible we need to look at fixing something related to that. But it's also quite likely that hibernation is more fundamentally broken on platform that don't have GPU_PM_RT, so it might not be something we can usefully fix. Other than the somewhat confusing commit message (e.g. a subject of "Enable GPU_PM_RT for RK3399" would be clearer), this is fine: Reviewed-by: Steven Price Thanks, Steve > [1] https://lore.kernel.org/r/20261030-rkvdec-runtime-pm-clocks-v2-1-8ff510a231de@iav.lv > > -- > Igor Velkov