All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, neil.armstrong@linaro.org, conor+dt@kernel.org,
	olteanv@gmail.com, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, vkoul@kernel.org
Subject: Re: [PATCH v2 2/2] phy: qcom: qmp-usb: Add support for SA8255P
Date: Wed, 22 Jul 2026 14:10:31 +0200	[thread overview]
Message-ID: <87bjbzi5s8.fsf@kernel.org> (raw)
In-Reply-To: <20260709150659.6E0301F000E9@smtp.kernel.org>

On Thu, Jul 09, 2026 at 15:06, sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Incorrect power domain sequencing during d0/d3 transitions risks NoC errors and bus hangs.
> --
>
> --- Patch [2]: [PATCH v2 2/2] phy: qcom: qmp-usb: Add support for SA8255P ---
> commit c32bbfd817c3f9fca4d2982ea37be36354501cc7
> Author: Sriram Dash <quic_sriramd@quicinc.com>
> Subject: phy: qcom: qmp-usb: Add support for SA8255P
>
> This commit adds support for the SA8255P SoC to the QMP USB PHY driver. 
> It introduces firmware-managed resources via SCMI using power protocols,
> managing state transitions (d0, d1, d3) through the "usb_core" and
> "usb_transfer" power domains.
>
>> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
>> index c5507168e1354..d085c1ad7fb5c 100644
>> --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
>> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
>
> [ ... ]
>
>> @@ -1865,6 +1890,77 @@ static const struct qmp_phy_cfg glymur_usb3_uniphy_cfg = {
>>  	.regs			= qmp_v7_usb3phy_regs_layout,
>>  };
>
> [ ... ]
>
>> +/* d3_to_d0 transition by turning on all the suppliers */
>> +static int qmp_usb_d3_to_d0(struct qmp_usb *qmp)
>> +{
>> +	int ret;
>> +
>> +	if (!qmp->pd_list)
>> +		return 0;
>> +
>> +	ret = pm_runtime_resume_and_get(qmp->pd_list->pd_devs[0]);
>> +	if (ret)
>> +		return ret;
>> +
>> +	ret = pm_runtime_resume_and_get(qmp->pd_list->pd_devs[1]);
>> +	if (ret)
>> +		pm_runtime_put_sync(qmp->pd_list->pd_devs[0]);
>> +
>> +	return ret;
>> +}
>
> [Severity: High]
> Does this sequence power up the domains in the wrong order?
>
> The commit message notes that "usb_core" (which maps to pd_devs[1] based on 
> the qmp_usb_domain_attach order) controls the GDSC, while "usb_transfer" 
> (pd_devs[0]) controls clocks and interconnects.
>
> Enabling clocks before the GDSC foundational power domain is enabled typically
> results in unpowered register access on Qualcomm SoCs, which could trigger a
> Network-on-Chip (NoC) error and bus hang. Should pd_devs[1] be resumed before
> pd_devs[0]?

I did not observe any bus errors during my testing. I tried to
insert/remove the phy driver and also could detect a flash drive using a
couple of more patches on other USB drivers.

So I'll keep it this way for v3.

>
>> +
>> +/* d0_to_d3 transition by turning off all the suppliers */
>> +static void qmp_usb_d0_to_d3(struct qmp_usb *qmp)
>> +{
>> +	if (!qmp->pd_list)
>> +		return;
>> +
>> +	pm_runtime_put_sync(qmp->pd_list->pd_devs[1]);
>> +	pm_runtime_put_sync(qmp->pd_list->pd_devs[0]);
>> +}
>
> [Severity: High]
> Similarly, could this cause a bus hang during the d0 to d3 transition?
>
> Putting "usb_core" (pd_devs[1]) before "usb_transfer" (pd_devs[0]) disables 
> the GDSC before the clocks. Shouldn't the GDSC be disabled last to prevent 
> unpowered hardware clock access?

When running modprobe -r, I did not observe any bus hang on my board.
I'll keep this way for v3.

>
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260709-phy-qcom-qmp-usb-8255-v2-0-3b6c26a45788@kernel.org?part=2

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, neil.armstrong@linaro.org, conor+dt@kernel.org,
	olteanv@gmail.com, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, vkoul@kernel.org
Subject: Re: [PATCH v2 2/2] phy: qcom: qmp-usb: Add support for SA8255P
Date: Wed, 22 Jul 2026 14:10:31 +0200	[thread overview]
Message-ID: <87bjbzi5s8.fsf@kernel.org> (raw)
In-Reply-To: <20260709150659.6E0301F000E9@smtp.kernel.org>

On Thu, Jul 09, 2026 at 15:06, sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Incorrect power domain sequencing during d0/d3 transitions risks NoC errors and bus hangs.
> --
>
> --- Patch [2]: [PATCH v2 2/2] phy: qcom: qmp-usb: Add support for SA8255P ---
> commit c32bbfd817c3f9fca4d2982ea37be36354501cc7
> Author: Sriram Dash <quic_sriramd@quicinc.com>
> Subject: phy: qcom: qmp-usb: Add support for SA8255P
>
> This commit adds support for the SA8255P SoC to the QMP USB PHY driver. 
> It introduces firmware-managed resources via SCMI using power protocols,
> managing state transitions (d0, d1, d3) through the "usb_core" and
> "usb_transfer" power domains.
>
>> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
>> index c5507168e1354..d085c1ad7fb5c 100644
>> --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
>> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
>
> [ ... ]
>
>> @@ -1865,6 +1890,77 @@ static const struct qmp_phy_cfg glymur_usb3_uniphy_cfg = {
>>  	.regs			= qmp_v7_usb3phy_regs_layout,
>>  };
>
> [ ... ]
>
>> +/* d3_to_d0 transition by turning on all the suppliers */
>> +static int qmp_usb_d3_to_d0(struct qmp_usb *qmp)
>> +{
>> +	int ret;
>> +
>> +	if (!qmp->pd_list)
>> +		return 0;
>> +
>> +	ret = pm_runtime_resume_and_get(qmp->pd_list->pd_devs[0]);
>> +	if (ret)
>> +		return ret;
>> +
>> +	ret = pm_runtime_resume_and_get(qmp->pd_list->pd_devs[1]);
>> +	if (ret)
>> +		pm_runtime_put_sync(qmp->pd_list->pd_devs[0]);
>> +
>> +	return ret;
>> +}
>
> [Severity: High]
> Does this sequence power up the domains in the wrong order?
>
> The commit message notes that "usb_core" (which maps to pd_devs[1] based on 
> the qmp_usb_domain_attach order) controls the GDSC, while "usb_transfer" 
> (pd_devs[0]) controls clocks and interconnects.
>
> Enabling clocks before the GDSC foundational power domain is enabled typically
> results in unpowered register access on Qualcomm SoCs, which could trigger a
> Network-on-Chip (NoC) error and bus hang. Should pd_devs[1] be resumed before
> pd_devs[0]?

I did not observe any bus errors during my testing. I tried to
insert/remove the phy driver and also could detect a flash drive using a
couple of more patches on other USB drivers.

So I'll keep it this way for v3.

>
>> +
>> +/* d0_to_d3 transition by turning off all the suppliers */
>> +static void qmp_usb_d0_to_d3(struct qmp_usb *qmp)
>> +{
>> +	if (!qmp->pd_list)
>> +		return;
>> +
>> +	pm_runtime_put_sync(qmp->pd_list->pd_devs[1]);
>> +	pm_runtime_put_sync(qmp->pd_list->pd_devs[0]);
>> +}
>
> [Severity: High]
> Similarly, could this cause a bus hang during the d0 to d3 transition?
>
> Putting "usb_core" (pd_devs[1]) before "usb_transfer" (pd_devs[0]) disables 
> the GDSC before the clocks. Shouldn't the GDSC be disabled last to prevent 
> unpowered hardware clock access?

When running modprobe -r, I did not observe any bus hang on my board.
I'll keep this way for v3.

>
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260709-phy-qcom-qmp-usb-8255-v2-0-3b6c26a45788@kernel.org?part=2

  reply	other threads:[~2026-07-22 12:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 14:52 [PATCH v2 0/2] Add support for SA8255P in the qcom-qmp-usb phy driver Mattijs Korpershoek
2026-07-09 14:52 ` Mattijs Korpershoek
2026-07-09 14:52 ` [PATCH v2 1/2] dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8255P USB PHY Mattijs Korpershoek
2026-07-09 14:52   ` Mattijs Korpershoek
2026-07-11 17:13   ` Krzysztof Kozlowski
2026-07-11 17:13     ` Krzysztof Kozlowski
2026-07-22 12:18     ` Mattijs Korpershoek
2026-07-22 12:18       ` Mattijs Korpershoek
2026-07-09 14:52 ` [PATCH v2 2/2] phy: qcom: qmp-usb: Add support for SA8255P Mattijs Korpershoek
2026-07-09 14:52   ` Mattijs Korpershoek
2026-07-09 15:06   ` sashiko-bot
2026-07-09 15:06     ` sashiko-bot
2026-07-22 12:10     ` Mattijs Korpershoek [this message]
2026-07-22 12:10       ` Mattijs Korpershoek

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=87bjbzi5s8.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.