From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 1/2] tests/pm_rps: Round requested freq correctly Date: Fri, 7 Feb 2014 16:52:30 +0200 Message-ID: <20140207145230.GX3891@intel.com> References: <1391763814-6644-1-git-send-email-daniel.vetter@ffwll.ch> <20140207093330.GH5360@nuc-i3427.alporthouse.com> <20140207144414.GF19424@jeffdesk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 19708FBB19 for ; Fri, 7 Feb 2014 06:52:48 -0800 (PST) Content-Disposition: inline In-Reply-To: <20140207144414.GF19424@jeffdesk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Daniel Vetter , Chris Wilson , Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Fri, Feb 07, 2014 at 08:44:14AM -0600, Jeff McGee wrote: > On Fri, Feb 07, 2014 at 11:15:15AM +0100, Daniel Vetter wrote: > > On Fri, Feb 7, 2014 at 10:33 AM, Chris Wilson wrote: > > > On Fri, Feb 07, 2014 at 10:03:33AM +0100, Daniel Vetter wrote: > > >> The kernel will round it, so if we don't we'll have a spurious > > >> mismatch. Happens on my machine here with 650-1300MHz range, where t= he > > >> midpoint is 975. > > >> > > >> Cc: Jeff McGee > > >> Signed-off-by: Daniel Vetter > > >> --- > > >> tests/pm_rps.c | 3 +++ > > >> 1 file changed, 3 insertions(+) > > >> > > >> diff --git a/tests/pm_rps.c b/tests/pm_rps.c > > >> index 467038104ec6..27e758755e3f 100644 > > >> --- a/tests/pm_rps.c > > >> +++ b/tests/pm_rps.c > > >> @@ -350,6 +350,9 @@ static void min_max_config(void (*check)(void)) > > >> { > > >> int fmid =3D (origfreqs[RPn] + origfreqs[RP0]) / 2; > > >> > > >> + /* hw (and so kernel) currently rounds to 50 MHz ... */ > > > > > > s/rounds/truncates/ or if it really does round, you need to adjust the > > > calculation. > > = > > We just need to use something divisible by 50 so that the value we > > write and the one we get match up. Whether it's truncating or rounding > > doesn't matter really. > > -Daniel > = > Darn, I considered this possibility but forgot to account for it in the t= est. > I think what I was going to do was to create another writeval variant > which doesn't do read back matching check. This was because I didn't want= to > assume that all systems use a 50 Mhz frequency increment (do they all?). VLV sure doesn't. -- = Ville Syrj=E4l=E4 Intel OTC