From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=54.207.22.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796089646; b=bO7vAoSi5Q93V8uvYDQNhn7XiGg05SJ3In5tHsiNXlsxK3Lx+XeVRSWyuHGZlsTx6geD d1mzTjbDl/iZm65YaqFEVjsdaBkR+PgQy2gGINyXf83HVoyfR+nGzL3GMyJ5ScWGewhZ3 7fW82Apq4w2WlqHhiDpOfnd40Azlo4uAQ3iGB+OvUVB6pMbCB5PAWewKczUBv6eSJsg1A wfPk9pS1ctRbK3YG64YhrbyIo048LWUOy3MpAxJ2lTqUXaz1bIDT/FEIEI64eXMigjFvd odapcY/UfYLOlZRrr2lBTBUMjoJVO3hv3tsreXrf4bhJTAGEZ9QaBWlPJt4+KOa0KNw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796089646; h=DMARC-Filter:DKIM-Signature:X-QQ-mid:X-QQ-Originating-IP:Received: X-QQ-SSF:X-QQ-GoodBg:X-BIZMAIL-ID:EX-QQ-RecipientCnt:Mime-Version: Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject: From:To:X-Mailer:References:In-Reply-To:X-QQ-SENDSIZE:Feedback-ID: X-QQ-XMAILINFO:X-QQ-XMRINFO:X-QQ-RECHKSPAM; bh=7dMHK2a/9Uax4+pXKqMT4y3DWlUvrQQ5EGLRJsH/l9w=; b=pclXo26ja10KaFFMaXPJ7u9/SFRjIiHeKJ8SVr7KIF4whlZS6qa+iyLBSdwXNMHBoV8m hr+xzFuJbLJw45jUrjTZ1LhMPi/T4pcYnYyKjfoPyX3jBh6p2qfPFiKfxOs3gXbdEURdq Oi2WllIBrsMX2ZUBaSAx66/5S/XIRFfTg9m3qmpmgCW/sWCh8X1s3iTJtRPHoQFh5k8Qt Ovwj/P+F4Wf03CYfIKDhgj745Oct3j6cbkRHynajxjO9SgMajvldSyPvF0B8sn1bN1Rz3 oAE2Krs/1oR9DXHnqPE+9e2fPDzlMZ666kxd9wnOfDYTMBPas09sT7m9fzvPTQzhY9g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=linux.spacemit.com; spf=none smtp.mailfrom=linux.spacemit.com; dkim=pass header.d=linux.spacemit.com header.i=@linux.spacemit.com header.a=rsa-sha256 header.s=mxsw2412 header.b=wOuRXsAz; arc=none smtp.remote-ip=54.207.22.56 Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7549606A31A for ; Tue, 1 Dec 2026 01:47:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D7549606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.spacemit.com header.i=@linux.spacemit.com header.a=rsa-sha256 header.s=mxsw2412 header.b=wOuRXsAz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.spacemit.com; s=mxsw2412; t=1796089582; bh=7dMHK2a/9Uax4+pXKqMT4y3DWlUvrQQ5EGLRJsH/l9w=; h=Mime-Version:Date:Message-Id:Subject:From:To; b=wOuRXsAzfTBM7BF1Cq4gFk38ZmkJzBKZ0de/zHlxAPbCY8kfNZFBIcUI/ZgSjYF3V LM3t7K2uPbzrRpdmdiwDgLIhjQMHRfVolJ3OFOVsq/4ctFO0FgQazplWp6/G6KPLEN VTKGOgv+AGbirip7ZqhWsUm4Kw/JDQAEE/KAfSP0= X-QQ-mid: zesmtpgz6t1796089575td4350060 X-QQ-Originating-IP: tcFItvUw2yUTVu+nT6VqpXG1cUcZj0l+1Ef7S14zIhs= Received: from localhost ( [120.237.158.181]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 01 Dec 2026 09:46:12 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 9981684194162239085 EX-QQ-RecipientCnt: 19 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 01 Dec 2026 09:46:12 +0800 Message-Id: Cc: "alessio.belle" , "luigi.santivetti" , "maarten.lankhorst" , "mripard" , "tzimmermann" , "airlied" , "simona" , "dlan" , "pjw" , "palmer" , "aou" , "alex" , "imagination" , "dri-devel" , "linux-kernel" , "linux-riscv" , "spacemit" Subject: Re: [PATCH v3] drm/imagination: re-check firmware idle state before runtime suspend From: "Baihui Liang" To: "Troy Mitchell" , "gye976" X-Mailer: aerc 0.17.0 References: <20261127-img-pm-autosuspend-v3-1-3a65ee22d9b2@linux.spacemit.com> In-Reply-To: X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpgz:linux.spacemit.com:qybglogicsvrgz:qybglogicsvrgz6b-0 X-QQ-XMAILINFO: NvH2zBBgt3uTbHQBI0ANtSRwupee/uwac/ksp539uVSQMlQx6pxLatKi tP0ViUvthglO2HXmyB2DG5CHoL9E2ysBfs3tGR7UceVtrzHYlGmEpq14Xk9HGa7andIijh2 WwEXNh57I14JPTJtZTKHlnN14yh+nsEjFJaxqJURsEeAIz62IovLMEWFzAAtwiKomUUBcGH OhkxNhIKJZ/jVAy85lT1diwLWiDqfttMiFEavlOnICzX4XSe6y0Wo7xKb6dJm/SmIO3TfWO iVWeVNyBpYmDgMWMEOl1yIA8rn8czZ6deY7vAP92o8fggj74TISTDWtsvMfwXCrs1B+v/pP Cx/qJQYqQGnsL+62Ck0j8vnDUfQ5FdJI02oS8TRYpr+Z3mNyepmlH7uLKuSXDhL+7jD1wvB lhSGW9vxMynlHqf9Y2LCj8aP5j+xX8KiN2xDf+U7kiMnLZBzqApUBdqDYlMn6kDHNmJJL8Q vONr0VkI2HtA3JFQEgGyl3wvqLhN3FcmbKh8eRbQv3eJv2hked/wCaMeASncbpejXE6QVmO wfAhvssAkEVp1cqyV0ifmNXdMAAtsbk8BC/UwqYeoy7U11IeT6teOTKzXu4sYWic52GpxPf O6M9/pOwPyefLNSaZ4pCFXu/h6V3LMR+FvnmL6WvIVoasCCv4w86iNOWi1SVHu4/L+2qyNO SUjRRqF34yc7yK3wKCyE5USFbN0PGLjUT+C0zmEn6THqCEVTqCFssL2JxFl+xKzKv1eRg5P EFISCBL3NiYzXwMN8N7VbYOFkJDVNoyTdiBWH+kTskvkIRjNVzomOpsdrJ3mkneMRGneUVi 4zW4GeRrqgdxY8a+5ko4559dFrQkSliMHBQ8+C5Nr0b2XmCQ8SGMvPs2c9IPTJktMtZ4e7O mVlAdhN7CB5ouiBouWyrvrX1XfI5JU74Zr4k7n+wmlrmX47Pyh5iQIqosDt74ceiBfr4RGz 713ZcmwYaVbVV7BCDMj83PdZr2u+CPDmRKjnVqhbIboi1jkz7opT1vb4CoVld0URecWau8/ E32khiYWbI8PCAlVSLsZv8uegisHVKLukzOZZbetauIPHTuRQprIti4rVLXYuPWNT2fW/mf SCrnoV3Gsqb X-QQ-XMRINFO: NyFYKkN4Ny6FuXrnB5Ye7Aabb3ujjtK+gg== X-QQ-RECHKSPAM: 0 Hi Gyeyong and Troy, On Sun Nov 29, 2026 at 9:40 PM CST, Troy Mitchell wrote: > Hi Gyeyoung and Baihui, > > On Sun Nov 29, 2026 at 6:27 AM GMT, Gyeyoung Baek wrote: > > Hi Baihui, > > > > On Fri, Nov 27, 2026 at 12:41 PM Baihui Liang > > wrote: > >> > >> pvr_power_device_idle() rejects runtime suspend while the firmware > >> hasn't reached ROGUE_FWIF_POW_IDLE. The PM core doesn't reschedule > >> idle notification after rejection, so no further pm_runtime_put() > >> arrives on an idle GPU and the device stays powered indefinitely. > >> > >> Move the idle check into pvr_power_device_suspend() and return -EBUSY > >> after pm_runtime_mark_last_busy() so the PM core reschedules the > >> autosuspend timer and retries until the firmware is idle. > >> > >> Factor the power-off sequence into a helper and call it from the > >> removal path with runtime PM disabled, bypassing the idle check. > >> Power off before destroying the job and free-list ID arrays, since > >> the IRQ handler can still process firmware commands during shutdown > >> and look up free-list IDs. > >> > > > > This looks like the right fix to me. However, testing it on J722S > > exposed a separate, pre-existing issue: > > - The firmware doesn't seem to report ROGUE_FWIF_POW_IDLE after boot > > until it has processed a command. > > - Without this patch the GPU just stays active after probe; with it, > > runtime suspend is retried indefinitely. > > > > I've sent a fix for that separately [1]. I think that one should be > > applied before this patch. With both, it works fine on J722S. > > Thanks for testing on J722S. I don't think this patch depends on [1], > though. The post-boot idle report is a separate, pre-existing issue. > So I'd leave the order to the maintainers, and Baihui doesn't need > to mention the dependency. Agreed with Troy and thanks for testing on J722S and catching that separate issue. I'll keep this patch standalone and leave the merge order to the maintainers. > > > > Two minor things: > > - The Fixes tag seems to be missing (as sashiko suggested) > > Agreed. > > > - The reproduction steps from v1 (repeated vulkaninfo on K3) are no > > longer in the commit message. It would be good to add them back, so > > it's clear when the issue occurs. > > Yes, below the --- line. > > With these addressed: > > Reviewed-by: Troy Mitchell > > > [1] https://lore.kernel.org/dri-devel/20261129-pvr-fw-idle-after-boot-v= 1-1-f56572cc8f4c@gmail.com/ Thanks both for the testing and review! I'll add the Fixes tag and put the K3 reproduction steps back below the '---' line in v4. Since the maintainer also requested some code changes on this patch, I'll drop the Tested-by and Reviewed-by tags for v4 and CC you both once it's ready. Best regards, Baihui