Linux ARM-MSM sub-architecture
 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@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 4/6] phy: qcom-qmp-combo: fix broken power on
Date: Mon, 14 Nov 2022 08:48:07 +0100	[thread overview]
Message-ID: <Y3Hyt9xNQEjifDUY@hovoldconsulting.com> (raw)
In-Reply-To: <e4a423c6-e92d-1c40-2609-e8512bd9c03c@linaro.org>

On Sat, Nov 12, 2022 at 09:15:43AM +0300, Dmitry Baryshkov wrote:
> On 11/11/2022 11:42, Johan Hovold wrote:
> > The PHY is powered on during phy-init by setting the SW_PRWDN bit in the
> 
> Nit: SW_PWRDN
> 
> > COM_POWER_DOWN_CTRL register and then setting the same bit in the in the
> > PCS_POWER_DOWN_CONTROL register that belongs to the USB part of the
> > PHY.
> > 
> > Currently, whether power on succeeds depends on probe order and having
> > the USB part of the PHY be initialised first. In case the DP part of the
> > PHY is instead initialised first, the intended power on of the USB block
> > results in a corrupted DP_PHY register (e.g. DP_PHY_AUX_CFG8).
> > 
> > Add a pointer to the USB part of the PHY to the driver data and use that
> > to power on the PHY also if the DP part of the PHY is initialised first.
> > 
> > Fixes: 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy")
> > Cc: stable@vger.kernel.org	# 5.10
> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> 
> I can only hope that at some point in your cleanup this hack is going to 
> be removed.
> Nevertheless, I don't see a good way to do this at this moment. Thus:

Not sure why you're calling this a hack. This is how the hardware works
and pretending that this PHY is some kind of MFD with completely
independent components is partly what resulted in this mess.

Accessing the USB registers by means of a hard-coded index in the PHY
array as is done in the runtime PM callbacks is a hack (see patch 5/6),
adding a dedicated pointer is not.

> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Johan

  reply	other threads:[~2022-11-14  7:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  8:42 [PATCH 0/6] phy: qcom-qmp-combo: preparatory fixes (set 1/3) Johan Hovold
2022-11-11  8:42 ` [PATCH 1/6] phy: qcom-qmp-combo: fix out-of-bounds clock access Johan Hovold
2022-11-12  6:10   ` Dmitry Baryshkov
2022-11-11  8:42 ` [PATCH 2/6] phy: qcom-qmp-combo: fix sdm845 reset Johan Hovold
2022-11-12  6:11   ` Dmitry Baryshkov
2022-11-11  8:42 ` [PATCH 3/6] phy: qcom-qmp-combo: fix sc8180x reset Johan Hovold
2022-11-12  7:51   ` Dmitry Baryshkov
2022-11-11  8:42 ` [PATCH 4/6] phy: qcom-qmp-combo: fix broken power on Johan Hovold
2022-11-12  6:15   ` Dmitry Baryshkov
2022-11-14  7:48     ` Johan Hovold [this message]
2022-11-11  8:42 ` [PATCH 5/6] phy: qcom-qmp-combo: fix runtime suspend Johan Hovold
2022-11-12  6:17   ` Dmitry Baryshkov
2022-11-14  8:01     ` Johan Hovold
2022-11-11  8:42 ` [PATCH 6/6] phy: qcom-qmp-combo: clean up common initialisation Johan Hovold
2022-11-12  6:18   ` 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=Y3Hyt9xNQEjifDUY@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=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=stable@vger.kernel.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