Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Melody Olvera <melody.olvera@oss.qualcomm.com>
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>,
	Wesley Cheng <quic_wcheng@quicinc.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Abel Vesa <abel.vesa@linaro.org>, Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH v5 06/10] phy: qcom: Add M31 based eUSB2 PHY driver
Date: Thu, 22 May 2025 15:27:14 +0200	[thread overview]
Message-ID: <aC8mMiw2o3MRmBtm@hovoldconsulting.com> (raw)
In-Reply-To: <20250421-sm8750_usb_master-v5-6-25c79ed01d02@oss.qualcomm.com>

On Mon, Apr 21, 2025 at 03:00:13PM -0700, Melody Olvera wrote:
> From: Wesley Cheng <quic_wcheng@quicinc.com>
> 
> SM8750 utilizes an eUSB2 PHY from M31.  Add the initialization
> sequences to bring it out of reset and into an operational state.  This
> differs to the M31 USB driver, in that the M31 eUSB2 driver will
> require a connection to an eUSB2 repeater.  This PHY driver will handle
> the initialization of the associated eUSB2 repeater when required.

> +static int m31eusb2_phy_init(struct phy *uphy)
> +{
> +	struct m31eusb2_phy *phy = phy_get_drvdata(uphy);
> +	const struct m31_eusb2_priv_data *data = phy->data;
> +	int ret;
> +
> +	ret = regulator_bulk_enable(M31_EUSB_NUM_VREGS, phy->vregs);
> +	if (ret) {
> +		dev_err(&uphy->dev, "failed to enable regulator, %d\n", ret);
> +		return ret;
> +	}
> +
> +	ret = phy_init(phy->repeater);
> +	if (ret) {
> +		dev_err(&uphy->dev, "repeater init failed. %d\n", ret);
> +		goto disable_vreg;
> +	}

> +static int m31eusb2_phy_probe(struct platform_device *pdev)
> +{
> +	struct phy_provider *phy_provider;
> +	const struct m31_eusb2_priv_data *data;
> +	struct device *dev = &pdev->dev;
> +	struct m31eusb2_phy *phy;
> +	int ret;
> +
> +	phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
> +	if (!phy)
> +		return -ENOMEM;

> +	phy->phy = devm_phy_create(dev, NULL, &m31eusb2_phy_gen_ops);
> +	if (IS_ERR(phy->phy))
> +		return dev_err_probe(dev, PTR_ERR(phy->phy),
> +				     "failed to create phy\n");
> +
> +	ret = devm_regulator_bulk_get_const(dev, M31_EUSB_NUM_VREGS,
> +					    m31_eusb_phy_vregs, &phy->vregs);
> +	if (ret)
> +		return dev_err_probe(dev, ret,
> +				"failed to get regulator supplies\n");
> +
> +	phy_set_drvdata(phy->phy, phy);
> +
> +	phy->repeater = devm_of_phy_get_by_index(dev, dev->of_node, 0);
> +	if (IS_ERR(phy->repeater))
> +		return dev_err_probe(dev, PTR_ERR(phy->repeater),
> +				     "failed to get repeater\n");

Requesting the repeater PHY like this and managing it from the PHY ops
currently breaks lockdep as I've previously reported here:

	https://lore.kernel.org/lkml/ZnpoAVGJMG4Zu-Jw@hovoldconsulting.com/

I don't think we should merge this until that issue has been resolved as
it leaves us with an increasing number of (Qualcomm) SoCs where lockdep
cannot be used, which risks introducing further locking bugs without
anyone noticing.

Johan

  parent reply	other threads:[~2025-05-22 13:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-21 22:00 [PATCH v5 00/10] phy: qcom: Introduce USB support for SM8750 Melody Olvera
2025-04-21 22:00 ` [PATCH v5 01/10] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: Add SM8750 to QMP PHY Melody Olvera
2025-04-21 22:00 ` [PATCH v5 02/10] dt-bindings: phy: Add the M31 based eUSB2 PHY bindings Melody Olvera
2025-04-21 22:00 ` [PATCH v5 03/10] dt-bindings: usb: qcom,dwc3: Correct the SM8750 compatible Melody Olvera
2025-04-24  7:32   ` Krzysztof Kozlowski
2025-04-21 22:00 ` [PATCH v5 04/10] phy: qcom: qmp-combo: Add new PHY sequences for SM8750 Melody Olvera
2025-04-24  9:37   ` Dmitry Baryshkov
2025-04-21 22:00 ` [PATCH v5 05/10] phy: qcom: Update description for QCOM based eUSB2 repeater Melody Olvera
2025-04-21 22:00 ` [PATCH v5 06/10] phy: qcom: Add M31 based eUSB2 PHY driver Melody Olvera
2025-04-25  6:49   ` Abel Vesa
2025-05-22 11:05     ` Krzysztof Kozlowski
2025-05-22 12:18       ` Dmitry Baryshkov
2025-05-22 12:25         ` Abel Vesa
2025-05-22 13:01         ` neil.armstrong
2025-05-22 10:56   ` Song Xue
2025-05-22 15:09     ` Konrad Dybcio
2025-05-22 13:27   ` Johan Hovold [this message]
2025-04-21 22:00 ` [PATCH v5 07/10] arm64: dts: qcom: sm8750: Add USB support to SM8750 SoCs Melody Olvera
2025-04-24  9:38   ` Dmitry Baryshkov
2025-04-24 13:13   ` Krzysztof Kozlowski
2025-04-24 13:15   ` Krzysztof Kozlowski
2025-04-21 22:00 ` [PATCH v5 08/10] arm64: dts: qcom: sm8750: Add USB support for SM8750 MTP platform Melody Olvera
2025-04-24 13:12   ` Krzysztof Kozlowski
2025-04-21 22:00 ` [PATCH v5 09/10] arm64: dts: qcom: sm8750: Add USB support for SM8750 QRD platform Melody Olvera
2025-04-24 13:12   ` Krzysztof Kozlowski
2025-04-21 22:00 ` [PATCH v5 10/10] arm64: defconfig: Add M31 eUSB2 PHY config Melody Olvera
2025-04-24 13:16   ` Krzysztof Kozlowski
2025-04-24 17:13     ` Melody Olvera
2025-04-25  5:44       ` Krzysztof Kozlowski
2025-04-24  9:36 ` [PATCH v5 00/10] phy: qcom: Introduce USB support for SM8750 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=aC8mMiw2o3MRmBtm@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=abel.vesa@linaro.org \
    --cc=andersson@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=melody.olvera@oss.qualcomm.com \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_wcheng@quicinc.com \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=will@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