Subject: Re: linux-next: Tree for Feb 11 (intel_pstate.c)

From: Dirk Brandewie <[email-masked]>
Date: Mon, 11 Feb 2013 09:29:09 -0800

On 02/11/2013 08:18 AM, Randy Dunlap wrote:
> On 02/10/13 23:47, Stephen Rothwell wrote:
>> Hi all,
>>
>> Changes since 20130208:
>>
>
> on i386:
>
> drivers/built-in.o: In function `intel_pstate_timer_func':
> intel_pstate.c:(.text+0x4ce97e): undefined reference to `__udivdi3'
> drivers/built-in.o: In function `intel_pstate_cpu_init':
> intel_pstate.c:(.cpuinit.text+0x974): undefined reference to `__udivdi3'
>
>
DOOH :-(  This patch fixes the issue.  I will work with Rafael to get it into
his next branch.

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 86ad482..e879963 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -456,7 +456,8 @@ static inline void intel_pstate_calc_busy(struct cpudata *cp
         core_pct = div64_u64(sample->aperf * 100, sample->mperf);
         sample->freq = cpu->pstate.turbo_pstate * core_pct * 1000;

-       sample->core_pct_busy = sample->pstate_pct_busy * core_pct / 100;
+       sample->core_pct_busy = div_s64((sample->pstate_pct_busy * core_pct),
+                                       100);
  }