diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index f2cd069e4a17..105a677d472d 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -112,9 +112,18 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate, * which will lead to a large deviation in the result. * Therefore, it is required that the numerator must * be greater than 4. + * + * Note that there are some exceptions here: + * If there is an even frac div, we need to keep the original + * numerator(<4) and denominator. Otherwise, it may cause the + * issue that the duty ratio is not 50%. */ if (m < 4 && m != 0) { - val = DIV_ROUND_UP(4, m); + if (n % 2 == 0) + val = 1; + else + val = DIV_ROUND_UP(4, m); + n *= val; m *= val; if (n > fd->nmask) {