Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753669AbbFXUCm (ORCPT ); Wed, 24 Jun 2015 16:02:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:51578 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753208AbbFXUCf (ORCPT ); Wed, 24 Jun 2015 16:02:35 -0400 Message-ID: <558B0CD7.6040302@codeaurora.org> Date: Wed, 24 Jun 2015 13:02:31 -0700 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Gabriel Fernandez , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Srinivas Kandagatla , Maxime Coquelin , Patrice Chotard , Russell King , Michael Turquette , Peter Griffin , Pankaj Dev , Olivier Bideau , Javier Martinez Canillas , Geert Uytterhoeven , Fabian Frederick CC: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, linux-clk@vger.kernel.org Subject: Re: [PATCH 1/9] drivers: clk: st: Incorrect clocks status References: <1435068567-30995-1-git-send-email-gabriel.fernandez@linaro.org> <1435068567-30995-2-git-send-email-gabriel.fernandez@linaro.org> In-Reply-To: <1435068567-30995-2-git-send-email-gabriel.fernandez@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1987 Lines: 52 On 06/23/2015 07:09 AM, Gabriel Fernandez wrote: > In the clk_summary output, the h/w status of DivMux is incorrect > (Parent and Enable status), since the clk_mux_ops.get_parent() > returns -ERRCODE when clock is OFF. > > Signed-off-by: Pankaj Dev > Signed-off-by: Gabriel Fernandez > --- > drivers/clk/st/clkgen-mux.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c > index 4fbe6e0..c94b56b 100644 > --- a/drivers/clk/st/clkgen-mux.c > +++ b/drivers/clk/st/clkgen-mux.c > @@ -128,7 +128,7 @@ static int clkgena_divmux_is_enabled(struct clk_hw *hw) > > __clk_hw_set_clk(mux_hw, hw); > > - return (s8)clk_mux_ops.get_parent(mux_hw) > 0; > + return ((s8)clk_mux_ops.get_parent(mux_hw) >= 0); Useless parentheses around it all, please drop. > } > > static u8 clkgena_divmux_get_parent(struct clk_hw *hw) > @@ -138,11 +138,13 @@ static u8 clkgena_divmux_get_parent(struct clk_hw *hw) > > __clk_hw_set_clk(mux_hw, hw); > > - genamux->muxsel = clk_mux_ops.get_parent(mux_hw); > - if ((s8)genamux->muxsel < 0) { > - pr_debug("%s: %s: Invalid parent, setting to default.\n", > - __func__, __clk_get_name(hw->clk)); > - genamux->muxsel = 0; > + if (genamux->muxsel == CKGAX_CLKOPSRC_SWITCH_OFF) { > + genamux->muxsel = clk_mux_ops.get_parent(mux_hw); Hm.. maybe we should fix clk_mux_ops to return 0 if it can't find the parent? Or when this clock is registered we should read the hardware and set a default parent so that we can't get an error code here. -- 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/