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 6C3C8EB64DC for ; Tue, 18 Jul 2023 18:37:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6912210E074; Tue, 18 Jul 2023 18:37:54 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 37ACE10E046; Tue, 18 Jul 2023 18:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689705472; x=1721241472; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=D3iVdjpOm0qL5tLtp9SYyQ3k06QBCu/qHJSWp2LgFZQ=; b=M9PgMPBmYGo5iXCZS3JHuZ5ruhUGuao1YSyhdf1akDIADqoHzWspEUHq pg5Y1WzzKx26qwbljfSwTuF2wrjj07m28v92V/t3mtaeCZbnfG+xIqfTk 1isSjQlR9Q57N+Q64VFIkywGcw6UnkduxnpzGvNTMJoTUH0SxQrwEc1YE daeSBDHlMYnHCv/e7+wHl6Y31ovrWyaIAPWf/nnbetN+fWPtR+jg+YaKp zMC0ZYiqkpTvZMVy5Vad+SgFVkEp9hhSdW1rSYXVJ7AnMifMNYZMv33qw WEwpFcERcnHFBL4cJ4fM9O5NoslzXBZrDyoyHDeO+Ef9yQ5NicvlBzGP/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="365165320" X-IronPort-AV: E=Sophos;i="6.01,214,1684825200"; d="scan'208";a="365165320" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2023 11:37:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="753426892" X-IronPort-AV: E=Sophos;i="6.01,214,1684825200"; d="scan'208";a="753426892" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.20.219]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2023 11:37:49 -0700 Date: Tue, 18 Jul 2023 11:37:49 -0700 Message-ID: <87bkg9hxqa.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Tvrtko Ursulin In-Reply-To: <20230718084041.871888-1-tvrtko.ursulin@linux.intel.com> References: <20230718084041.871888-1-tvrtko.ursulin@linux.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] [PATCH i-g-t] tests/i915_pm_rps: Fix test after silent conflict harder 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: Intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org, Rodrigo Vivi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 18 Jul 2023 01:40:41 -0700, Tvrtko Ursulin wrote: > > From: Tvrtko Ursulin > > Feature test also needs adjusting after sysfs helper API changes... > > Signed-off-by: Tvrtko Ursulin > Fixes: d86ca7e17b58 ("tests/i915_pm_rps: Exercise sysfs thresholds") > Reference: 54dc25efaf10 ("lib/igt_sysfs: add asserting helpers for read/write operations") > Reference: 1dfa7a007a8e ("tests/i915_pm_rps: Fix test after silent conflict") > Cc: Rodrigo Vivi > Cc: Lukasz Laguna > Cc: Kamil Konieczny > Cc: Ashutosh Dixit > --- > tests/i915/i915_pm_rps.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c > index 15c74cc703c2..3ef5842dd7f8 100644 > --- a/tests/i915/i915_pm_rps.c > +++ b/tests/i915/i915_pm_rps.c > @@ -1015,20 +1015,23 @@ static void sysfs_set_u32(int dir, const char *attr, uint32_t set) > static void test_thresholds(int i915, unsigned int gt, unsigned int flags) > { > uint64_t ahnd = get_reloc_ahnd(i915, 0); > + unsigned int def_up = 0, def_down = 0; > const unsigned int points = 10; > - unsigned int def_up, def_down; > igt_spin_t *spin = NULL; > const intel_ctx_t *ctx; > unsigned int *ta, *tb; > unsigned int i; > int sysfs; > + bool ret; > > sysfs = igt_sysfs_gt_open(i915, gt); > igt_require(sysfs >= 0); > > /* Feature test */ > - def_up = igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct"); > - def_down = igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct"); > + ret = __igt_sysfs_get_u32(sysfs, "rps_up_threshold_pct", &def_up); > + igt_require(ret); > + ret = __igt_sysfs_get_u32(sysfs, "rps_down_threshold_pct", &def_down); > + igt_require(ret); Could also use igt_sysfs_has_attr(). Ok as is too. Reviewed-by: Ashutosh Dixit > igt_require(def_up && def_down); > > /* Check invalid percentages are rejected */ > -- > 2.39.2 >