Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752948AbdGXKEI (ORCPT ); Mon, 24 Jul 2017 06:04:08 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40230 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684AbdGXKD7 (ORCPT ); Mon, 24 Jul 2017 06:03:59 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B873A60912 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=mgautam@codeaurora.org Subject: Re: [PATCH v1 4/6] phy: qcom-qusb2: Add support for runtime PM To: Stephen Boyd , Kishon Vijay Abraham I , Felipe Balbi Cc: linux-arm-msm@vger.kernel.org, Vivek Gautam , Krzysztof Kozlowski , Viresh Kumar , "open list:GENERIC PHY FRAMEWORK" References: <1500634921-25914-1-git-send-email-mgautam@codeaurora.org> <1500634921-25914-5-git-send-email-mgautam@codeaurora.org> <4b267088-e925-0842-9773-b5634565618c@codeaurora.org> From: Manu Gautam Message-ID: <8995d28c-1896-8a85-ce15-176bfa40986e@codeaurora.org> Date: Mon, 24 Jul 2017 15:33:53 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <4b267088-e925-0842-9773-b5634565618c@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1247 Lines: 32 Hi, On 7/21/2017 10:54 PM, Stephen Boyd wrote: > On 07/21/2017 04:01 AM, Manu Gautam wrote: >> Driver can turn off clocks during runtime suspend. >> Also, runtime suspend is not as a result of host mode >> selective suspend then PHY can be powered off as well. >> >> Signed-off-by: Manu Gautam >> >> diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c >> index fa60a99..b505681 100644 >> --- a/drivers/phy/qualcomm/phy-qcom-qusb2.c >> +++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c >> @@ -132,6 +132,9 @@ struct qusb2_phy { >> >> const struct qusb2_phy_cfg *cfg; >> bool has_se_clk_scheme; >> + bool phy_initialized; >> + bool powered_on; > Is the powered_on flag here because the controller driver has unbalanced > power on calls to the phy? Same comment applies for the phy_initialized > flag. Both of these look like workarounds for some odd behavior in the > controller driver. phy_initialized flag is to make runtime_suspend/resume no-ops until PHY gets initialized. powered_on flag is not related to any issue issue in core (as of now). I just added that to bail out early from phy power_on/off which is now called from phy_init/exit and runtime_suspend/resume as well.