From: Johan Hovold <johan@kernel.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Johan Hovold <johan+linaro@kernel.org>,
Vinod Koul <vkoul@kernel.org>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@somainline.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/13] phy: qcom-qmp-pcie: drop power-down delay config
Date: Wed, 12 Oct 2022 08:39:07 +0200 [thread overview]
Message-ID: <Y0ZhC0apqGoAyeII@hovoldconsulting.com> (raw)
In-Reply-To: <dbd85c78-86dc-8dd0-83d2-43af933e5a92@linaro.org>
On Tue, Oct 11, 2022 at 05:41:28PM +0300, Dmitry Baryshkov wrote:
> On 11/10/2022 17:17, Johan Hovold wrote:
> > Yeah, I noticed that ipq8074 was the first to abuse the prwdn_delay
> > and possibly because of it starting the PHY already in its PCS table
> > (which it never should have).
> >
> > I'm talking about the intent of pwrdn_delay which was to add a delay
> > after powering-on the phy and before starting it.
> >
> > The vendor driver has a 1 ms delay after starting the PHY and before it
> > starts polling as the PHY on newer SoC tend to take > 1 ms before they
> > are ready.
> >
> > So, I still claim that that delay in the vendor driver is a different
> > one entirely.
> >
> >> Thus, I'd say, the PCIe delay should be moved after the registers
> >> programming.
> >
> > No, not necessarily. Again, that's an optimisation in the vendor driver
> > to avoid polling so many times. Since I can say for sure that there are
> > no PHY that start in less than 1 ms, I wouldn't add it unconditionally.
>
> I don't think it's an optimization. For me it looks like some kind of
> stabilization delay before touching pipe clocks.
I meant that it's effectively an optimisation as the driver still works
without that unconditional delay after starting the PHY and before
polling its status. And the mainline poll-loop takes care of waiting
also for that 1 ms of "stabilisation".
But I guess you could be right in that later contributors have seen that
delay in the vendor driver and thought that prwdn_delay corresponds to
it without noticing that they are not at all equivalent.
As the current delay is pretty much pointless (you can wait for 20 ms if
you want, it doesn't matter as the PHY hasn't been started yet) I guess
we can move it and avoid a few loops when polling for the status.
[ The next batch of clean ups also increases that silly 10 us polling
period. ]
> > Either way, separate change.
> >
> >>>> I think we can either drop this delay completely, or move it before
> >>>> read_poll_timeout().
> >>>
> >>> It definitely shouldn't be used for any new platforms, but I opted for
> >>> the conservative route of keeping it in case some of the older platforms
> >>> actually do need it.
> >>>
> >>> My bet is that this is all copy-paste cruft that could be removed, but
> >>> I'd rather do that as a separate follow-on change. Perhaps after testing
> >>> some more SoC after removing the delay.
> >>>
> >>> SC8280XP certainly doesn't need it.
> >>
> >> I think in our case this delay just falls into status polling. We'd
> >> probably need it, if we'd add the noretain handling.
> >
> > I'm not sure I understand what you're referring to here ("noretain
> > handling")?
>
> From what I see in the downstream (4.19 at hand), the sequence is the
> following:
>
> program_phy_config() // including SW_RESET & START_CTRL
>
> delay
>
> for pipe clocks:
> clk_set_flags(info->hdl, CLKFLAG_NORETAIN_MEM)
> clk_set_flags(info->hdl, CLKFLAG_NORETAIN_PERIPH)
Heh. Crazy vendor-kernel magic.
> set clock rates, prepare & enable pipe clocks
>
> wmb()
>
> poll for the PHY STATUS
But 5.4 has something similar:
program + start
delay
enable pipe clock
poll for status
Johan
next prev parent reply other threads:[~2022-10-12 6:39 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-11 13:14 [PATCH 00/13] phy: qcom-qmp: further prep cleanups Johan Hovold
2022-10-11 13:14 ` [PATCH 01/13] phy: qcom-qmp: drop regulator error message Johan Hovold
2022-10-11 13:52 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 02/13] phy: qcom-qmp: drop superfluous comments Johan Hovold
2022-10-11 13:51 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 03/13] phy: qcom-qmp-combo: drop unused in-layout configuration Johan Hovold
2022-10-11 13:51 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 04/13] phy: qcom-qmp-pcie: drop redundant ipq8074 power on Johan Hovold
2022-10-11 13:51 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 05/13] phy: qcom-qmp-pcie-msm8996: drop unused in-layout configuration Johan Hovold
2022-10-11 13:53 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 06/13] phy: qcom-qmp-ufs: " Johan Hovold
2022-10-11 13:53 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 07/13] phy: qcom-qmp-usb: " Johan Hovold
2022-10-11 13:14 ` [PATCH 08/13] phy: qcom-qmp-pcie: drop power-down delay config Johan Hovold
2022-10-11 13:46 ` Dmitry Baryshkov
2022-10-11 13:53 ` Johan Hovold
2022-10-11 14:04 ` Dmitry Baryshkov
2022-10-11 14:17 ` Johan Hovold
2022-10-11 14:41 ` Dmitry Baryshkov
2022-10-12 6:39 ` Johan Hovold [this message]
2022-10-11 13:49 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 09/13] phy: qcom-qmp-pcie-msm8996: " Johan Hovold
2022-10-11 13:49 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 10/13] phy: qcom-qmp-combo: drop sc8280xp power-down delay Johan Hovold
2022-10-11 14:07 ` Dmitry Baryshkov
2022-10-11 14:21 ` Johan Hovold
2022-10-11 13:14 ` [PATCH 11/13] phy: qcom-qmp-combo: drop power-down delay config Johan Hovold
2022-10-11 14:05 ` Dmitry Baryshkov
2022-10-11 13:14 ` [PATCH 12/13] phy: qcom-qmp-usb: drop sc8280xp power-down delay Johan Hovold
2022-10-11 13:14 ` [PATCH 13/13] phy: qcom-qmp-usb: drop power-down delay config Johan Hovold
2022-10-11 14:05 ` Dmitry Baryshkov
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=Y0ZhC0apqGoAyeII@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=johan+linaro@kernel.org \
--cc=kishon@ti.com \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=vkoul@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).