All of lore.kernel.org
 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 v3 2/3] media: rockchip: Add IEP2 deinterlacer driver
Date: Fri, 20 Nov 2026 11:45:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-225094@kernel.org> (raw)
In-Reply-To: <20261120-iep2-v3-2-e94eb9f629d2@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] media: rockchip: iep2: unhandled empty_domain alloc failure
  in iep_probe()
--

commit 412e46dad64f85e912b35379802af12bdb8fee8c
Author: Arun Iyengar <aiyengar1990@gmail.com>

media: rockchip: Add IEP2 deinterlacer driver

This commit adds a V4L2 mem2mem driver for the Rockchip IEP2 deinterlacer
on the RK3568 and RK3588 SoCs.

> diff --git a/drivers/media/platform/rockchip/iep2/iep2.c b/drivers/media/platform/rockchip/iep2/iep2.c
> new file mode 100644
> index 0000000000000..11b349dda7196
> --- /dev/null
> +++ b/drivers/media/platform/rockchip/iep2/iep2.c
> @@ -0,0 +1,1320 @@

[ ... ]

> +static int iep_iommu_restore(struct iep_dev *iep)
> +{
> +	int ret;
> +
> +	if (!iep->empty_domain)
> +		return 0;
> +
> +	/* A reset leaves the IOMMU in bypass; reattaching reprograms it */
> +	ret = iommu_attach_device(iep->empty_domain, iep->dev);
> +	if (!ret)
> +		iommu_detach_device(iep->empty_domain, iep->dev);
> +
> +	return ret;
> +}
> +
> +static void iep_reset(struct iep_dev *iep)
> +{
> +	u32 status;
> +	int ret;

[ ... ]

> +	ret = iep_iommu_restore(iep);
> +	enable_irq(iep->irq);
> +	if (ret)
> +		dev_err_ratelimited(iep->dev, "reset failed: %d\n", ret);
> +	iep->iommu_lost = ret;
> +}

[ ... ]

> +	if (iommu_get_domain_for_dev(dev)) {
> +		iep->empty_domain = iommu_paging_domain_alloc(dev);
> +		if (IS_ERR(iep->empty_domain)) {
> +			dev_warn(dev, "cannot allocate empty IOMMU domain\n");
> +			iep->empty_domain = NULL;
> +		}
> +	}

[Severity: Medium]
Should iep_probe() fail when iommu_paging_domain_alloc() returns an error?

Setting iep->empty_domain to NULL causes iep_iommu_restore() to return 0
after a hardware reset even though an IOMMU is attached and left in bypass
mode.  iep_reset() then clears iep->iommu_lost, skipping the synchronous
runtime PM suspend in iep_pm_put() and the iep->iommu_lost check in
iep_device_run(), so later jobs run DMA with IOVA addresses while the
IOMMU is in bypass.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-iep2-v3-0-e94eb9f629d2@gmail.com?part=2

  reply	other threads:[~2026-11-20 11:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 11:30 [PATCH v3 0/3] media: rockchip: Add the IEP2 deinterlacer of RK3568/RK3588 Arun Iyengar via B4 Relay
2026-11-20 11:30 ` Arun Iyengar via B4 Relay
2026-11-20 11:30 ` Arun Iyengar
2026-11-20 11:30 ` [PATCH v3 1/3] media: dt-bindings: Add Rockchip IEP2 deinterlacer Arun Iyengar
2026-11-20 11:30   ` Arun Iyengar via B4 Relay
2026-11-20 11:30   ` Arun Iyengar via B4 Relay
2026-11-20 11:30 ` [PATCH v3 2/3] media: rockchip: Add IEP2 deinterlacer driver Arun Iyengar
2026-11-20 11:30   ` Arun Iyengar via B4 Relay
2026-11-20 11:30   ` Arun Iyengar via B4 Relay
2026-11-20 11:45   ` sashiko-bot [this message]
2026-11-20 11:30 ` [PATCH v3 3/3] arm64: dts: rockchip: Add IEP2 deinterlacer to RK3588 Arun Iyengar
2026-11-20 11:30   ` Arun Iyengar via B4 Relay
2026-11-20 11:30   ` 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-225094@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.