Skip to content
  • Dirk Brandewie's avatar
    intel_pstate: Correct BYT VID values. · d022a65e
    Dirk Brandewie authored
    
    
    Using a VID value that is not high enough for the requested P state can
    cause machine checks. Add a ceiling function to ensure calulated VIDs
    with fractional values are set to the next highest integer VID value.
    
    The algorythm for calculating the non-trubo VID from the BIOS writers
    guide is:
     vid_ratio = (vid_max - vid_min) / (max_pstate - min_pstate)
     vid = ceiling(vid_min + (req_pstate - min_pstate) * vid_ratio)
    
    Cc: All applicable <stable@vger.kernel.org>
    Signed-off-by: default avatarDirk Brandewie <dirk.j.brandewie@intel.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    d022a65e