Patch "usb: typec: qcom-pmic-typec: split HPD bridge alloc and registration" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: typec: qcom-pmic-typec: split HPD bridge alloc and registration

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-typec-qcom-pmic-typec-split-hpd-bridge-alloc-and.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a1605d35e4a95d2ce25c99139f92c57bf87d6f1d
Author: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
Date:   Wed Apr 24 05:16:57 2024 +0300

    usb: typec: qcom-pmic-typec: split HPD bridge alloc and registration
    
    [ Upstream commit 718b36a7b49acbba36546371db2d235271ceb06c ]
    
    If a probe function returns -EPROBE_DEFER after creating another device
    there is a change of ending up in a probe deferral loop, (see commit
    fbc35b45f9f6 ("Add documentation on meaning of -EPROBE_DEFER"). In case
    of the qcom-pmic-typec driver the tcpm_register_port() function looks up
    external resources (USB role switch and inherently via called
    typec_register_port() USB-C muxes, switches and retimers).
    
    In order to prevent such probe-defer loops caused by qcom-pmic-typec
    driver, use the API added by Johan Hovold and move HPD bridge
    registration to the end of the probe function.
    
    The devm_drm_dp_hpd_bridge_add() is called at the end of the probe
    function after all TCPM start functions. This is done as a way to
    overcome a different problem, the DRM subsystem can not properly cope
    with the DRM bridges being destroyed once the bridge is attached. Having
    this function call at the end of the probe function prevents possible
    DRM bridge device creation followed by destruction in case one of the
    TCPM start functions returns an error.
    
    Reported-by: Caleb Connolly <caleb.connolly@xxxxxxxxxx>
    Acked-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
    Reviewed-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240424-qc-pmic-typec-hpd-split-v4-1-f7e10d147443@xxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
index d3958c061a972..501eddb294e43 100644
--- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
+++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
@@ -41,7 +41,7 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	const struct pmic_typec_resources *res;
 	struct regmap *regmap;
-	struct device *bridge_dev;
+	struct auxiliary_device *bridge_dev;
 	u32 base;
 	int ret;
 
@@ -92,7 +92,7 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
 	if (!tcpm->tcpc.fwnode)
 		return -EINVAL;
 
-	bridge_dev = drm_dp_hpd_bridge_register(tcpm->dev, to_of_node(tcpm->tcpc.fwnode));
+	bridge_dev = devm_drm_dp_hpd_bridge_alloc(tcpm->dev, to_of_node(tcpm->tcpc.fwnode));
 	if (IS_ERR(bridge_dev))
 		return PTR_ERR(bridge_dev);
 
@@ -110,8 +110,14 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
 	if (ret)
 		goto port_stop;
 
+	ret = devm_drm_dp_hpd_bridge_add(tcpm->dev, bridge_dev);
+	if (ret)
+		goto pdphy_stop;
+
 	return 0;
 
+pdphy_stop:
+	tcpm->pdphy_stop(tcpm);
 port_stop:
 	tcpm->port_stop(tcpm);
 port_unregister:




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux