Skip to content

Commit 6b42e14

Browse files
authored
Merge pull request #242 from quic-botlagun/rounding_error
FROMLIST: drm/msm/dsi/phy: fix rounding error in recalc_rate
2 parents d31e5c8 + 679ec2c commit 6b42e14

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,12 @@ static unsigned long dsi_pll_7nm_vco_recalc_rate(struct clk_hw *hw,
595595
pll_freq += div_u64(tmp64, multiplier);
596596

597597
vco_rate = pll_freq;
598+
/*
599+
* Recalculating the rate from dec and frac doesn't end up the rate
600+
* we originally set. Convert the freq to KHz, round it up and
601+
* convert it back to Hz.
602+
*/
603+
vco_rate = DIV_ROUND_UP_ULL(vco_rate, 1000) * 1000;
598604
pll_7nm->vco_current_rate = vco_rate;
599605

600606
DBG("DSI PLL%d returning vco rate = %lu, dec = %x, frac = %x",

0 commit comments

Comments
 (0)