From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [RFC PATCH 1/2] soc: qcom: do not disable the iface clock in probe Date: Tue, 10 Jun 2014 10:39:02 -0700 Message-ID: <539742B6.7030303@codeaurora.org> References: <1402410678-12931-1-git-send-email-srinivas.kandagatla@linaro.org> <1402410717-12977-1-git-send-email-srinivas.kandagatla@linaro.org> <6D685866-4AE5-458B-BB8C-EFEBAE221A9E@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from smtp.codeaurora.org ([198.145.11.231]:55508 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbaFJRjE (ORCPT ); Tue, 10 Jun 2014 13:39:04 -0400 In-Reply-To: <6D685866-4AE5-458B-BB8C-EFEBAE221A9E@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Kumar Gala Cc: Srinivas Kandagatla , linux-arm-msm , Andy Gross , Mike Turquette On 06/10/14 08:20, Kumar Gala wrote: > On Jun 10, 2014, at 9:31 AM, Srinivas Kandagatla wrote: > >> The use case here is when we have a bootconsole which is printing th= e >> characters on serial console and gsbi driver comes up after some tim= e. >> As gsbi driver disables the clock in probe the bootconsole locks up. >> >> This patch fixes the problem by disabling the clock in platform remo= ve >> rather than in probe. >> >> Signed-off-by: Srinivas Kandagatla >> --- >> drivers/soc/qcom/qcom_gsbi.c | 46 +++++++++++++++++++++++++++++++---= ---------- >> 1 file changed, 33 insertions(+), 13 deletions(-) > It seems like we shouldn=92t need this change. Adding Stephen to see= if there is a reason we don=92t have the clk=92s enable_count adjusted= for how the bootloader setup clks. This is a long standing problem with the clock framework. In our vendor tree we've added something called "handoff" which basically detects the state of all clocks upon registration and keeps clocks enabled until late_init() if the clocks were enabled at the time of registration. =46or this case though "handoff" doesn't seem necessary. It's easier to just disable the clock when the driver is removed. With finer grained power management this driver can participate in runtime_pm and disable the ahb clock when the device is runtime suspended; which would only happen when the child devices (uart/spi/i2c) are also runtime suspended= =2E > - k > >> diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gs= bi.c >> index ab7b441..64fb298 100644 >> --- a/drivers/soc/qcom/qcom_gsbi.c >> +++ b/drivers/soc/qcom/qcom_gsbi.c >> @@ -22,44 +22,63 @@ >> #define GSBI_CTRL_REG 0x0000 >> #define GSBI_PROTOCOL_SHIFT 4 >> >> +struct gsbi_info { >> + struct clk *hclk; >> + u32 mode; >> + u32 crci; >> +}; What does mode and crci have to do with this patch? Can't we just put the clock into the platform data? --=20 Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation