lkml.org 
[lkml]   [2016]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC v4 22/22] timekeeping: inform clockevents about freq adjustments
    On Tue, 23 Aug 2016, Nicolai Stange wrote:
    > + raw_spin_lock_irqsave(&clockevents_lock, flags);
    > + list_for_each_entry(dev, &clockevent_devices, list) {
    > + if (!(dev->features & CLOCK_EVT_FEAT_ONESHOT))
    > + continue;
    > +
    > + mult_raw = dev->mult;
    > + if (mult_raw != last_mult_raw) {
    > + last_mult_raw = mult_raw;
    > + last_mult_adjusted =
    > + __clockevents_calc_adjust_freq(mult_raw,
    > + mult_cs_mono,
    > + mult_cs_raw);

    What makes sure that the resulting shift/mult pair is still valid after this
    adjustment? The non adjusted mult/shift pair might be right at the border of
    potential overflows and the adjustment might just put it over the edge....
    We need at least sanity checks here.

    Thanks,

    tglx

    \
     
     \ /
      Last update: 2016-09-17 09:57    [W:5.004 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site