From patchwork Thu Jan 23 21:54:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jeff.mcgee@intel.com X-Patchwork-Id: 3532221 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6D71C02DC for ; Thu, 23 Jan 2014 21:48:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2A29201C8 for ; Thu, 23 Jan 2014 21:48:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 38DBD201C7 for ; Thu, 23 Jan 2014 21:48:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 070C6FBFD8; Thu, 23 Jan 2014 13:48:04 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 394ECFBFF5 for ; Thu, 23 Jan 2014 13:48:01 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 23 Jan 2014 13:43:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,708,1384329600"; d="scan'208";a="443716008" Received: from jeffdesk.fso.intel.com ([10.5.53.1]) by orsmga001.jf.intel.com with ESMTP; 23 Jan 2014 13:47:58 -0800 From: jeff.mcgee@intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 23 Jan 2014 15:54:50 -0600 Message-Id: <1390514090-17875-1-git-send-email-jeff.mcgee@intel.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <20140123202455.GA29495@jeffdesk> References: <20140123202455.GA29495@jeffdesk> Subject: [Intel-gfx] [PATCH 4/4 v2] pm_rps: Require that cur reaches min at idle X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeff McGee The current frequency should reach the minimum frequency within a reasonable time during idle. v2: Not using forcewake for this particular subtest per Daniel's suggestion. Signed-off-by: Jeff McGee --- tests/pm_rps.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/pm_rps.c b/tests/pm_rps.c index 7ae0438..24a1ad6 100644 --- a/tests/pm_rps.c +++ b/tests/pm_rps.c @@ -206,13 +206,27 @@ static void min_max_config(void (*check)(void)) check(); } +#define IDLE_WAIT_TIMESTEP_MSEC 100 +#define IDLE_WAIT_TIMEOUT_MSEC 3000 static void idle_check(void) { int freqs[NUMFREQ]; - - read_freqs(freqs); - dump(freqs); - checkit(freqs); + int wait = 0; + + /* Monitor frequencies until cur settles down to min, which should + * happen within the allotted time */ + do { + read_freqs(freqs); + dump(freqs); + checkit(freqs); + if (freqs[CUR] == freqs[MIN]) + break; + usleep(1000 * IDLE_WAIT_TIMESTEP_MSEC); + wait += IDLE_WAIT_TIMESTEP_MSEC; + } while (wait < IDLE_WAIT_TIMEOUT_MSEC); + + igt_assert(freqs[CUR] == freqs[MIN]); + log("Required %d msec to reach cur=min\n", wait); } static void pm_rps_exit_handler(int sig)