mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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: Tue, 11 Oct 2022 16:17:14 +0200	[thread overview]
Message-ID: <Y0V66q53I4ivlXI+@hovoldconsulting.com> (raw)
In-Reply-To: <ebe1e26a-7335-29ac-4990-6b8fdb02ba7c@linaro.org>

On Tue, Oct 11, 2022 at 05:04:04PM +0300, Dmitry Baryshkov wrote:
> On 11/10/2022 16:53, Johan Hovold wrote:
> > On Tue, Oct 11, 2022 at 04:46:53PM +0300, Dmitry Baryshkov wrote:
> >> On 11/10/2022 16:14, Johan Hovold wrote:
> >>> The power-down delay was included in the first version of the QMP driver
> >>> as an optional delay after powering on the PHY (using
> >>> POWER_DOWN_CONTROL) and just before starting it. Later changes modified
> >>> this sequence by powering on before initialising the PHY, but the
> >>> optional delay stayed where it was (i.e. before starting the PHY).
> >>>
> >>> The vendor driver does not use a delay before starting the PHY and this
> >>> is likely not needed on any platform unless there is a corresponding
> >>> delay in the vendor kernel init sequence tables (i.e. in devicetree).
> >>>
> >>> Let's keep the delay for now, but drop the redundant delay period
> >>> configuration while increasing the unnecessarily low timer slack
> >>> somewhat.
> >>
> >> Actually, the vendor driver does this 995..1005 sleep. But contrary to
> >> our driver it does that after programming whole PHY init sequence, which
> >> includes SW_RESET / START_CTL, but before programming the pipe clocks.
> > 
> > Right, it does it after starting the PHY which means that you don't have
> > to poll for as long for the PHY status.
> > 
> > It's a different delay entirely.
> 
> No-no-no. The 995-1005 delay was added guess for which SoC? For ipq8074, 
> where the config tables contain the ugly CFG_L writes for SW_RESET / 
> START_CTRL. So, it is the same delay, but added by somebody who didn't 
> care enough. The original 10-11 delay is a completely different story, 
> you are correct here.

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.

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")?

Johan

  reply	other threads:[~2022-10-11 14:17 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 [this message]
2022-10-11 14:41           ` Dmitry Baryshkov
2022-10-12  6:39             ` Johan Hovold
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=Y0V66q53I4ivlXI+@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

all inboxes | Powered by JetHome®