Skip to content

PENDING: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU#772

Open
quicmahap wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
quicmahap:pr-qcom-6-18-y-dp-shutdown-1782369933
Open

PENDING: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU#772
quicmahap wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
quicmahap:pr-qcom-6-18-y-dp-shutdown-1782369933

Conversation

@quicmahap

Copy link
Copy Markdown

isable HPD IRQ during shutdown to prevent crash

During system shutdown, the DP HPD interrupt can fire after the platform device has started tearing down and IOMMU translation has been disabled. The IRQ thread (msm_dp_display_irq_thread) processes the HPD event, and proceeds to access hardware registers. Because IOMMU translation is no longer active at that point, the register access causes a translation fault and a NOC decode error on the interconnect.

Fix this by disabling the IRQ at the interrupt controller before calling pm_runtime_disable() in a new .shutdown callback. synchronize_irq() is called between the two to ensure that any currently-executing instance of the IRQ thread has finished before we proceed.

After this sequence the IRQ line is masked, no new HPD events can be delivered, so no hardware access can race with the IOMMU teardown that follows.

CRs-Fixed: 4550131

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No Change Task Found

No associated change tasks found for CR 4550131 on any of the following entities:

Entities:

  • kernel.qli.2.0

CR: 4550131

Please ensure the CR has a change task associated with at least one of the entities for this branch.

… faults

During system shutdown, the DP HPD interrupt can fire after the
platform device has started tearing down and IOMMU translation has
been disabled. The IRQ thread (msm_dp_display_irq_thread) processes
the HPD event, and proceeds to access hardware registers.
Because IOMMU translation is no longer active at that point, the
register access causes a translation fault and a NOC decode error on
the interconnect.

Fix this by disabling the IRQ at the interrupt controller before
calling pm_runtime_disable() in a new .shutdown callback.
synchronize_irq() is called between the two to ensure that any
currently-executing instance of the IRQ thread has finished before
we proceed.

After this sequence the IRQ line is masked, no new HPD events can
be delivered, so no hardware access can race with the IOMMU teardown
that follows.

Signed-off-by: Jayant Shekhar <Jayant.Shekar@oss.qualcomm.com>
Signed-off-by: Mahadevan P <mahadevan.p@oss.qualcomm.com>
@quicmahap quicmahap force-pushed the pr-qcom-6-18-y-dp-shutdown-1782369933 branch from 28fe04e to 02ce804 Compare June 25, 2026 06:56
@qlijarvis

Copy link
Copy Markdown

PR #772 — validate-patch

PR: #772

Verdict Issues Detailed Report
⚠️ 5 Full report

Final Summary

  1. Lore link present: No — PENDING: prefix suggests patch not yet posted upstream; no lore link found in commit message
  2. Lore link matches PR commits: N/A — no lore link to compare against
  3. Upstream patch status: Not upstream — PENDING: prefix indicates work-in-progress; patch not found on lore.kernel.org (search attempted for drm/msm/dp shutdown fixes)
  4. PR present in qcom-next: Not checked — cannot verify without kernel tree access
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #772 - drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU faults
Upstream commit: N/A (PENDING: prefix indicates not yet upstream)
Verdict: ⚠️ PARTIAL

Commit Message

Check Status Note
Subject matches upstream N/A PENDING: prefix; not yet upstream
Body preserves rationale Clear problem description and fix explanation
Fixes tag present/correct Missing Fixes: tag for bug fix
Authorship preserved ⚠️ Two Signed-off-by tags; unclear if co-authored or backported
Backport note (if applicable) N/A Not a backport

Diff

File Status Notes
drivers/gpu/drm/msm/dp/dp_display.c Clean implementation; follows kernel patterns

Issues

Commit Message:

  • Missing Fixes: tag — This patch fixes a race condition during shutdown causing IOMMU faults. It should include a Fixes: tag referencing the commit that introduced the vulnerable code path (likely when HPD IRQ handling was added).
  • Authorship ambiguity — Two Signed-off-by tags (Jayant Shekhar, then Mahadevan P) without clear indication of co-authorship. If Jayant is the original author, the From: field should match. If Mahadevan is submitting on behalf of Jayant, a note explaining the relationship would clarify intent.
  • PENDING: prefix — Indicates work-in-progress. Before merging to a stable branch, this should be removed and the patch should either be upstreamed or converted to a QCLINUX: vendor prefix if it's Qualcomm-specific.

Technical correctness:

  • The fix is sound: disabling IRQ → synchronize_irq() → pm_runtime_disable() is the correct sequence to prevent race conditions.
  • The shutdown callback placement in the platform_driver struct is correct.

Verdict

Do not merge as-is. Add Fixes: tag, clarify authorship, and resolve PENDING: status (upstream or convert to vendor prefix).

Final Summary

  1. Lore link present: No — PENDING: prefix suggests patch not yet posted upstream; no lore link found in commit message
  2. Lore link matches PR commits: N/A — no lore link to compare against
  3. Upstream patch status: Not upstream — PENDING: prefix indicates work-in-progress; patch not found on lore.kernel.org (search attempted for drm/msm/dp shutdown fixes)
  4. PR present in qcom-next: Not checked — cannot verify without kernel tree access

@qlijarvis

Copy link
Copy Markdown

PR #772 — checker-log-analyzer

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

Checker Result Summary
Checker Result Summary
checkpatch No style issues detected
dt-binding-check ⏭️ Skipped - no devicetree binding changes
dtb-check ⏭️ Skipped - no devicetree changes
sparse-check No sparse warnings
check-uapi-headers No UAPI header changes
check-patch-compliance Subject prefix violation
tag-check N/A Not applicable for qcom-6.18.y branch
qcom-next-check N/A Not applicable for qcom-6.18.y branch

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #772 - PENDING: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU faults
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/28153080250

Checker Result Summary
checkpatch No style issues detected
dt-binding-check ⏭️ Skipped - no devicetree binding changes
dtb-check ⏭️ Skipped - no devicetree changes
sparse-check No sparse warnings
check-uapi-headers No UAPI header changes
check-patch-compliance Subject prefix violation
tag-check N/A Not applicable for qcom-6.18.y branch
qcom-next-check N/A Not applicable for qcom-6.18.y branch

❌ check-patch-compliance

Root cause: Commit subject starts with PENDING: prefix, which is not a recognized upstream or backport prefix.

Failure details:

Checking commit: PENDING: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU faults
Commit summary does not start with a required prefix

Fix: Replace the PENDING: prefix with one of the following required prefixes:

  1. If this is a new patch awaiting upstream submission:

    • Use FROMLIST: prefix (indicates patch is posted to a mailing list but not yet merged)
    • Example: FROMLIST: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU faults
  2. If this patch is already merged upstream:

    • Use UPSTREAM: prefix
    • Example: UPSTREAM: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU faults
  3. If this is a Qualcomm-specific patch not intended for upstream:

    • Use QCOM: prefix
    • Example: QCOM: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU faults
  4. If this is a backport from a stable kernel:

    • Use BACKPORT: prefix
    • Example: BACKPORT: drm/msm/dp: disable HPD IRQ during shutdown to prevent IOMMU faults

Reproduce locally:

cd /path/to/kernel
git log -1 --format=%s 02ce804404e7499f12b9a5caa6cd4d805068bcc5
# Check if subject starts with UPSTREAM:, FROMLIST:, BACKPORT:, or QCOM:

To fix the commit:

git rebase -i HEAD~1
# Change 'pick' to 'reword' for the commit
# Update the subject line to use the appropriate prefix

Verdict

1 blocker to fix: The commit subject must use a compliant prefix (UPSTREAM:, FROMLIST:, BACKPORT:, or QCOM:) instead of PENDING:. All other checkers passed successfully. Once the subject prefix is corrected, this PR will be ready to merge.

@qcomlnxci

Copy link
Copy Markdown

Test Matrix

Test Case lemans-evk monaco-evk qcs615-ride qcs6490-rb3gen2 qcs8300-ride qcs9100-ride-r3 x1e80100-crd
BT_FW_KMD_Service ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
BT_ON_OFF ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
BT_SCAN ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
CPUFreq_Validation ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
CPU_affinity ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
DSP_AudioPD ✅ Pass ✅ Pass ⚠️ skip ✅ Pass ✅ Pass ⚠️ skip ◻️
Ethernet ⚠️ skip ✅ Pass ⚠️ skip ⚠️ skip ⚠️ skip ⚠️ skip ◻️
Freq_Scaling ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
GIC ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
IPA ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
Interrupts ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
OpenCV ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
PCIe ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
Probe_Failure_Check ❌ Fail ❌ Fail ❌ Fail ❌ Fail ❌ Fail ❌ Fail ◻️
RMNET ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
UFS_Validation ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
USBHost ❌ Fail ❌ Fail ❌ Fail ❌ Fail ❌ Fail ❌ Fail ◻️
WiFi_Firmware_Driver ❌ Fail ❌ Fail ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
WiFi_OnOff ✅ Pass ❌ Fail ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
adsp_remoteproc ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ❌ Fail ◻️
cdsp_remoteproc ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ❌ Fail ◻️
gpdsp_remoteproc ✅ Pass ✅ Pass ⚠️ skip ⚠️ skip ✅ Pass ❌ Fail ◻️
hotplug ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
irq ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
kaslr ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
pinctrl ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
qcom_hwrng ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
remoteproc ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ❌ Fail ◻️
rngtest ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
shmbridge ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
smmu ❌ Fail ✅ Pass ❌ Fail ✅ Pass ✅ Pass ❌ Fail ◻️
watchdog ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️
wpss_remoteproc ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ✅ Pass ◻️

@quicmahap

Copy link
Copy Markdown
Author

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.

4 participants