• Huacai Chen's avatar
    MIPS: hpet: Increase HPET_MIN_PROG_DELTA and decrease HPET_MIN_CYCLES · 3ef06653
    Huacai Chen authored
    At first, we prefer to use mips clockevent device, so we decrease the
    rating of hpet clockevent device.
    
    For hpet, if HPET_MIN_PROG_DELTA (minimum delta of hpet programming) is
    too small and HPET_MIN_CYCLES (threshold of -ETIME checking) is too
    large, then hpet_next_event() can easily return -ETIME. After commit
    c6eb3f70 ("hrtimer: Get rid of hrtimer softirq") this will cause
    a RCU stall.
    
    So, HPET_MIN_PROG_DELTA must be sufficient that we don't re-trip the
    -ETIME check -- if we do, we will return -ETIME, forward the next event
    time, try to set it, return -ETIME again, and basically lock the system
    up. Meanwhile, HPET_MIN_CYCLES doesn't need to be too large, 16 cycles
    is enough.
    
    This solution is similar to commit f9eccf24 ("clocksource/drivers
    /vt8500: Increase the minimum delta").
    
    By the way, this patch ensures hpet count/compare to be 32-bit long.
    Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
    Cc: John Crispin <john@phrozen.org>
    Cc: Steven J . Hill <Steven.Hill@imgtec.com>
    Cc: Fuxin Zhang <zhangfx@lemote.com>
    Cc: Zhangjin Wu <wuzhangjin@gmail.com>
    Cc: linux-mips@linux-mips.org
    Cc: stable@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13819/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    3ef06653
hpet.c 6.17 KB