Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arun Iyengar" <aiyengar1990@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH 3/5] media: verisilicon: Reset the Rockchip encoder cores on timeout
Date: Tue, 10 Nov 2026 08:11:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-206571@kernel.org> (raw)
In-Reply-To: <20261110-hantro-robust-v1-3-6b6269c05bfa@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] media: verisilicon: uncleared IRQ disable bit in
  hantro_h1_jpeg_enc_run() [1]
--

commit 433d2270fcbefc689a4dc88d1c36fa283eb8f9a5
Author: Arun Iyengar <aiyengar1990@gmail.com>

media: verisilicon: Reset the Rockchip encoder cores on timeout

This commit pulses the optional hardware reset lines in the Rockchip
VEPU1 and VEPU2 reset callbacks to recover encoder cores that become
stuck on the bus after an IOMMU fault and job timeout.

> diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
> index 02673be9878e1..0dced75158334 100644
> --- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
> +++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c

[ ... ]

> @@ -468,6 +469,33 @@ static void rk3066_vpu_dec_reset(struct hantro_ctx *ctx)
>  	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
>  }
>  
> +/*
> + * Stopping the encoder through its registers isn't enough when it is stuck
> + * on the bus, for instance after a translation fault in its IOMMU: it keeps
> + * AXI transactions outstanding and never becomes idle, which also prevents
> + * the IOMMU from stalling. Pulse the reset lines of the core, if the device
> + * tree describes them, to return it to its idle state.
> + */
> +static void rockchip_vpu_enc_hw_reset(struct hantro_dev *vpu)
> +{
> +	int ret;
> +
> +	if (!vpu->resets)
> +		return;
> +
> +	ret = reset_control_assert(vpu->resets);
> +	if (ret) {
> +		dev_warn(vpu->dev, "Failed to assert resets: %d\n", ret);
> +		return;
> +	}
> +
> +	udelay(5);
> +
> +	ret = reset_control_deassert(vpu->resets);
> +	if (ret)
> +		dev_err(vpu->dev, "Failed to deassert resets: %d\n", ret);
> +}
> +
>  static void rockchip_vpu1_enc_reset(struct hantro_ctx *ctx)
>  {
>  	struct hantro_dev *vpu = ctx->dev;
> @@ -475,6 +503,7 @@ 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);
> +	rockchip_vpu_enc_hw_reset(vpu);
>  }

[Severity: Medium]
This problem wasn't introduced by this patch, but when vpu->resets is not
present in the device tree, does rockchip_vpu1_enc_reset() leave
H1_REG_INTERRUPT_DIS_BIT set in H1_REG_INTERRUPT [1] across later
runs?

hantro_h1_jpeg_enc_run() starts the encoder without writing to
H1_REG_INTERRUPT to clear H1_REG_INTERRUPT_DIS_BIT, so after a watchdog
reset all subsequent H1 JPEG encoding jobs have completion interrupts
disabled and time out as well.

[1] https://sashiko.dev/#/bug/linux-22957774-1c15-4f2d-87b4-d6b2e043ac2a

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110-hantro-robust-v1-0-6b6269c05bfa@gmail.com?part=3

  reply	other threads:[~2026-11-10  8:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  7:17 [PATCH 0/5] media: verisilicon: Recover the Rockchip VPUs from faults and timeouts Arun Iyengar via B4 Relay
2026-11-10  7:17 ` [PATCH 1/5] dt-bindings: media: rockchip,rk3568-vepu: Add the reset lines Arun Iyengar via B4 Relay
2026-11-10  7:17 ` [PATCH 2/5] media: verisilicon: Don't hold a VPU behind an IOMMU in reset after remove Arun Iyengar via B4 Relay
2026-11-10  7:50   ` sashiko-bot
2026-11-10  7:17 ` [PATCH 3/5] media: verisilicon: Reset the Rockchip encoder cores on timeout Arun Iyengar via B4 Relay
2026-11-10  8:11   ` sashiko-bot [this message]
2026-11-10  7:17 ` [PATCH 4/5] media: verisilicon: Reinitialize the IOMMU after a timeout Arun Iyengar via B4 Relay
2026-11-10  8:37   ` sashiko-bot
2026-11-10  7:17 ` [PATCH 5/5] arm64: dts: rockchip: Add the reset lines of the RK3588 VEPU121 cores Arun Iyengar via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-206571@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=aiyengar1990@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox