Skip to content

Commit f47eba0

Browse files
abelvesagregkh
authored andcommitted
usb: typec: ucsi: Set orientation as none when connector is unplugged
The current implementation of the ucsi glink client connector_status() callback is only relying on the state of the gpio. This means that even when the cable is unplugged, the orientation propagated to the switches along the graph is "orientation normal", instead of "orientation none", which would be the correct one in this case. One of the Qualcomm DP-USB PHY combo drivers, which needs to be aware of the orientation change, is relying on the "orientation none" to skip the reinitialization of the entire PHY. Since the ucsi glink client advertises "orientation normal" even when the cable is unplugged, the mentioned PHY is taken down and reinitialized when in fact it should be left as-is. This triggers a crash within the displayport controller driver in turn, which brings the whole system down on some Qualcomm platforms. Propagating "orientation none" from the ucsi glink client on the connector_status() callback hides the problem of the mentioned PHY driver away for now. But the "orientation none" is nonetheless the correct one to be used in this case. So propagate the "orientation none" instead when the connector status flags says cable is disconnected. Fixes: 76716fd ("usb: typec: ucsi: glink: move GPIO reading into connector_status callback") Cc: stable <[email protected]> # 6.10 Reviewed-by: Bryan O'Donoghue <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Abel Vesa <[email protected]> Reviewed-by: Johan Hovold <[email protected]> Tested-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/20241212-usb-typec-ucsi-glink-add-orientation-none-v2-1-db5a50498a77@linaro.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9466545 commit f47eba0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/usb/typec/ucsi/ucsi_glink.c

+5
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ static void pmic_glink_ucsi_connector_status(struct ucsi_connector *con)
185185
struct pmic_glink_ucsi *ucsi = ucsi_get_drvdata(con->ucsi);
186186
int orientation;
187187

188+
if (!UCSI_CONSTAT(con, CONNECTED)) {
189+
typec_set_orientation(con->port, TYPEC_ORIENTATION_NONE);
190+
return;
191+
}
192+
188193
if (con->num > PMIC_GLINK_MAX_PORTS ||
189194
!ucsi->port_orientation[con->num - 1])
190195
return;

0 commit comments

Comments
 (0)