[Top] [All Lists]

Re: [MIPS]clocks_calc_mult_shift() may gen a too big mult value

To: Yong Zhang <>
Subject: Re: [MIPS]clocks_calc_mult_shift() may gen a too big mult value
From: Chen Jie <>
Date: Mon, 31 Oct 2011 18:48:45 +0800
Cc:, LKML <>,,, yanhua <>, 项宇 <>, zhangfx <>, 孙海勇 <>
In-reply-to: <>
References: <> <>

2011/10/31 Yong Zhang <>:
> On Mon, Oct 31, 2011 at 5:00 PM, Chen Jie <> wrote:
>> Hi all,
>> On MIPS, with maxsec=4, clocks_calc_mult_shift() may generate a very
>> big mult, which may easily cause timekeeper.mult overflow within
>> timekeeping jobs.
> Hmmm, why not use clocksource_register_hz()/clocksource_register_khz()
> instead? it's more convenient.

Thanks for the suggestion. And sorry for I didn't notice the upstream
code has already hooked to clocksource_register_hz() in csrc-r4k.c
(We're using r4000 clock source)

I'm afraid this still doesn't fix my case. Through
I got a calculated maxsec = (0xffffffff - (0xffffffff>>5))/250000500 =
16        # assume mips_hpt_frequency=250000500

With this maxsec, I got a mult of 0xffffde72, still too big.

-- Chen Jie

<Prev in Thread] Current Thread [Next in Thread>