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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 28059C7EE23 for ; Wed, 7 Jun 2023 22:56:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3863410E566; Wed, 7 Jun 2023 22:56:42 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id A91C510E564; Wed, 7 Jun 2023 22:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686178600; x=1717714600; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=iX+nvftV0KHhsGnvJ13SAxPbMOKUxNKlhLf0St0TNGo=; b=AF3uQNati4lsx2evfKqFduj6VNyYy680Q4cyTIavS1Tl9YFlGGBkEjUA x2HdpJxo5xj85hrvg+gmxjx6Tt/SV99i+7929gutC97DyQh3TLYzfek+q +SU50+V5oGSP4XmEZgU4HlOU5HzjBNE5jROs8iK5dUacRBTjpygpBQiyM u0jQX2PgEnqL2/hdAeTD9eohwQ33lUf60RfT3hqd4jFQxYO8GOrmbowVO p87efOYb18/mPC5pY3vYTtgvR4Jj9azckpWQxvp4Qf3ULVr7VY3acO8EM eUPfqj/HW0uvEYFd5nhnfNFX8l7j5omGXMlRnhMhJLWwHQ3ZKj7zMpwPR w==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="385466084" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="385466084" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 15:56:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="660129895" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="660129895" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.85.43]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 15:56:39 -0700 Date: Wed, 07 Jun 2023 15:56:37 -0700 Message-ID: <87a5xanaoq.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: "Belgaumkar, Vinay" In-Reply-To: References: <20230606203535.292739-1-vinay.belgaumkar@intel.com> <87bkhrm0xk.wl-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tests/i915_pm_freq_api: Add a suspend subtest X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 07 Jun 2023 15:31:33 -0700, Belgaumkar, Vinay wrote: > > On 6/7/2023 2:12 PM, Dixit, Ashutosh wrote: > > On Tue, 06 Jun 2023 13:35:35 -0700, Vinay Belgaumkar wrote: > > Hi Vinay, > > > >> Verify that SLPC API works as expected after a suspend. > >> > >> Signed-off-by: Vinay Belgaumkar > >> --- > >> tests/i915/i915_pm_freq_api.c | 30 ++++++++++++++++++++++++++++++ > >> 1 file changed, 30 insertions(+) > >> > >> diff --git a/tests/i915/i915_pm_freq_api.c b/tests/i915/i915_pm_freq_api.c > >> index 9005cd220..f35f1f8e0 100644 > >> --- a/tests/i915/i915_pm_freq_api.c > >> +++ b/tests/i915/i915_pm_freq_api.c > >> @@ -18,6 +18,9 @@ > >> * > >> * SUBTEST: freq-reset > >> * Description: Test basic freq API works after a reset > >> + * > >> + * SUBTEST: freq-suspend > >> + * Description: Test basic freq API works after a runtime suspend > >> */ > >> > >> IGT_TEST_DESCRIPTION("Test SLPC freq API"); > >> @@ -99,6 +102,24 @@ static void test_reset(int i915, int dirfd, int gt) > >> igt_assert(get_freq(dirfd, RPS_MAX_FREQ_MHZ) == rpn); > >> } > >> > >> +static void test_suspend(int i915, int dirfd, int gt) > >> +{ > >> + uint32_t rpn = get_freq(dirfd, RPS_RPn_FREQ_MHZ); > >> + > >> + igt_assert(set_freq(dirfd, RPS_MIN_FREQ_MHZ, rpn) > 0); > >> + igt_assert(set_freq(dirfd, RPS_MAX_FREQ_MHZ, rpn) > 0); > >> + usleep(ACT_FREQ_LATENCY_US); > >> + igt_assert(get_freq(dirfd, RPS_MIN_FREQ_MHZ) == rpn); > >> + igt_assert(get_freq(dirfd, RPS_MAX_FREQ_MHZ) == rpn); > >> + > >> + /* Manually trigger a suspend */ > >> + igt_system_suspend_autoresume(SUSPEND_STATE_S3, > >> + SUSPEND_TEST_NONE); > >> + > >> + igt_assert(get_freq(dirfd, RPS_MIN_FREQ_MHZ) == rpn); > >> + igt_assert(get_freq(dirfd, RPS_MAX_FREQ_MHZ) == rpn); > > I am wondering what the purpose/value of this test (and also "freq-reset") > > is? How can the "set" min/max set freq (which are just input settings) > > change whether or not there is a suspend/resume or a reset? Especially when > > we just return cached min/max values from i915? > > It is mainly checking that we don't smother the softlimit during a reset or > suspend flow. How can softlimit which is a ordinary variable in memory get clobbered by suspend resume? > In addition, it also tests the read/write interface works as expected > after those events. There's no write. Sorry, but I'm not convinced. There should be some more meat to the test. Maybe we can write a test which will check /all/ sysfs values are the same after a suspend resume cycle? Why do only these specific ones have to be checked? Thanks. -- Ashutosh > > Thanks, > > Vinay. > > > > > Thanks. > > -- > > Ashutosh > > > > > >> +} > >> + > >> igt_main > >> { > >> int i915 = -1; > >> @@ -143,6 +164,15 @@ igt_main > >> test_reset(i915, dirfd, gt); > >> } > >> > >> + igt_describe("Test basic freq API works after suspend"); > >> + igt_subtest_with_dynamic_f("freq-suspend") { > >> + int dirfd, gt; > >> + > >> + for_each_sysfs_gt_dirfd(i915, dirfd, gt) > >> + igt_dynamic_f("gt%u", gt) > >> + test_suspend(i915, dirfd, gt); > >> + } > >> + > >> igt_fixture { > >> int dirfd, gt; > >> /* Restore frequencies */ > >> -- > >> 2.38.1 > >>