mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/7] phy: qcom: qmp-combo: store DP phy power state
Date: Thu, 6 Jun 2024 15:29:52 +0200	[thread overview]
Message-ID: <ec78bd64-b1f2-48c1-b1ab-b7e2f0b9e24d@linaro.org> (raw)
In-Reply-To: <du4345tswno5pfeiux5ks5eo37bbydilvdzw3firnsps2ejgn5@avnoqzxbmzj7>

On 27/05/2024 10:59, Dmitry Baryshkov wrote:
> On Mon, May 27, 2024 at 10:42:34AM +0200, Neil Armstrong wrote:
>> Switching the PHY Mode requires the DisplayPort PHY to be powered off,
>> keep track of the DisplayPort phy power state.
> 
> How is this different from dp_init_count?

dp_init_count tracks the DP PHY init, while dp_powered_on tracks
the DP PHY beeing powered on by the DRM DP driver, those are
not the same state at all.

While testing, I figured that de-initializing the DP PHY while
is was powered-on by the DRM DP, caused the system to freeze and crash.

SO I've added this to track this state and try to de-init the DP phy
if still in use.

Neil

> 
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>>   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>> index 7f999e8a433d..183cd9cd1884 100644
>> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>> @@ -1512,6 +1512,7 @@ struct qmp_combo {
>>   	unsigned int dp_aux_cfg;
>>   	struct phy_configure_opts_dp dp_opts;
>>   	unsigned int dp_init_count;
>> +	bool dp_powered_on;
>>   
>>   	struct clk_fixed_rate pipe_clk_fixed;
>>   	struct clk_hw dp_link_hw;
>> @@ -2685,6 +2686,8 @@ static int qmp_combo_dp_power_on(struct phy *phy)
>>   	/* Configure link rate, swing, etc. */
>>   	cfg->configure_dp_phy(qmp);
>>   
>> +	qmp->dp_powered_on = true;
>> +
>>   	mutex_unlock(&qmp->phy_mutex);
>>   
>>   	return 0;
>> @@ -2699,6 +2702,8 @@ static int qmp_combo_dp_power_off(struct phy *phy)
>>   	/* Assert DP PHY power down */
>>   	writel(DP_PHY_PD_CTL_PSR_PWRDN, qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL);
>>   
>> +	qmp->dp_powered_on = false;
>> +
>>   	mutex_unlock(&qmp->phy_mutex);
>>   
>>   	return 0;
>>
>> -- 
>> 2.34.1
>>
> 


  reply	other threads:[~2024-06-06 13:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27  8:42 [PATCH v2 0/7] arm64: qcom: allow up to 4 lanes for the Type-C DisplayPort Altmode Neil Armstrong
2024-05-27  8:42 ` [PATCH v2 1/7] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp: Reference usb-switch.yaml to allow mode-switch Neil Armstrong
2024-05-27 18:43   ` Krzysztof Kozlowski
2024-05-27  8:42 ` [PATCH v2 2/7] phy: qcom: qmp-combo: store DP phy power state Neil Armstrong
2024-05-27  8:59   ` Dmitry Baryshkov
2024-06-06 13:29     ` Neil Armstrong [this message]
2024-06-07  7:32       ` Dmitry Baryshkov
2024-05-27  8:42 ` [PATCH v2 3/7] phy: qcom: qmp-combo: introduce QPHY_MODE Neil Armstrong
2024-05-27  8:46   ` Dmitry Baryshkov
2024-05-27  8:48     ` Neil Armstrong
2024-05-27  8:59       ` Dmitry Baryshkov
2025-06-04 11:25   ` Udipto Goswami
2025-06-04 12:31     ` Neil Armstrong
2024-05-27  8:42 ` [PATCH v2 4/7] phy: qcom: qmp-combo: register a typec mux to change the QPHY_MODE Neil Armstrong
2024-05-27  8:57   ` Dmitry Baryshkov
2024-06-06 14:19     ` Neil Armstrong
2024-05-27  8:42 ` [PATCH v2 5/7] arm64: dts: qcom-sm8550: allow 4 lanes for DisplayPort and enable QMP PHY mode-switch Neil Armstrong
2024-05-27  9:03   ` Dmitry Baryshkov
2024-05-27  8:42 ` [PATCH v2 6/7] arm64: dts: qcom-sm8650: " Neil Armstrong
2024-05-27  9:03   ` Dmitry Baryshkov
2024-05-27  8:42 ` [PATCH v2 7/7] arm64: dts: qcom: sc8280xp-lenovo-thinkpad-x13: " Neil Armstrong
2024-05-27  9:04   ` Dmitry Baryshkov
2024-05-28 13:48 ` [PATCH v2 0/7] arm64: qcom: allow up to 4 lanes for the Type-C DisplayPort Altmode Bjorn Andersson
2024-05-29  7:55   ` Neil Armstrong
2024-08-16  6:35 ` Luca Weiss

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=ec78bd64-b1f2-48c1-b1ab-b7e2f0b9e24d@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=robh@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

all inboxes | Powered by JetHome®