From: Manu Gautam <mgautam@codeaurora.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
LKML <linux-kernel@vger.kernel.org>,
devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
linux-arm-msm@vger.kernel.org,
Vivek Gautam <vivek.gautam@codeaurora.org>,
Varadarajan Narayanan <varada@codeaurora.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Wei Yongjun <weiyongjun1@huawei.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Vivek Gautam <vivek.gautam@codeaurora.org>,
anischal@codeaurora.org
Subject: Re: [PATCH v3 1/6] phy: qcom-qmp: Enable pipe_clk before checking USB3 PHY_STATUS
Date: Tue, 27 Mar 2018 10:37:08 +0530 [thread overview]
Message-ID: <8724ae37-5d71-4d5f-f750-da0cb8838f47@codeaurora.org> (raw)
In-Reply-To: <CAD=FV=V7xDh6fvG12xOV9=WwTDLiuQxdWFr7Bq6wjPJ5gShrVA@mail.gmail.com>
Hi Doug,
On 3/27/2018 9:56 AM, Doug Anderson wrote:
> Manu
>
> On Thu, Mar 22, 2018 at 11:11 PM, Manu Gautam <mgautam@codeaurora.org> wrote:
>> QMP PHY for USB mode requires pipe_clk for calibration and PLL lock
>> to take place. This clock is output from PHY to GCC clock_ctl and then
>> fed back to QMP PHY and is available from PHY only after PHY is reset
>> and initialized, hence it can't be enabled too early in initialization
>> sequence.
>>
>> Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
>> ---
>> drivers/phy/qualcomm/phy-qcom-qmp.c | 33 ++++++++++++++++++++++++++++++++-
>> 1 file changed, 32 insertions(+), 1 deletion(-)
> So it's now new with this patch, but it's more obvious with this
> patch. It seems like "UFS/PCIE" is kinda broken w/ respect to how it
> controls its clock. Specifically:
>
> * If you init the PHY but don't power it on, then you "exit" the PHY:
> you'll disable/unprepare "pipe_clk" even though you never
> prepare/enabled it.
>
> * If you init the PHY, power it on, power it off, power it on, and
> exit the PHY: you'll leave the clock prepared one extra time.
>
> Specifically I'd expect: for UFS/PCIE the disable/unprepare should be
> symmetric with the enable/prepare and should be in "power off", not in
> exit.
>
> ...or did I miss something?
>
>
> Interestingly, your patch fixes this problem for USB3 (where init/exit
> are now symmetric), but leaves the problem there for UFS/PCIE.
>
Thanks for review.
One of the reason why pipe_clk is disabled as part of phy_exit is that
halt_check from clk_disable reports error if called after PHY has been
powered down or phy_exit.
I believe that warning should be ignored in qcom gcc-clock driver
(for applicable platforms) by using BRANCH_HALT_DELAY as halt_check
for pipe_clk and performing clk_disable from power_off for UFS/PCIE.
I can implement that as separate patch once dependent gcc driver
patch(es) gets in. Would that be ok?
-Manu
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2018-03-27 5:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 6:11 [PATCH v3 0/6] phy: qcom: Updates for USB PHYs on SDM845 Manu Gautam
2018-03-23 6:11 ` [PATCH v3 1/6] phy: qcom-qmp: Enable pipe_clk before checking USB3 PHY_STATUS Manu Gautam
2018-03-27 4:26 ` Doug Anderson
2018-03-27 5:07 ` Manu Gautam [this message]
2018-03-27 6:56 ` Vivek Gautam
2018-03-27 7:50 ` Manu Gautam
2018-03-27 20:14 ` Doug Anderson
2018-03-28 7:23 ` Manu Gautam
2018-03-27 6:51 ` Vivek Gautam
2018-03-27 7:33 ` Manu Gautam
2018-03-23 6:11 ` [PATCH v3 2/6] phy: qcom-qusb2: Fix crash if nvmem cell not specified Manu Gautam
2018-03-27 17:35 ` Evan Green
2018-03-23 6:11 ` [PATCH v3 3/6] dt-bindings: phy-qcom-qmp: Update bindings for sdm845 Manu Gautam
2018-03-27 21:37 ` Doug Anderson
2018-03-28 7:26 ` Manu Gautam
2018-03-23 6:11 ` [PATCH v3 4/6] phy: qcom-qmp: Add QMP V3 USB3 UNI PHY support " Manu Gautam
2018-03-27 21:42 ` Doug Anderson
2018-03-23 6:11 ` [PATCH v3 5/6] dt-bindings: phy-qcom-usb2: Update bindings " Manu Gautam
2018-03-27 15:01 ` Rob Herring
2018-03-27 21:57 ` Doug Anderson
2018-03-28 7:27 ` Manu Gautam
2018-03-23 6:11 ` [PATCH v3 6/6] phy: qcom-qusb2: Add QUSB2 PHYs support " Manu Gautam
2018-03-27 17:34 ` Evan Green
2018-03-27 22:52 ` Doug Anderson
2018-03-28 7:34 ` Manu Gautam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8724ae37-5d71-4d5f-f750-da0cb8838f47@codeaurora.org \
--to=mgautam@codeaurora.org \
--cc=anischal@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=fengguang.wu@intel.com \
--cc=kishon@ti.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=varada@codeaurora.org \
--cc=viresh.kumar@linaro.org \
--cc=vivek.gautam@codeaurora.org \
--cc=weiyongjun1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®