Re: [PATCH v5 02/44] clk: davinci: New driver for davinci PLL clocks

From: Sekhar Nori
Date: Tue Jan 16 2018 - 01:34:03 EST


On Saturday 13 January 2018 07:43 AM, David Lechner wrote:
> On 01/12/2018 03:21 AM, Sekhar Nori wrote:
>> On Monday 08 January 2018 07:47 AM, David Lechner wrote:
>>> +static unsigned long davinci_pll_clk_recalc(struct clk_hw *hw,
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ unsigned long parent_rate)
>>> +{
>>> +ÂÂÂ struct davinci_pll_clk *pll = to_davinci_pll_clk(hw);
>>> +ÂÂÂ unsigned long rate = parent_rate;
>>> +ÂÂÂ u32 prediv, mult, postdiv;
>>> +
>>> +ÂÂÂ prediv = readl(pll->base + PREDIV) & PREDIV_RATIO_MASK;
>>> +ÂÂÂ mult = readl(pll->base + PLLM) & PLLM_MASK;
>>> +ÂÂÂ postdiv = readl(pll->base + POSTDIV) & POSTDIV_RATIO_MASK;
>>
>> Shouldn't we check if the pre and post dividers are enabled before using
>> them?
>
> I dug into this and the answer is no. The enable bit acts like a gate, not
> a bypass, so it does not affect the rate calculation.

Alright, thanks for checking this.

Regards,
Sekhar