Skip to contentSkip to conversation

media: qcom: iris: use disable_irq() during power-off

PATCH Superseded Hungyu Lin 4 participants 4 messages Jun 10 – Jun 30

Subsystems (4)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Hungyu Lin

author
#0 lore raw

PATCH v5 1/1 media: qcom: iris: use disable_irq() during power-off

The IRQ is registered as a threaded IRQ.

Using disable_irq_nosync() in iris_vpu_power_off() does not wait for an already queued threaded IRQ handler to complete before returning.

Replace it with disable_irq() so the power-off path waits for any in-flight threaded handler before returning.

---
v5:
- Drop the runtime PM check in the threaded IRQ handler.
- Use disable_irq() instead of disable_irq_nosync() in the power-off path, as suggested by Konrad Dybcio.

v4:
- Clarify the possible ordering between IRQ_WAKE_THREAD, runtime PM suspend, and the threaded IRQ handler.
- Describe the race condition motivating the runtime PM check.

v3:
- Remove the early enable_irq() from the PM-inactive early-return path.
- IRQ re-enablement is already handled by iris_vpu_power_on() after power-on.

v2:
- Use pm_runtime_get_if_active() instead of pm_runtime_get_if_in_use().
- Handle negative runtime PM return values correctly.
- Return IRQ_NONE when interrupt processing is skipped.

 drivers/media/platform/qcom/iris/iris_vpu_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/iris/iris_vpu_common.c +1 -1
index 69e6126dc4d9..538659284c7b 100644
@@ -236,7 +236,7 @@ void iris_vpu_power_off(struct iris_core *core)
 	iris_unset_icc_bw(core);
 
 	if (!iris_vpu_watchdog(core, core->intr_status))
-		disable_irq_nosync(core->irq);
+		disable_irq(core->irq);
 }
 
 int iris_vpu_power_on_controller(struct iris_core *core)
Signature · 1 line
2.34.1
Reviewed-by on v5 1/1
#1 lore raw
Quoted 9 lines · Hungyu Lin

The IRQ is registered as a threaded IRQ.

Using disable_irq_nosync() in iris_vpu_power_off() does not wait for an already queued threaded IRQ handler to complete before returning.

Replace it with disable_irq() so the power-off path waits for any in-flight threaded handler before returning.

Quoted 8 lines

---
v5:
- Drop the runtime PM check in the threaded IRQ handler.
- Use disable_irq() instead of disable_irq_nosync() in the power-off path, as suggested by Konrad Dybcio.

Signature · 2 lines
With best wishes
Dmitry
Reviewed-by on v5 1/1
#2 lore raw
In reply to Hungyu Lin
Quoted 6 lines · Hungyu Lin

The IRQ is registered as a threaded IRQ.

Using disable_irq_nosync() in iris_vpu_power_off() does not wait for an already queued threaded IRQ handler to complete before returning.

Quoted 6 lines

Replace it with disable_irq() so the power-off path waits for any in-flight threaded handler before returning.

---

Konrad

maintainer
#3 lore raw
In reply to Hungyu Lin
Quoted 5 lines · Hungyu Lin

The IRQ is registered as a threaded IRQ.

Using disable_irq_nosync() in iris_vpu_power_off() does not wait for an already queued threaded IRQ handler to complete before returning.

Which means what. Elaborate on the consequences of this statement.

Quoted 42 lines

Replace it with disable_irq() so the power-off path waits for any in-flight threaded handler before returning.

---
v5:
- Drop the runtime PM check in the threaded IRQ handler.
- Use disable_irq() instead of disable_irq_nosync() in the power-off path, as suggested by Konrad Dybcio.

v4:
- Clarify the possible ordering between IRQ_WAKE_THREAD, runtime PM suspend, and the threaded IRQ handler.
- Describe the race condition motivating the runtime PM check.

v3:
- Remove the early enable_irq() from the PM-inactive early-return path.
- IRQ re-enablement is already handled by iris_vpu_power_on() after power-on.

v2:
- Use pm_runtime_get_if_active() instead of pm_runtime_get_if_in_use().
- Handle negative runtime PM return values correctly.
- Return IRQ_NONE when interrupt processing is skipped.

  drivers/media/platform/qcom/iris/iris_vpu_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/iris/iris_vpu_common.c +1 -2
index 69e6126dc4d9..538659284c7b 100644
@@ -236,7 +236,7 @@ void iris_vpu_power_off(struct iris_core *core)
  	iris_unset_icc_bw(core);
 
  	if (!iris_vpu_watchdog(core, core->intr_status))
-		disable_irq_nosync(core->irq);
+		disable_irq(core->irq);
  }
 
  int iris_vpu_power_on_controller(struct iris_core *core)
--
Quoted 3 lines

2.34.1

You've described a bug so you need

- Fixes
- Cc: stable

---
bod