* [PATCH] cpufreq: 64bit divide in intel_pstate_calc_busy()
@ 2013-02-11 19:24 Artem Savkov
2013-02-11 19:42 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Artem Savkov @ 2013-02-11 19:24 UTC (permalink / raw)
To: Rafael J. Wysocki, Dirk Brandewie
Cc: Viresh Kumar, linux-pm, linux-kernel, Artem Savkov
intel_pstate.c won't compile on i686 because of a linking error:
drivers/cpufreq/intel_pstate.c:459: undefined reference to `__udivdi3'
Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
---
drivers/cpufreq/intel_pstate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 86ad482..dc43208 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -456,7 +456,9 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu,
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 = div64_u64(
+ sample->pstate_pct_busy * core_pct,
+ 100);
}
static inline void intel_pstate_sample(struct cpudata *cpu)
--
1.8.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cpufreq: 64bit divide in intel_pstate_calc_busy()
2013-02-11 19:24 [PATCH] cpufreq: 64bit divide in intel_pstate_calc_busy() Artem Savkov
@ 2013-02-11 19:42 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2013-02-11 19:42 UTC (permalink / raw)
To: Artem Savkov; +Cc: Dirk Brandewie, Viresh Kumar, linux-pm, linux-kernel
On Monday, February 11, 2013 11:24:08 PM Artem Savkov wrote:
> intel_pstate.c won't compile on i686 because of a linking error:
> drivers/cpufreq/intel_pstate.c:459: undefined reference to `__udivdi3'
>
> Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
I've just applied an equivalent patch from Dirk.
Thanks,
Rafael
> ---
> drivers/cpufreq/intel_pstate.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 86ad482..dc43208 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -456,7 +456,9 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu,
> 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 = div64_u64(
> + sample->pstate_pct_busy * core_pct,
> + 100);
> }
>
> static inline void intel_pstate_sample(struct cpudata *cpu)
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-11 19:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-11 19:24 [PATCH] cpufreq: 64bit divide in intel_pstate_calc_busy() Artem Savkov
2013-02-11 19:42 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox