Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750918AbeAPGd5 (ORCPT + 1 other); Tue, 16 Jan 2018 01:33:57 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:31439 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbeAPGdz (ORCPT ); Tue, 16 Jan 2018 01:33:55 -0500 Subject: Re: [PATCH v5 02/44] clk: davinci: New driver for davinci PLL clocks To: David Lechner , , , CC: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Kevin Hilman , Adam Ford , References: <1515377863-20358-1-git-send-email-david@lechnology.com> <1515377863-20358-3-git-send-email-david@lechnology.com> <7fc8bd35-0416-216d-8e1e-53a0ec6e8790@ti.com> From: Sekhar Nori Message-ID: Date: Tue, 16 Jan 2018 12:02:47 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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