Skip to content

FROMLIST: usb: typec: ucsi: Do not override an active alternate mode with USB mode - #1617

Merged
Salendarsingh Gaud (sgaud-quic) merged 1 commit into
qualcomm-linux:qcom-7.3-esfrom
Kriskura176767:sm8750-dp-issue
Dec 3, 2026
Merged

Salendarsingh Gaud (sgaud-quic) merged 1 commit into
qualcomm-linux:qcom-7.3-esfrom
Kriskura176767:sm8750-dp-issue

Conversation

@Kriskura176767

@Kriskura176767 Kriskura176767 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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

…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>
@qswat-orbit-external

Copy link
Copy Markdown

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.

@Kriskura176767 Kriskura176767 changed the title FROMLIST: usb: typec: ucsi: Do not override an active alternate mode … FROMLIST: usb: typec: ucsi: Do not override an active alternate mode with USB mode Dec 2, 2026
@qswat-orbit-external

Copy link
Copy Markdown

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.

@qcomlnxci

Copy link
Copy Markdown

Test results

Workflow run: 46945366891 attempt 1

Known failures configured: 0

Target Pass Non-pass Total
kbdev-nord-rrd-multimedia

Test Matrix

Test Case kbdev-nord-rrd-multimedia
LAVA result ✅ Results

@qlijarvis

Copy link
Copy Markdown

PR #1617 — validate-patch

PR: #1617

Verdict Issues Detailed Report
✅ 0 Full report

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20261203-sm8750-dp-issue-v1-1-a519848958ad@oss.qualcomm.com/

  2. Lore link matches PR commits: Yes — Commit message body is identical; diff content is byte-for-byte identical across all 6 files; authorship correctly preserved; FROMLIST: prefix appropriately added

  3. Upstream patch status: ⏳ In review — Posted Dec 3, 2026 (< 24 hours ago); no maintainer decision yet; Sashiko bot review passed; awaiting human maintainer review on linux-usb@vger.kernel.org

  4. PR present in qcom-next/topics: Partial - 1/1 commit(s) only have partial integration evidence

Verdict: ✅ — click to expand

🔍 Patch Validation

PR: #1617 - FROMLIST: usb: typec: ucsi: Do not override an active alternate mode with USB mode
Upstream commit: https://lore.kernel.org/all/20261203-sm8750-dp-issue-v1-1-a519848958ad@oss.qualcomm.com/
Verdict: ✅ PASS

Commit Message

Check Status Note
Subject matches upstream ✅ Subject correctly prefixed with FROMLIST:
Body preserves rationale ✅ Complete problem description and solution rationale preserved
Fixes tag present/correct N/A No Fixes tag in upstream (new feature, not a fix)
Authorship preserved ✅ From: matches lore author (Praveen Kumar Thuppa); both Signed-off-by lines present
Backport note (if applicable) N/A Not a backport - posted to list but not yet merged
Link tag present ✅ Correct lore.kernel.org link included

Diff

File Status Notes
drivers/usb/typec/class.c ✅ Identical - adds typec_set_mode_unless_altmode() function
drivers/usb/typec/mux.c ✅ Identical - adds mutex locking and altmode tracking logic
drivers/usb/typec/mux.h ✅ Identical - adds lock, lock_key, and altmode_active fields
drivers/usb/typec/ucsi/ucsi.c ✅ Identical - switches to typec_set_mode_unless_altmode()
include/linux/usb/typec.h ✅ Identical - exports new function
include/linux/usb/typec_mux.h ✅ Identical - declares new API and stub

Note: Index line differences (e.g., 54c7810b563be vs 34ced6d1c224) are expected - PR is based on a different tree snapshot than the lore patch base commit (9357829ac604c28510b71b154cb6630af81226ff). The actual diff content is byte-for-byte identical.

Upstream Patch Status

Community verdict: ⏳ Decision Pending — Patch posted Dec 3, 2026 (< 24 hours ago). Only automated Sashiko bot review present; no maintainer decision yet. Patch is under review on linux-usb@vger.kernel.org.

Evidence:

  • Posted to linux-usb mailing list Dec 3, 2026 00:13 +0530
  • Sashiko AI bot reviewed and found no issues (Dec 2, 2026 18:51 UTC)
  • No maintainer Reviewed-by, Acked-by, applied, or NAK signals yet
  • Thread is active and recent; normal review timeline for USB subsystem

PR Present in qcom-next/topics

Status: ⚠️ Partial — Subject line found in qcom-next with partial tree evidence, but full change not verified in either qcom-next or kernel-topics branches.

Details from integration_presence_report.md:

  • qcom-next: partial - subject or partial tree evidence found, but full change was not verified
  • topics: missing - no subject, patch-id, or full tree-content match found
  • Overall: 0/1 commits fully present, 1/1 partial

Interpretation: The commit may be in an early integration state or a similar change exists in qcom-next. The PR should be reviewed to ensure it doesn't duplicate existing work.

Issues

None. The PR faithfully represents the lore patch with correct FROMLIST: prefix, preserved authorship, complete commit message, and identical diff content.

Verdict

Merge as-is — The patch is a faithful representation of the upstream lore posting. The FROMLIST: prefix is correct for a patch posted to the mailing list but not yet merged. Authorship is properly preserved with both original author (Praveen Kumar Thuppa) in From: and both Signed-off-by lines intact. The diff content is identical to the lore patch. The Link tag correctly references the lore thread.

Recommendation: Monitor the upstream thread for maintainer feedback. If the patch receives a NAK or requires changes upstream, this PR should be updated or closed accordingly. If accepted upstream, update the prefix to UPSTREAM: and add the mainline commit SHA.

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20261203-sm8750-dp-issue-v1-1-a519848958ad@oss.qualcomm.com/

  2. Lore link matches PR commits: Yes — Commit message body is identical; diff content is byte-for-byte identical across all 6 files; authorship correctly preserved; FROMLIST: prefix appropriately added

  3. Upstream patch status: ⏳ In review — Posted Dec 3, 2026 (< 24 hours ago); no maintainer decision yet; Sashiko bot review passed; awaiting human maintainer review on linux-usb@vger.kernel.org

  4. PR present in qcom-next/topics: Partial — Subject found in qcom-next with partial evidence, but full change not verified; 0/1 commits fully present, 1/1 partial per integration_presence_report.md

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: 27cd2ba09b3377fea4e69efb419d44ca159c2bac
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/1 [PATCH] FROMLIST: usb: typec: ucsi: Do not override an active partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial

Final Status

overall_status: PARTIAL
present_commits: 0/1
partial_commits: 1/1
missing_commits: 0/1
topics_checked_for_commits: 1/1
final_summary: PR present in qcom-next/topics: Partial - 1/1 commit(s) only have partial integration evidence

@qlijarvis

Copy link
Copy Markdown

PR #1617 — checker-log-analyzer

PR: #1617
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/46945681110

Checker Result Summary
Checker Result Summary
checkpatch ✅ 1 style check (mutex comment) - non-blocking
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed
check-patch-compliance ✅ Passed
tag-check ✅ Subject prefix valid (FROMLIST:)

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1617 - FROMLIST: usb: typec: ucsi: Do not override an active alternate mode with USB mode
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/46945681110

Checker Result Summary
checkpatch ✅ 1 style check (mutex comment) - non-blocking
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed
check-patch-compliance ✅ Passed
tag-check ✅ Subject prefix valid (FROMLIST:)

ℹ️ checkpatch — Style Check (Non-blocking)

Root cause: Checkpatch detected a struct mutex definition without a comment (CHECK level, not WARNING or ERROR).

Failure details:

CHECK: struct mutex definition without comment
#223: FILE: drivers/usb/typec/mux.h:18:
+	struct mutex lock;

5eea5323a7709b2b78624d77b61497c693676cce total: 0 errors, 0 warnings, 1 checks, 193 lines checked

Analysis: This is a CHECK level finding, which is a style suggestion rather than a mandatory fix. The kernel coding style recommends documenting the purpose and locking rules for mutexes, but this is not a blocker for merge.

Fix (optional): Add a comment above the mutex explaining its purpose:

/* Protects mux state transitions and altmode tracking */
struct mutex lock;

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git c2ca8335a2f4..5eea5323a770

Verdict

✅ Ready to merge — All checkers passed. The single checkpatch CHECK is a style suggestion (mutex comment) and does not block merge. The commit has proper FROMLIST: prefix, includes upstream Link, and passed all compliance checks.

@qlijarvis

Copy link
Copy Markdown

LAVA Failed Case Triage Summary

PR: #1617

Job 307158 | SoC iq10-nord

LAVA job: https://lava-oss.qualcomm.com/scheduler/job/307158

Failed test cases in LAVA job 307158 (SoC: iq10-nord).

  Case 1: Build Load Failure — Docker daemon unavailable during deployment
  1. Failed case: Build Load Failure — Docker daemon unavailable during deployment
  2. Root cause: Result: Build Load Failure. The LAVA dispatcher's download-postprocess-docker action failed because the Docker daemon is not running on the LAVA worker node. Error: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
  3. Possible fix: Start the Docker daemon on the LAVA worker node (systemctl start docker) and verify it is enabled to start on boot (systemctl enable docker). If the issue persists, check Docker socket permissions and verify the lava-dispatcher user has access to the docker group. Re-trigger the CI job after confirming Docker is operational.
  4. Detail analysis attachment: failed_case_job307158_1_detailed.md
  Case 2: Build Load Failure — Docker daemon unavailable during image post-processing
  1. Failed case: Build Load Failure — Docker daemon unavailable during image post-processing
  2. Root cause: Result: Build Load Failure. The LAVA dispatcher's download-postprocess-docker action (step 1.4) failed because the Docker daemon is not running on the LAVA worker. Error: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
  3. Possible fix: This is a LAVA infrastructure issue on the worker node. Start the Docker daemon on the LAVA worker hosting this job, or if Docker is intentionally disabled, update the LAVA job definition to remove the download-postprocess-docker action that requires the docker-mkbootimage container. Re-trigger the CI job after the infrastructure is fixed.
  4. Detail analysis attachment: failed_case_job307158_2_detailed.md
  Case 3: Build Load Failure — Docker daemon unavailable during deployment post-processing
  1. Failed case: Build Load Failure — Docker daemon unavailable during deployment post-processing
  2. Root cause: Result: Build Load Failure. The LAVA dispatcher attempted to run docker pull ghcr.io/mwasilew/docker-mkbootimage:master during the download-postprocess-docker stage (1.4) but failed with "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" The Docker daemon is not running or not accessible on the LAVA worker executing job 307158, preventing image post-processing required before device deployment.
  3. Possible fix: Start the Docker daemon on the LAVA worker (dispatcher) executing this job: sudo systemctl start docker && sudo systemctl enable docker. If the daemon is running but the LAVA dispatcher user lacks permissions, add the dispatcher user to the docker group: sudo usermod -aG docker lava. If the issue persists across multiple workers, check the LAVA infrastructure configuration to ensure Docker is installed and enabled on all workers that handle jobs requiring download-postprocess-docker actions.
  4. Detail analysis attachment: failed_case_job307158_3_detailed.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sgaud-quic

Copy link
Copy Markdown
Contributor

Validated bootup on Nord in lava-foundries : https://lava.infra.foundries.io/scheduler/job/658715

@sgaud-quic
Salendarsingh Gaud (sgaud-quic) merged commit d224594 into qualcomm-linux:qcom-7.3-es Dec 3, 2026
6 of 9 checks passed
@qcomlnxci

Copy link
Copy Markdown

Test results

Workflow run: 46945366891 attempt 2

Known failures configured: 0

Target Pass Non-pass Total
kbdev-nord-rrd-multimedia

Test Matrix

Test Case kbdev-nord-rrd-multimedia
LAVA result ✅ Results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants