From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id BACCB10E16E for ; Sat, 4 Mar 2023 01:55:21 +0000 (UTC) Date: Fri, 03 Mar 2023 17:55:20 -0800 Message-ID: <871qm5xotz.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Anshuman Gupta In-Reply-To: <20230303154941.490669-1-anshuman.gupta@intel.com> References: <20230303154941.490669-1-anshuman.gupta@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [PATCH i-g-t v2] perf_pmu: Dump i915_runtime_pm_status List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Fri, 03 Mar 2023 07:49:41 -0800, Anshuman Gupta wrote: > > Dump i915_pm_runtime_status in case of i915 device failed to runtime > suspend, it will dump the rpm wakeref tracking information which > will useful to debug the runtime pm issues. > > v2: > - Use wait_for_suspended(). [Ashutosh] > > Signed-off-by: Anshuman Gupta > Reviewed-by: Ashutosh Dixit > --- > tests/i915/perf_pmu.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c > index c1779fc9d..df194c8ad 100644 > --- a/tests/i915/perf_pmu.c > +++ b/tests/i915/perf_pmu.c > @@ -1703,6 +1703,16 @@ static bool wait_for_rc6(int fd, int timeout) > return false; > } > > +static bool wait_for_suspended(int gem_fd) > +{ > + bool suspended = igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED); > + > + if (!suspended) > + __igt_debugfs_dump(gem_fd, "i915_runtime_pm_status", IGT_LOG_INFO); > + > + return suspended; > +} > + > static void > test_rc6(int gem_fd, unsigned int flags) > { > @@ -1727,7 +1737,7 @@ test_rc6(int gem_fd, unsigned int flags) > drmModeFreeResources(res); > > igt_require(igt_setup_runtime_pm(gem_fd)); > - igt_require(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED)); > + igt_require(wait_for_suspended(gem_fd)); Hmm I didn't realize wait_for_suspended() instances were static so the function will have to be duplicated. In any case the R-b stands. Thanks. > > /* > * Sleep for a bit to see if once woken up estimated RC6 hasn't > -- > 2.25.1 >