From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: rc6 residency (fix the fix) Date: Mon, 23 Apr 2012 09:38:33 +0200 Message-ID: <20120423073833.GA4935@phenom.ffwll.local> References: <1334947801-17280-1-git-send-email-ben@bwidawsk.net> <1335109823_20954@CP5-2952> <20120422103529.54504e03@bwidawsk.net> <1335116390_21488@CP5-2952> <20120422195733.0d4970e5@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id C56879F2FC for ; Mon, 23 Apr 2012 00:37:38 -0700 (PDT) Received: by werp11 with SMTP id p11so8977610wer.36 for ; Mon, 23 Apr 2012 00:37:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20120422195733.0d4970e5@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, Apr 22, 2012 at 07:57:33PM -0700, Ben Widawsky wrote: > On Sun, 22 Apr 2012 18:39:23 +0100 > Chris Wilson wrote: > > > On Sun, 22 Apr 2012 10:35:29 -0700, Ben Widawsky > > wrote: > > > On Sun, 22 Apr 2012 16:49:53 +0100 > > > Chris Wilson wrote: > > > > > > > On Fri, 20 Apr 2012 11:50:01 -0700, Ben Widawsky > > > > wrote: > > > > > Chris' fix for my 32b breakage was incorrect. do_div returns a > > > > > remainder. Go back to a divide macro which is more 32b friendly. > > > > > > > > > > Tested on x86-64. > > > > > > > > > > This has only been compile tested on 32b systems. > > > > Doesn't compile on my 32-bit systems. > > > > > > > > Still does a 64-bit divide. > > > > > > This is weird. I don't understand what's broken exactly. It should > > > be dividing an unsigned long long, which the 32b compiler should > > > have no issue with. The macro itself expands to do_div which was > > > your original fix. > > > > > > What is the error message you get? > > Undefined reference to __udivid3. > > > > The reason is that the result of DIV_ROUND_UP_ULL is a 64-bit value, > > which we then proceed to divide by 100. > > -Chris > > > > For the sake of picking nits, this is a linker fail, not a compiler one. > The only reason I make note of it is I was only compiling the .ko when > I did my testing. > > So lesson learned, can't we just: Done. -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48