Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vikash Garodia" <vikash.garodia@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH v6 04/12] media: iris: Add non-pixel and pixel context bank devices
Date: Tue, 03 Nov 2026 16:05:33 +0000	[thread overview]
Message-ID: <sashiko-outbox-195695@kernel.org> (raw)
In-Reply-To: <20261103-vpu_iommu_iova_handling-v6-4-e4b6ad864f8f@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] media: iris: leaked IOVA reservation in iris_probe() on cb_dev init error
--

commit 67ee85a9fa8ce0ee52eff0dcecaffb30a10495d5
Author: Vikash Garodia <vikash.garodia@oss.qualcomm.com>

media: iris: Add non-pixel and pixel context bank devices

This commit adds helper functions to create and clean up separate non-pixel
and pixel context bank platform devices from device tree subnodes during
iris_probe() and teardown.

> diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
> index 25876957381b9..e659461716ba4 100644
> --- a/drivers/media/platform/qcom/iris/iris_probe.c
> +++ b/drivers/media/platform/qcom/iris/iris_probe.c

[ ... ]

> @@ -351,6 +413,10 @@ static int iris_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto err_put_core;
>  
> +	ret = iris_init_cb_devs(core);
> +	if (ret)
> +		goto err_put_core;

[Severity: Medium]
In drivers/media/platform/qcom/iris/iris_probe.c, iris_probe() calls
iris_reserve_iova_region() right before iris_init_cb_devs(core):

	ret = iris_reserve_iova_region(dev, &core->iova_state, IRIS_NP_RESERVE_IOVA_START,
				       IRIS_NP_RESERVE_IOVA_SIZE);
	if (ret)
		goto err_put_core;

	ret = iris_init_cb_devs(core);
	if (ret)
		goto err_put_core;

	ret = v4l2_device_register(dev, &core->v4l2_dev);
	if (ret)
		goto err_unresv_iova_region;

	...

err_unresv_iova_region:
	iris_unreserve_iova_region(dev, core->iova_state);
err_put_core:
	v4l2_device_put(&core->v4l2_dev);

If iris_init_cb_devs() fails (for example, if platform_device_register_full()
returns an error in iris_create_cb_dev()), jumping to err_put_core skips
iris_unreserve_iova_region(dev, core->iova_state).

Does this leak the IOVA reservation in the parent device's IOMMU domain, and
should the error path jump to err_unresv_iova_region instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-vpu_iommu_iova_handling-v6-0-e4b6ad864f8f@oss.qualcomm.com?part=4

  reply	other threads:[~2026-11-03 16:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 15:40 [PATCH v6 00/12] media: iris: Migrate iommus to iris sub nodes Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 01/12] dt-bindings: media: qcom,venus: Add context bank subnodes to common schema Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 02/12] dt-bindings: media: qcom,sm8550-iris: Add context bank subnodes Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 03/12] dt-bindings: media: qcom,sm8750-iris: " Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 04/12] media: iris: Add non-pixel and pixel context bank devices Vikash Garodia
2026-11-03 16:05   ` sashiko-bot [this message]
2026-11-03 15:40 ` [PATCH v6 05/12] media: iris: Route buffers to the matching context bank device Vikash Garodia
2026-11-03 16:08   ` sashiko-bot
2026-11-03 15:40 ` [PATCH v6 06/12] media: iris: Skip DMA mask setup when the core device has no IOMMU Vikash Garodia
2026-11-03 16:08   ` sashiko-bot
2026-11-03 15:40 ` [PATCH v6 07/12] arm64: dts: qcom: hamoa: Add Iris context bank subnodes Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 08/12] arm64: dts: qcom: sm8550: " Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 09/12] arm64: dts: qcom: lemans: " Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 10/12] arm64: dts: qcom: monaco: " Vikash Garodia
2026-11-03 15:40 ` [PATCH v6 11/12] arm64: dts: qcom: sm8650: " Vikash Garodia
2026-11-03 16:21   ` sashiko-bot
2026-11-03 15:40 ` [PATCH v6 12/12] arm64: dts: qcom: sm8750: " Vikash Garodia
2026-11-03 16:18   ` sashiko-bot

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-195695@kernel.org \
    --to=sashiko-bot@kernel.org \
    --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 \
    --cc=vikash.garodia@oss.qualcomm.com \
    /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