Skip to content

FROMLIST: iommu/arm-smmu: Use pm_runtime in fault handlers#425

Open
bibekpatro wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
bibekpatro:qcom-6.18.y
Open

FROMLIST: iommu/arm-smmu: Use pm_runtime in fault handlers#425
bibekpatro wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
bibekpatro:qcom-6.18.y

Conversation

@bibekpatro
Copy link
Copy Markdown

Commit d4a44f0 ("iommu/arm-smmu: Invoke pm_runtime across the driver") enabled pm_runtime for the arm-smmu device. On systems where the SMMU sits in a power domain, all register accesses must be done while the device is runtime active to avoid unclocked register reads and potential NoC errors.

So far, this has not been an issue for most SMMU clients because stall-on-fault is enabled by default. While a translation fault is being handled, the SMMU stalls further translations for that context bank, so the fault handler would not race with a powered-down SMMU.

Adreno SMMU now disables stall-on-fault in the presence of fault storms to avoid saturating SMMU resources and hanging the GMU. With stall-on-fault disabled, the SMMU can generate faults while its power domain may no longer be enabled, which makes unclocked accesses to fault-status registers in the SMMU fault handlers possible.

Guard the context and global fault handlers with pm_runtime_get_if_active() and pm_runtime_put_autosuspend() so that all SMMU fault register accesses are done with the SMMU powered. In case pm_runtime is not active we can safely ignore the fault as for pm runtime resume the smmu device is reset and fault registers are cleared.

Fixes: b130440 ("drm/msm: Temporarily disable stall-on-fault after a page fault")
Co-developed-by: Pratyush Brahma pratyush.brahma@oss.qualcomm.com

Link: https://lore.kernel.org/all/20260313-smmu-rpm-v2-1-8c2236b402b0@oss.qualcomm.com/
CRs-Fixed: 4063977

Commit d4a44f0 ("iommu/arm-smmu: Invoke pm_runtime across the driver")
enabled pm_runtime for the arm-smmu device. On systems where the SMMU
sits in a power domain, all register accesses must be done while the
device is runtime active to avoid unclocked register reads and
potential NoC errors.

So far, this has not been an issue for most SMMU clients because
stall-on-fault is enabled by default. While a translation fault is
being handled, the SMMU stalls further translations for that context
bank, so the fault handler would not race with a powered-down
SMMU.

Adreno SMMU now disables stall-on-fault in the presence of fault
storms to avoid saturating SMMU resources and hanging the GMU. With
stall-on-fault disabled, the SMMU can generate faults while its power
domain may no longer be enabled, which makes unclocked accesses to
fault-status registers in the SMMU fault handlers possible.

Guard the context and global fault handlers with pm_runtime_get_if_active()
and pm_runtime_put_autosuspend() so that all SMMU fault register accesses
are done with the SMMU powered. In case pm_runtime is not active we can
safely ignore the fault as for pm runtime resume the smmu device is
reset and fault registers are cleared.

Fixes: b130440 ("drm/msm: Temporarily disable stall-on-fault after a page fault")
Co-developed-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
Signed-off-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
Signed-off-by: Prakash Gupta <prakash.gupta@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260313-smmu-rpm-v2-1-8c2236b402b0@oss.qualcomm.com/
@bibekpatro bibekpatro requested a review from a team April 6, 2026 13:18
@qcomlnxci
Copy link
Copy Markdown

Test Matrix

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

@qcomlnxci
Copy link
Copy Markdown

Test Matrix

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

@qcomlnxci
Copy link
Copy Markdown

Test Matrix

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

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