Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753459AbbFDTo1 (ORCPT ); Thu, 4 Jun 2015 15:44:27 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54526 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752058AbbFDToY (ORCPT ); Thu, 4 Jun 2015 15:44:24 -0400 Date: Thu, 4 Jun 2015 12:44:22 -0700 From: Stephen Boyd To: Ezequiel Garcia Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Mike Turquette , Andrew Bresticker , James Hartley , James Hogan , cernekee@chromium.org, Govindraj.Raja@imgtec.com, Damien.Horsley@imgtec.com Subject: Re: [PATCH 1/3] clk: pistachio: Add a pll_lock() helper for clarity Message-ID: <20150604194422.GF676@codeaurora.org> References: <1432677669-29581-1-git-send-email-ezequiel.garcia@imgtec.com> <1432677669-29581-2-git-send-email-ezequiel.garcia@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432677669-29581-2-git-send-email-ezequiel.garcia@imgtec.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1352 Lines: 37 On 05/26, Ezequiel Garcia wrote: > This commit adds a pll_lock() helper making the code more readable. > Cosmetic change only, no functionality changes. > > Signed-off-by: Andrew Bresticker > Signed-off-by: Ezequiel Garcia > --- Applied to clk-next. > drivers/clk/pistachio/clk-pll.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/clk/pistachio/clk-pll.c b/drivers/clk/pistachio/clk-pll.c > index de53756..9ce1be7 100644 > --- a/drivers/clk/pistachio/clk-pll.c > +++ b/drivers/clk/pistachio/clk-pll.c > @@ -67,6 +67,12 @@ static inline void pll_writel(struct pistachio_clk_pll *pll, u32 val, u32 reg) > writel(val, pll->base + reg); > } > > +static inline void pll_lock(struct pistachio_clk_pll *pll) > +{ > + while (!(pll_readl(pll, PLL_STATUS) & PLL_STATUS_LOCK)) > + cpu_relax(); The patch is fine, but I wonder if we shouldn't have a timeout here in case the PLL fails to lock. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/