From: Myeonghun Pak <mhun512@gmail.com>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, Ijae Kim <ae878000@gmail.com>
Subject: [PATCH v5 2/2] media: rcar-isp: distinguish absent cores from probe failures
Date: Mon, 9 Nov 2026 21:59:05 -0500 [thread overview]
Message-ID: <08f232218753608ed1a95744d6de14c70a3104b3.1794278853.git.mhun512@gmail.com> (raw)
In-Reply-To: <cover.1794278853.git.mhun512@gmail.com>
risp_probe() interprets -ENODEV as an absent optional core, but resource
setup also returns it for initialization failures and deferred probing.
Reserve -ENODEV for missing core MMIO or the renesas,vspx property.
Preserve clock/reset errors, defer until the referenced VSPX device
exists, and use -ENXIO for malformed VSPX data or failed RPPX1 creation.
Convert remaining resource -ENODEV errors to -ENXIO so the parent
rejects failed initialization instead of continuing with the channel
selector.
Fixes: 2151350f60d1 ("media: rcar-isp: Add support for ISPCORE")
Suggested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
Changes in v5:
- Regenerate for git send-email; no code changes from v4.
No hardware runtime testing.
drivers/media/platform/renesas/rcar-isp/core.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/renesas/rcar-isp/core.c b/drivers/media/platform/renesas/rcar-isp/core.c
index 14f3c8f3505..0a322014f3d 100644
--- a/drivers/media/platform/renesas/rcar-isp/core.c
+++ b/drivers/media/platform/renesas/rcar-isp/core.c
@@ -800,20 +800,20 @@ static int risp_core_probe_resources(struct rcar_isp_core *core,
core->clk = devm_clk_get(&pdev->dev, "core");
if (IS_ERR(core->clk))
- return -ENODEV;
+ return PTR_ERR(core->clk);
core->rstc = devm_reset_control_get(&pdev->dev, "core");
if (IS_ERR(core->rstc))
- return -ENODEV;
+ return PTR_ERR(core->rstc);
of_vspx = of_parse_phandle(pdev->dev.of_node, "renesas,vspx", 0);
if (!of_vspx)
- return -ENODEV;
+ return -ENXIO;
vspx = of_find_device_by_node(of_vspx);
of_node_put(of_vspx);
if (!vspx)
- return -ENODEV;
+ return -EPROBE_DEFER;
/* Attach to VSP-X */
core->vspx.dev = &vspx->dev;
@@ -840,7 +840,7 @@ static int risp_core_probe_resources(struct rcar_isp_core *core,
clk_disable_unprepare(core->clk);
if (!core->rpp) {
- ret = -ENODEV;
+ ret = -ENXIO;
goto err_put_vspx;
}
@@ -860,10 +860,15 @@ int risp_core_probe(struct rcar_isp_core *core, struct platform_device *pdev,
core->csrstc = csrstc;
core->csbase = csbase;
+ /* Keep channel-selector-only configurations working. */
+ if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "core") ||
+ !of_find_property(pdev->dev.of_node, "renesas,vspx", NULL))
+ return -ENODEV;
+
ret = risp_core_probe_resources(core, pdev);
if (ret) {
core->base = NULL;
- return ret;
+ return ret == -ENODEV ? -ENXIO : ret;
}
ret = v4l2_device_register(core->dev, &core->v4l2_dev);
prev parent reply other threads:[~2026-11-10 2:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 2:59 [PATCH v5 0/2] media: rcar-isp: fix core IRQ and probe error handling Myeonghun Pak
2026-11-10 2:59 ` [PATCH v5 1/2] media: rcar-isp: release the core IRQ before destroying RPPX1 Myeonghun Pak
2026-11-10 7:28 ` Niklas Söderlund
2026-11-10 2:59 ` Myeonghun Pak [this message]
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=08f232218753608ed1a95744d6de14c70a3104b3.1794278853.git.mhun512@gmail.com \
--to=mhun512@gmail.com \
--cc=ae878000@gmail.com \
--cc=geert+renesas@glider.be \
--cc=jacopo.mondi+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=sakari.ailus@linux.intel.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
all inboxes | Powered by JetHome®