Skip to content

drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown() - #898

Open
quicmahap wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
quicmahap:dpshutdown-v2
Open

drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()#898
quicmahap wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
quicmahap:dpshutdown-v2

Conversation

@quicmahap

@quicmahap quicmahap commented Aug 4, 2026

Copy link
Copy Markdown

drm_atomic_helper_shutdown() disables all CRTCs but leaves output polling and IRQ-driven hot-plug detection running. On reboot, a late DP hot-plug-detect (HPD) IRQ can fire after apps_smmu has already disabled translation for the display subsystem, causing the HPD thread to kick off a new modeset that drives DPU/DP hardware and DMA through a stale IOMMU mapping.

drm_atomic_helper_shutdown() disables all CRTCs first, but a pending HPD IRQ thread wakes up afterwards, reads the DPCD, and fires an unsolicited hotplug event that triggers a second atomic commit turning the display back on -- right as the IOMMU is disabling translation:

systemd-shutdown[1]: Rebooting.
msm_dpu: drm_atomic_commit: committing (shutdown disabling CRTCs)
arm-smmu 3da0000.iommu: disabling translation
msm_dpu: drm_dp_read_dpcd_caps (late HPD IRQ thread wakes up)
msm_dpu: drm_sysfs_connector_hotplug_event: DP-1 hotplug event
msm_dpu: drm_client_modeset_probe: DP-1 found preferred mode
msm_dpu: drm_atomic_commit: committing (unsolicited, re-enables display)
dpu_crtc_commit_kickoff: crtc94 first commit
arm-smmu 15200000.iommu: disabling translation

drm_kms_helper_poll_fini() tears down this: it stops the output poll worker and calls each connector's &drm_connector_helper_funcs.disable_hpd, which for HPD-capable bridges masks the interrupt in hardware.

Reported on Qualcomm platforms such as lemans-evk and monaco-evk during reboot stress testing.

Assisted-by: Claude:claude-sonnet-5
Link: https://lore.kernel.org/r/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com

CRs-Fixed: 4573119

@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.

@qlijarvis

Copy link
Copy Markdown

PR #898 — validate-patch

PR: #898

Verdict Issues Detailed Report
2 Full report

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/r/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com
  2. Lore link matches PR commits: No — lore patch modifies drivers/gpu/drm/msm/dp/dp_display.c (driver-specific), PR modifies drivers/gpu/drm/drm_atomic_helper.c (framework-level); completely different files and approaches
  3. Upstream patch status: ⏳ Decision Pending (alternative approach requested) — Maintainer Dmitry Baryshkov requested framework-level fix instead on 2026-07-22; the lore patch (driver-specific approach) is not accepted
  4. PR present in qcom-next/topics: Fail - 1/1 commit(s) are missing from both qcom-next and topics
Verdict: ❌ — click to expand

🔍 Patch Validation

PR: #898 - drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
Upstream commit: https://lore.kernel.org/r/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com
Verdict:FAIL

Commit Message

Check Status Note
Subject matches upstream PR: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown() vs Lore: drm/msm/dp: add .shutdown to mask HPD IRQ before system shutdown — completely different
Body preserves rationale ⚠️ Problem description preserved, but solution approach differs
Fixes tag present/correct No Fixes tag in either patch (new feature)
Authorship preserved From: Mahadevan P <mahadevan.p@oss.qualcomm.com> matches
Backport note (if applicable) N/A Not a backport

Diff

File Status Notes
drivers/gpu/drm/drm_atomic_helper.c PR changes this file — framework-level fix
drivers/gpu/drm/msm/dp/dp_display.c Lore changes this file — driver-specific fix

Issues

Critical: Wrong lore link — PR implements a different patch

The PR patch modifies drivers/gpu/drm/drm_atomic_helper.c (DRM core framework) to call drm_kms_helper_poll_fini() in drm_atomic_helper_shutdown().

The linked lore patch modifies drivers/gpu/drm/msm/dp/dp_display.c (MSM DP driver) to add a .shutdown callback that calls disable_irq() and synchronize_irq().

These are completely different patches solving the same problem with different approaches:

  • Lore patch: Driver-specific fix in MSM DP driver
  • PR patch: Framework-level fix in DRM atomic helper core

Context: The maintainer (Dmitry Baryshkov) responded to the lore patch on 2026-07-22 requesting a framework-level fix instead:

"I'd very much prefer if instead we fix the framework to stop polling and HPD notifications on shutdown."

The PR appears to implement this requested alternative approach, but still links to the original driver-level patch posting.

Required fix:

  1. Post the framework-level patch (current PR content) to the mailing list as a new patch series
  2. Update the PR's Link: tag to point to the new framework-level patch posting
  3. Optionally reference the original driver-level patch in the commit message as context: "This supersedes the driver-specific approach posted at "

Verdict

Do not merge. The PR implements a framework-level fix but links to a driver-specific patch that was posted upstream. The lore link does not match the PR content. The PR author must post the framework-level patch to the mailing list and update the Link tag before merging.

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/r/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com
  2. Lore link matches PR commits: No — lore patch modifies drivers/gpu/drm/msm/dp/dp_display.c (driver-specific), PR modifies drivers/gpu/drm/drm_atomic_helper.c (framework-level); completely different files and approaches
  3. Upstream patch status: ⏳ Decision Pending (alternative approach requested) — Maintainer Dmitry Baryshkov requested framework-level fix instead on 2026-07-22; the lore patch (driver-specific approach) is not accepted
  4. PR present in qcom-next/topics: No — 1/1 commit missing from both qcom-next and topics (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: 8d5dbc1b17adf8fe86a41adcda686785e73f5414
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/1 [PATCH] drm/atomic-helper: tear down HPD/polling in missing - no subject, patch-id, or full tree-content match found missing - no subject, patch-id, or full tree-content match found missing

Final Status

overall_status: FAIL
present_commits: 0/1
partial_commits: 0/1
missing_commits: 1/1
topics_checked_for_commits: 1/1
final_summary: PR present in qcom-next/topics: Fail - 1/1 commit(s) are missing from both qcom-next and topics

@qlijarvis

Copy link
Copy Markdown

PR #898 — checker-log-analyzer

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

Checker Result Summary
Checker Result Summary
checkpatch Passed
dt-binding-check ⏭️ Skipped (no DT binding changes)
dtb-check ⏭️ Skipped (no DTS changes)
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance Missing required subject prefix
tag-check Missing required subject prefix

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #898 - drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/30899188540
Target branch: qcom-6.18.y

Checker Result Summary
checkpatch Passed
dt-binding-check ⏭️ Skipped (no DT binding changes)
dtb-check ⏭️ Skipped (no DTS changes)
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance Missing required subject prefix
tag-check Missing required subject prefix

❌ check-patch-compliance

Root cause: Commit subject does not start with a required prefix tag.

Failure details:

Checking commit: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
Commit summary does not start with a required prefix

The commit subject is:

drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()

This lacks any of the required prefixes: FROMLIST:, FROMGIT:, UPSTREAM:, or BACKPORT:.

Fix:

Since the commit message includes Link: https://lore.kernel.org/r/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com, this patch was posted to the mailing list. The correct prefix is FROMLIST:.

git rebase -i 1bc9614caed6d787783330f1fbd09003ff6a9741
# mark commit e6534da3b987 as 'edit'
git commit --amend -m "FROMLIST: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()

drm_atomic_helper_shutdown() disables all CRTCs but leaves output
polling and IRQ-driven hot-plug detection running. On reboot, a late
DP hot-plug-detect (HPD) IRQ can fire after apps_smmu has already
disabled translation for the display subsystem, causing the HPD
thread to kick off a new modeset that drives DPU/DP hardware and DMA
through a stale IOMMU mapping.

[... rest of commit message unchanged ...]

Assisted-by: Claude:claude-sonnet-5
Link: https://lore.kernel.org/r/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com
Signed-off-by: Mahadevan P <mahadevan.p@oss.qualcomm.com>"

git rebase --continue

Reproduce locally:

cd /path/to/kernel
bash ../kernel-checkers/check-patch-compliance.sh \
  --kernel-src . \
  --base 1bc9614caed6d787783330f1fbd09003ff6a9741 \
  --head e6534da3b9871dd2d8b928d816199565b3e4be31

❌ tag-check

Root cause: Target branch qcom-6.18.y requires all commits to have a subject prefix tag.

Failure details:

The PR targets qcom-6.18.y, which is not qcom-next or qcom-next-staging. Therefore, every commit must start with one of these prefixes:

  • FROMLIST: — Patch posted to mailing list (lore.kernel.org)
  • FROMGIT: — Patch taken from a maintainer git tree
  • UPSTREAM: — Patch merged into Linus's mainline tree
  • BACKPORT: — Upstream patch backported with modifications
  • QCLINUX: — Vendor-only change with no upstream equivalent
  • PENDING: — Work-in-progress, not yet posted upstream
  • WORKAROUND: — Temporary fix not suitable for upstream

The commit subject:

drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()

does not start with any of these prefixes.

Fix:

Based on the Link: tag in the commit message pointing to lore.kernel.org, this patch was posted upstream. Add the FROMLIST: prefix:

git rebase -i 1bc9614caed6d787783330f1fbd09003ff6a9741
# mark commit as 'edit'
git commit --amend -m "FROMLIST: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()

[... rest of commit message unchanged ...]"
git rebase --continue

Reproduce locally:

# Verify the prefix is present
git log --oneline 1bc9614caed6..e6534da3b987
# Should show: "FROMLIST: drm/atomic-helper: tear down HPD/polling..."

Verdict

1 blocker must be fixed before merge:

The commit subject must be amended to include the FROMLIST: prefix. This is a single fix that resolves both the check-patch-compliance and tag-check failures.

All other checkers passed or were correctly skipped (no relevant file changes).

Recommended action:

  1. Amend the commit subject to: FROMLIST: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
  2. Force-push the updated commit
  3. Re-trigger CI to verify the fix

@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.

…er_shutdown()

drm_atomic_helper_shutdown() disables all CRTCs but leaves output
polling and IRQ-driven hot-plug detection running. On reboot, a late
DP hot-plug-detect (HPD) IRQ can fire after apps_smmu has already
disabled translation for the display subsystem, causing the HPD
thread to kick off a new modeset that drives DPU/DP hardware and DMA
through a stale IOMMU mapping.

drm_atomic_helper_shutdown() disables all CRTCs first, but a pending
HPD IRQ thread wakes up afterwards, reads the DPCD, and fires an
unsolicited hotplug event that triggers a second atomic commit
turning the display back on -- right as the IOMMU is disabling
translation:

  systemd-shutdown[1]: Rebooting.
  msm_dpu: drm_atomic_commit: committing (shutdown disabling CRTCs)
  arm-smmu 3da0000.iommu: disabling translation
  msm_dpu: drm_dp_read_dpcd_caps (late HPD IRQ thread wakes up)
  msm_dpu: drm_sysfs_connector_hotplug_event: DP-1 hotplug event
  msm_dpu: drm_client_modeset_probe: DP-1 found preferred mode
  msm_dpu: drm_atomic_commit: committing (unsolicited, re-enables display)
  dpu_crtc_commit_kickoff: crtc94 first commit
  arm-smmu 15200000.iommu: disabling translation

drm_kms_helper_poll_fini() tears down this: it stops the output poll
worker and calls each connector's &drm_connector_helper_funcs.disable_hpd,
which for HPD-capable bridges masks the interrupt in hardware.

Reported on Qualcomm platforms such as lemans-evk and monaco-evk
during reboot stress testing.

Assisted-by: Claude:claude-sonnet-5
Link: https://lore.kernel.org/all/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com/
Signed-off-by: Mahadevan P <mahadevan.p@oss.qualcomm.com>
@qlijarvis

Copy link
Copy Markdown

PR #898 — validate-patch

PR: #898

Verdict Issues Detailed Report
0 Full report

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com/
  2. Lore link matches PR commits: No — PR modifies drm_atomic_helper.c (framework-level fix), lore modifies dp_display.c (driver-specific fix); completely different files and approaches
  3. Upstream patch status: ⏳ Decision Pending — maintainer feedback suggests framework fix preferred, but the lore patch (driver-specific approach) has not been accepted or merged
  4. PR present in qcom-next/topics: Fail - 1/1 commit(s) are missing from both qcom-next and topics
Verdict: ❌ — click to expand

🔍 Patch Validation

PR: #898 - FROMLIST: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
Upstream commit: https://lore.kernel.org/all/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com/
Verdict: ❌ FAIL

Commit Message

Check Status Note
Subject matches upstream PR: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown() vs Lore: drm/msm/dp: add .shutdown to mask HPD IRQ before system shutdown — completely different
Body preserves rationale ⚠️ Core problem description preserved, but solution description differs significantly
Fixes tag present/correct No Fixes tag in either version (not a regression fix)
Authorship preserved Both use Mahadevan P <mahadevan.p@oss.qualcomm.com>
Backport note (if applicable) N/A Not a backport

Diff

File Status Notes
drivers/gpu/drm/drm_atomic_helper.c PR changes this file — adds drm_kms_helper_poll_fini() call to drm_atomic_helper_shutdown()
drivers/gpu/drm/msm/dp/dp_display.c Lore changes this file — adds .shutdown callback to msm_dp_display_driver

Issues

Critical mismatch: PR implements a completely different solution than the lore patch

  1. Different files modified:

    • Lore patch: Modifies drivers/gpu/drm/msm/dp/dp_display.c — adds a driver-specific .shutdown callback that calls disable_irq() and synchronize_irq() on the DP IRQ
    • PR patch: Modifies drivers/gpu/drm/drm_atomic_helper.c — adds a framework-level call to drm_kms_helper_poll_fini() in drm_atomic_helper_shutdown()
  2. Different technical approach:

    • Lore: Driver-specific solution — masks the DP HPD interrupt at the driver level before shutdown
    • PR: Framework-level solution — tears down polling and HPD for all DRM drivers at the atomic helper level
  3. Subject line mismatch:

    • Lore: drm/msm/dp: add .shutdown to mask HPD IRQ before system shutdown
    • PR: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
  4. Community feedback indicates the PR approach may be preferred:

    • Dmitry Baryshkov's reply (2026-07-22) to the lore patch states: "I'd very much prefer if instead we fix the framework to stop polling and HPD notifications on shutdown."
    • The PR appears to implement this framework-level fix, but it is not the same patch that was posted to lore
  5. Sashiko AI review identified issues with the lore approach:

    • The lore patch's disable_irq() approach may not fully close the race window
    • synchronize_irq() call is redundant (already done by disable_irq())
    • Pre-existing use-after-free risk in msm_dp_display_remove()

Upstream Patch Status

Commit Community Verdict
drm/msm/dp: add .shutdown to mask HPD IRQ before system shutdown ⏳ Decision Pending — Maintainer feedback (2026-07-22) suggests framework-level fix preferred; no acceptance or merge signal found

qcom-next/topics Presence

Commit Status
FROMLIST: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown() ⚠️ Not in qcom-next or topics — missing from both integration branches

Verdict

Do not merge. This PR does not match the lore patch it references. The lore patch implements a driver-specific .shutdown callback in drivers/gpu/drm/msm/dp/dp_display.c, while the PR implements a framework-level solution in drivers/gpu/drm/drm_atomic_helper.c.

While the PR's framework-level approach aligns with maintainer feedback (Dmitry Baryshkov's preference for a framework fix), this is effectively a different patch that should have been:

  1. Posted to the mailing list as a new patch (not linked to the original lore thread)
  2. Marked with a different subject line reflecting the framework-level change
  3. Potentially marked as RFC or noted as an alternative approach to the original patch

The FROMLIST: prefix is incorrect because the code in this PR was never posted to any mailing list.

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com/
  2. Lore link matches PR commits: No — PR modifies drm_atomic_helper.c (framework-level fix), lore modifies dp_display.c (driver-specific fix); completely different files and approaches
  3. Upstream patch status: ⏳ Decision Pending — maintainer feedback suggests framework fix preferred, but the lore patch (driver-specific approach) has not been accepted or merged
  4. PR present in qcom-next/topics: No — commit is missing from both qcom-next and topics branches

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: 8d5dbc1b17adf8fe86a41adcda686785e73f5414
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/1 [PATCH] FROMLIST: drm/atomic-helper: tear down HPD/polling in missing - no subject, patch-id, or full tree-content match found missing - no subject, patch-id, or full tree-content match found missing

Final Status

overall_status: FAIL
present_commits: 0/1
partial_commits: 0/1
missing_commits: 1/1
topics_checked_for_commits: 1/1
final_summary: PR present in qcom-next/topics: Fail - 1/1 commit(s) are missing from both qcom-next and topics

@qlijarvis

Copy link
Copy Markdown

PR #898 — checker-log-analyzer

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

Checker Result Summary
Checker Result Summary
checkpatch No style issues
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check No new sparse warnings
check-uapi-headers No UAPI changes
check-patch-compliance Content mismatch with upstream link
tag-check N/A Skipped (qcom-next branch)

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #898 - FROMLIST: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/30904291545
Target branch: qcom-next

Checker Result Summary
checkpatch No style issues
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check No new sparse warnings
check-uapi-headers No UAPI changes
check-patch-compliance Content mismatch with upstream link
tag-check N/A Skipped (qcom-next branch)

❌ check-patch-compliance

Root cause: The patch content in the PR differs from the upstream patch referenced in the Link: trailer.

Failure details:

Checking commit: FROMLIST: drm/atomic-helper: tear down HPD/polling in drm_atomic_helper_shutdown()
Change is different from the one mentioned in Link

Analysis:

The checker detected that the patch in PR #898 does not match the upstream patch at:

Link: https://lore.kernel.org/all/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com/

This can happen for several reasons:

  1. Context-only differences — the surrounding code differs between the upstream base and qcom-next, causing context line shifts (not a real issue)
  2. Legitimate adaptation — the patch was modified to fit the qcom-next tree (should be documented in commit message)
  3. Missing hunks — some changes from upstream were omitted
  4. Extra hunks — additional changes not present upstream were added

Fix:

  1. Fetch the upstream patch and compare:

    b4 am --single-message -C -l -3 https://lore.kernel.org/all/20260717-dpshutdown-v1-1-b062c2f7dfb1@oss.qualcomm.com/ -o /tmp/upstream
    
    # Compare the actual code changes (+ and - lines only)
    diff <(git format-patch -1 dbcc2af792aa --stdout | awk '/^diff/,/^--$/' | grep -E '^[+-][^+-]') \
         <(awk '/^diff/,/^--$/' /tmp/upstream/*.mbx | grep -E '^[+-][^+-]')
  2. Classify the difference:

    • If only context lines differ → acceptable, but consider adding a note in the commit message
    • If legitimate adaptation was needed → document it in the commit message with a note like:
      [ qcom-next: adapted for <reason> ]
      
    • If hunks are missing or extra → fix the patch to match upstream exactly, or split extra changes into a separate commit
  3. If the patch is intentionally different:

    • Change the prefix from FROMLIST: to BACKPORT: to indicate it's been modified
    • Add a note explaining the adaptation in the commit message

Reproduce locally:

cd /path/to/kernel
git fetch origin qcom-next
git checkout qcom-next
git fetch origin pull/898/head:pr-898
git checkout pr-898

# Run the checker
bash /path/to/kernel-checkers/check-patch-compliance.sh \
  --kernel-src . \
  --base origin/qcom-next \
  --head HEAD

Verdict

1 blocker to fix before merge: The patch content mismatch must be resolved. Either:

  • Ensure the patch matches upstream exactly (if it's just context differences, verify and document)
  • Change prefix to BACKPORT: and document the adaptation if intentional modifications were made
  • Split any extra changes into separate commits

All other checkers passed or were correctly skipped.

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.

2 participants