Skip to content

FROMLIST: usb: typec: ucsi: ucsi_glink: Prevent suspend during UCSI notification handling#819

Open
raryan-qcom wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
raryan-qcom:for-ucsi-glink
Open

FROMLIST: usb: typec: ucsi: ucsi_glink: Prevent suspend during UCSI notification handling#819
raryan-qcom wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
raryan-qcom:for-ucsi-glink

Conversation

@raryan-qcom

@raryan-qcom raryan-qcom commented Jul 12, 2026

Copy link
Copy Markdown

When the system is suspended and a UCSI event arrives (such as USB plug-in), the GLINK interrupt (with IRQF_NO_SUSPEND flag) fires and it eventually calls the pmic_glink_ucsi_callback(), which schedules notify_work to handle the connector change. However, since no wakeup source is held, the system can re-enter suspend soon after the interrupt handler returns, before notify_work has completed running, and the USB plug-in event would not be handled.

There was an earlier attempt to address this at the GLINK driver level, by making the GLINK interrupt wakeup-capable, ("rpmsg: glink: Make glink smem interrupt wakeup capable") [1], but upstream reviewers suggested a different approach, preferring wakeup logic to be handled in the client driver.

To avoid losing UCSI notifications in this way, register ucsi_glink as a wakeup-capable device in the probe, and call pm_wakeup_ws_event() with hard=true before scheduling notify_work. The hard wakeup aborts any in-progress suspend, and the timed wakeup source keeps the system awake long enough for the notify_work call to run.

[1] https://lore.kernel.org/all/20240603073648.3475123-1-quic_deesin@quicinc.com/

Link: https://lore.kernel.org/all/20260710-ucsi_glink_wakeup-v1-1-7d97ea628d92@oss.qualcomm.com/

CRs-Fixed: 4429609

…otification handling

When the system is suspended and a UCSI event arrives (such as USB plug-in),
the GLINK interrupt (with IRQF_NO_SUSPEND flag) fires and it eventually calls
the pmic_glink_ucsi_callback(), which schedules notify_work to handle the
connector change. However, since no wakeup source is held, the system can
re-enter suspend soon after the interrupt handler returns, before notify_work
has completed running, and the USB plug-in event would not be handled.

There was an earlier attempt to address this at the GLINK driver level, by
making the GLINK interrupt wakeup-capable, ("rpmsg: glink: Make glink smem
interrupt wakeup capable") [1], but upstream reviewers suggested a
different approach, preferring wakeup logic to be handled in the client driver.

To avoid losing UCSI notifications in this way, register ucsi_glink
as a wakeup-capable device in the probe, and call pm_wakeup_ws_event()
with hard=true before scheduling notify_work. The hard wakeup aborts any
in-progress suspend, and the timed wakeup source keeps the system
awake long enough for the notify_work call to run.

[1] https://lore.kernel.org/all/20240603073648.3475123-1-quic_deesin@quicinc.com/

Link: https://lore.kernel.org/all/20260710-ucsi_glink_wakeup-v1-1-7d97ea628d92@oss.qualcomm.com/
Signed-off-by: Jishnu Prakash <jishnu.prakash@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.

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: CR Not Eligible for Merge

CR 4429609 is not eligible for merge.

The parent software image for kernel.qli.2.0 is not development complete.

Entity: kernel.qli.2.0
CR: 4429609
Reason: CR_CANNOT_MERGE

Please ensure the CR passes both CCT (ComponentChangeTasks) and ICT (Integration Change Tasks) validations.

@qlijarvis

Copy link
Copy Markdown

PR #819 — validate-patch

PR: #819

Verdict Issues Detailed Report
⚠️ 5 Full report

Final Summary

  1. Lore link present: Yes - https://lore.kernel.org/all/20260710-ucsi_glink_wakeup-v1-1-7d97ea628d92@oss.qualcomm.com/
  2. Lore link matches PR commits: Cannot verify - network restricted (lore.kernel.org unreachable)
  3. Upstream patch status: Cannot verify - network restricted; manual check recommended for Reviewed-by/Acked-by tags
  4. PR present in qcom-next: No - not found in qcom-next (expected for FROMLIST: commits pending upstream merge)
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #819 - FROMLIST: usb: typec: ucsi: ucsi_glink: Prevent suspend during UCSI notification handling
Upstream commit: https://lore.kernel.org/all/20260710-ucsi_glink_wakeup-v1-1-7d97ea628d92@oss.qualcomm.com/
Verdict: ⚠️ PARTIAL (network-restricted validation)

Commit Message

Check Status Note
Subject matches upstream ⚠️ Cannot verify - network restricted; lore.kernel.org unreachable
Body preserves rationale Well-structured: describes problem, root cause, prior attempts, and solution
Fixes tag present/correct N/A Not a bug fix; feature addition for wakeup handling
Authorship preserved FROMLIST: author Jishnu Prakash in From: and Signed-off-by: - correct per FROMLIST: rules
Backport note (if applicable) N/A Not a backport; FROMLIST: prefix indicates pending upstream patch

Diff

File Status Notes
drivers/usb/typec/ucsi/ucsi_glink.c:7 Added #include <linux/pm_wakeup.h> - required for pm_wakeup_ws_event()
drivers/usb/typec/ucsi/ucsi_glink.c:27 Added UCSI_GLINK_WAKEUP_TIMEOUT_MS macro (50ms) with clear comment
drivers/usb/typec/ucsi/ucsi_glink.c:349 Added pm_wakeup_ws_event() call in UC_UCSI_USBC_NOTIFY_IND case - implements wakeup logic
drivers/usb/typec/ucsi/ucsi_glink.c:406 Added device_init_wakeup(dev, true) in probe - enables wakeup capability

Issues

None detected in commit message structure or diff content. The patch follows kernel coding style:

  • Proper include ordering (alphabetical)
  • Multi-line comment style correct
  • Macro naming convention followed (uppercase with _MS suffix)
  • Function call formatting correct (split across lines for readability)
  • Placement of device_init_wakeup() before INIT_WORK() is logical

Verdict

Cannot fully validate due to network restrictions - lore.kernel.org is unreachable from this environment. Based on available information:

Commit message structure: Excellent - clear problem statement, references prior upstream discussion, explains solution rationale
FROMLIST: prefix usage: Correct - lore link present, authorship follows FROMLIST: rules
Diff content: Clean, focused changes implementing wakeup handling as described
⚠️ Upstream comparison: Cannot verify diff matches lore source exactly
⚠️ Upstream status: Cannot verify current community decision (ACKed/NACKed/Pending)
qcom-next presence: Not found (expected for FROMLIST: - patch not yet merged upstream)

Recommendation: Merge pending manual verification of lore source match. The commit message and diff structure are correct. A reviewer with network access should verify:

  1. The diff content matches the lore posting exactly
  2. The upstream patch status (check for Reviewed-by/Acked-by tags or maintainer feedback)

Final Summary

  1. Lore link present: Yes - https://lore.kernel.org/all/20260710-ucsi_glink_wakeup-v1-1-7d97ea628d92@oss.qualcomm.com/
  2. Lore link matches PR commits: Cannot verify - network restricted (lore.kernel.org unreachable)
  3. Upstream patch status: Cannot verify - network restricted; manual check recommended for Reviewed-by/Acked-by tags
  4. PR present in qcom-next: No - not found in qcom-next (expected for FROMLIST: commits pending upstream merge)

@qlijarvis

Copy link
Copy Markdown

PR #819 — checker-log-analyzer

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

Checker Result Summary
Checker Result Summary
checkpatch 1 warning: commit body line exceeds 75 chars
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No DTS changes
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance Passed
tag-check Subject has valid FROMLIST: prefix

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #819 - FROMLIST: usb: typec: ucsi: ucsi_glink: Prevent suspend during UCSI notification handling
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/29188741107
Target branch: qcom-6.18.y

Checker Result Summary
checkpatch 1 warning: commit body line exceeds 75 chars
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No DTS changes
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance Passed
tag-check Subject has valid FROMLIST: prefix

❌ checkpatch

Root cause: Commit body line #7 exceeds the recommended 75-character limit for commit message body text.

Failure details:

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#7: 
When the system is suspended and a UCSI event arrives (such as USB plug-in),

22852746e0b49927212a74cd6929b60af87617a6 total: 0 errors, 1 warnings, 0 checks, 35 lines checked

The commit message body contains a line that is 80 characters long:

When the system is suspended and a UCSI event arrives (such as USB plug-in),

Fix: Wrap the commit body text to stay within 75 characters per line:

git rebase -i e8d06c707464   # mark commit 22852746e0b4 as 'edit'
git commit --amend           # edit the commit message, wrap line #7
git rebase --continue

Suggested rewrap:

When the system is suspended and a UCSI event arrives (such as USB
plug-in), the GLINK interrupt (with IRQF_NO_SUSPEND flag) fires...

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git e8d06c707464..22852746e0b4

Verdict

1 minor style issue to fix before merge.

The COMMIT_LOG_LONG_LINE warning is a style issue that should be addressed to maintain kernel coding standards. All other checkers passed cleanly. The commit has the correct FROMLIST: prefix and includes a valid upstream Link: tag, so it meets patch compliance requirements.

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.

3 participants