[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aC8mMiw2o3MRmBtm@hovoldconsulting.com>
Date: Thu, 22 May 2025 15:27:14 +0200
From: Johan Hovold <johan@...nel.org>
To: Melody Olvera <melody.olvera@....qualcomm.com>
Cc: Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Wesley Cheng <quic_wcheng@...cinc.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, linux-arm-msm@...r.kernel.org,
linux-phy@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Abel Vesa <abel.vesa@...aro.org>, Marc Zyngier <maz@...nel.org>
Subject: Re: [PATCH v5 06/10] phy: qcom: Add M31 based eUSB2 PHY driver
On Mon, Apr 21, 2025 at 03:00:13PM -0700, Melody Olvera wrote:
> From: Wesley Cheng <quic_wcheng@...cinc.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
Powered by blists - more mailing lists