[PATCH v2 3/6] media: verisilicon: Enable the Rockchip encoder interrupt again after a reset
Arun Iyengar via B4 Relay
devnull+aiyengar1990.gmail.com at kernel.org
Thu Nov 12 00:30:49 PST 2026
From: Arun Iyengar <aiyengar1990 at gmail.com>
The reset operations of the Rockchip VEPU1 and VEPU2 encoders, which
hantro_watchdog() calls when a job times out, disable the encoder
interrupt before stopping the encoder. Nothing enables it again: the
encoder run functions don't write the interrupt register, only the
interrupt handler does, and it no longer runs. Every later job on the
encoder then times out as well.
Clear the interrupt register at the end of the reset, as the interrupt
handler does after each frame.
Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver")
Cc: stable at vger.kernel.org
Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
---
drivers/media/platform/verisilicon/rockchip_vpu_hw.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
index 02673be9878e..5d4e46bd9cd6 100644
--- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
+++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
@@ -475,6 +475,12 @@ static void rockchip_vpu1_enc_reset(struct hantro_ctx *ctx)
vepu_write(vpu, H1_REG_INTERRUPT_DIS_BIT, H1_REG_INTERRUPT);
vepu_write(vpu, 0, H1_REG_ENC_CTRL);
vepu_write(vpu, 0, H1_REG_AXI_CTRL);
+ /*
+ * The encoder runs don't write the interrupt register, only the
+ * interrupt handler clears it after each frame. Clear it here too,
+ * or the interrupt stays disabled and all later jobs time out.
+ */
+ vepu_write(vpu, 0, H1_REG_INTERRUPT);
}
static void rockchip_vpu2_dec_reset(struct hantro_ctx *ctx)
@@ -493,6 +499,12 @@ static void rockchip_vpu2_enc_reset(struct hantro_ctx *ctx)
vepu_write(vpu, VEPU_REG_INTERRUPT_DIS_BIT, VEPU_REG_INTERRUPT);
vepu_write(vpu, 0, VEPU_REG_ENCODE_START);
vepu_write(vpu, 0, VEPU_REG_AXI_CTRL);
+ /*
+ * The encoder runs don't write the interrupt register, only the
+ * interrupt handler clears it after each frame. Clear it here too,
+ * or the interrupt stays disabled and all later jobs time out.
+ */
+ vepu_write(vpu, 0, VEPU_REG_INTERRUPT);
}
/*
--
2.55.0
More information about the Linux-rockchip
mailing list