Repository navigation
FROMLIST: usb: typec: ucsi: Do not override an active alternate mode with USB mode - #1617
Conversation
…with USB mode ucsi_partner_change() switches the port to USB mode whenever the connector status reports a USB partner. An alternate mode can be entered through a path other than the UCSI alternate mode negotiation, for example pmic glink altmodedriver that programs muxes from firmware events. UCSI does not know about such an alternate mode, so a partner change handled after it is up takes the muxes back to USB. On SM8750, when the Qualcomm PMIC GLINK altmode driver enters DisplayPort, the USB mode update from ucsi switches the wcd939x-usbss mux, which carries the DisplayPort AUX lines, away from DisplayPort shortly after the hotplug handling has read the sink capabilities and EDID successfully. The next AUX read times out with -110 and link training never runs. The check cannot be done in UCSI or in the driver that entered the altmode, as neither knows what the other did. It is done in the mux layer, where the state is applied. Record in struct typec_mux_dev whether the last state accepted by the set callback was an alternate mode, and add mux_set_unless_altmode and set_mode_unless_altmode, which behave like typec_mux_set and typec_set_mode but leave mux devices that are in an alt mode untouched and report success for them. Use the latter for the USB mode update in ucsi_partner_change(). This also applies to alt modes that UCSI entered itself: a later USB mode update from a partner change no longer takes them back to USB. Any other accepted state clears the record. Hold a per mux device mutex around the set() callback and the update of the record, so that the check cannot interleave with an alternate mode entry coming from another path. Give every mutex its own lockdep class, muxes such as wcd939x-usbss forward a state to a downstream mux from their set callback and must be able to nest. Ports without an active alternate mode get the same states and error handling as before; the set() calls are now serialized per mux device. Link: https://lore.kernel.org/all/20261203-sm8750-dp-issue-v1-1-a519848958ad@oss.qualcomm.com/ Signed-off-by: Praveen Kumar Thuppa <pthuppa@qti.qualcomm.com> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
|
Merge Check Failed: No CR Numbers Found Error: No Change Request numbers were found. Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests. |
|
Merge Check Failed: No CR Numbers Found Error: No Change Request numbers were found. Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests. |
Test resultsWorkflow run: 46945366891 attempt 1 Known failures configured: 0
Test Matrix
|
PR #1617 — validate-patchPR: #1617
Final Summary
|
PR #1617 — checker-log-analyzerPR: #1617
Detailed report: Full report
|
LAVA Failed Case Triage SummaryPR: #1617 Job 307158 | SoC iq10-nordLAVA job: https://lava-oss.qualcomm.com/scheduler/job/307158 Failed test cases in LAVA job 307158 (SoC: iq10-nord).
|
|
Validated bootup on Nord in lava-foundries : https://lava.infra.foundries.io/scheduler/job/658715 |
d224594
into
qualcomm-linux:qcom-7.3-es
Test resultsWorkflow run: 46945366891 attempt 2 Known failures configured: 0
Test Matrix
|
ucsi_partner_change() switches the port to USB mode whenever the connector status reports a USB partner. An alternate mode can be entered through a path other than the UCSI alternate mode negotiation, for example pmic glink altmodedriver that programs muxes from firmware events. UCSI does not know about such an alternate mode, so a partner change handled after it is up takes the muxes back to USB.
On SM8750, when the Qualcomm PMIC GLINK altmode driver enters DisplayPort, the USB mode update from ucsi switches the wcd939x-usbss mux, which carries the DisplayPort AUX lines, away from DisplayPort shortly after the hotplug handling has read the sink capabilities and EDID successfully. The next AUX read times out with -110 and link training never runs.
The check cannot be done in UCSI or in the driver that entered the altmode, as neither knows what the other did. It is done in the mux layer, where the state is applied. Record in struct typec_mux_dev whether the last state accepted by the set callback was an alternate mode, and add mux_set_unless_altmode and set_mode_unless_altmode, which behave like typec_mux_set and typec_set_mode but leave mux devices that are in an alt mode untouched and report success for them. Use the latter for the USB mode update in ucsi_partner_change(). This also applies to alt modes that UCSI entered itself: a later USB mode update from a partner change no longer takes them back to USB. Any other accepted state clears the record.
Hold a per mux device mutex around the set() callback and the update of the record, so that the check cannot interleave with an alternate mode entry coming from another path. Give every mutex its own lockdep class, muxes such as wcd939x-usbss forward a state to a downstream mux from their set callback and must be able to nest.
Ports without an active alternate mode get the same states and error handling as before; the set() calls are now serialized per mux device.
Link: https://lore.kernel.org/all/20261203-sm8750-dp-issue-v1-1-a519848958ad@oss.qualcomm.com/
CRs Fixed:4766734