From: Robert Bozik <robertbozik@gmail.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
media-ci@linuxtv.org
Subject: Re: [PATCH v3 2/3] media: i2c: Add driver for OmniVision OV32C4
Date: Sat, 29 Aug 2026 15:01:57 +0200 [thread overview]
Message-ID: <20260829130157.5859-1-robertbozik@gmail.com> (raw)
In-Reply-To: <20260829121613.686D41F000E9@smtp.kernel.org>
On Sat, Aug 29, 2026, sashiko-bot@kernel.org wrote:
Hi,
Thank you for the review. All three findings are real. The first one
needs a different fix from the one the description implies, and I would
rather say why than fix it quietly.
> [High] Incorrect error handling of pm_runtime_get_if_active() leads to
> PM usage counter underflow.
Confirmed, but only for one of the two cases the negative return covers.
pm_runtime_get_if_active() returns -EINVAL when runtime PM is disabled
for the device and does not take a reference in that case, so the
unconditional pm_runtime_put() at the end of the function does underflow
the counter. That part is right.
Returning the error early would break the other case, though. With
CONFIG_PM=n the inline version in include/linux/pm_runtime.h returns
-EINVAL unconditionally, so an early return would make every control
write fail on a kernel without runtime PM - where the sensor is in fact
permanently powered and the writes are exactly what should happen. The
drivers in the tree that use this idiom (gc05a2, gc08a3, imx283 and
lm3560, twice) all let the negative value fall through for that reason.
v4 therefore keeps the fall-through and only drops a reference that was
actually taken:
/*
* A negative return means runtime PM is disabled for the device,
* in which case it is powered and the registers can be written,
* but no reference was taken and none may be dropped below.
*/
pm = pm_runtime_get_if_active(ov32c4->dev);
if (!pm)
return 0;
...
if (pm > 0)
pm_runtime_put(ov32c4->dev);
> [Medium] Missing colorspace and format field initializations in
> ov32c4_update_pad_format().
Right, thank you. The fields are left as userspace passed them and then
stored in the subdev state. gc05a2 and gc08a3 set all four, and v4 does
the same:
fmt->colorspace = V4L2_COLORSPACE_RAW;
fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace);
fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE;
fmt->xfer_func = V4L2_XFER_FUNC_NONE;
> [Low] Missing stubs for ACPI resource functions when CONFIG_ACPI is
> disabled causes build errors.
Right, and it is a consequence of a change made in v3.
acpi_dev_get_resources() and acpi_dev_free_resource_list() are declared
inside the CONFIG_ACPI section of include/linux/acpi.h and have no stubs
in the #else branch, so with "depends on ACPI || COMPILE_TEST" dropped
from Kconfig in v3 the driver no longer builds without ACPI. v4 puts the
_CRS walk behind #ifdef CONFIG_ACPI with a stub returning 0, which is
also more honest: that lookup only means anything on an ACPI platform.
All three are fixed in my tree and will be in v4, which is waiting for
the rest of the review of v3. Rebuilt and re-tested on the machine after
the changes: the sensor probes, streams and the controls still work.
Thanks,
Robert
next prev parent reply other threads:[~2026-08-29 13:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-29 11:58 [PATCH v3 0/3] media: Add OmniVision OV32C4 sensor driver Robert Bozik
2026-08-29 11:58 ` [PATCH v3 1/3] dt-bindings: media: i2c: Add OmniVision OV32C4 Robert Bozik
2026-08-29 11:58 ` [PATCH v3 2/3] media: i2c: Add driver for " Robert Bozik
2026-08-29 12:16 ` sashiko-bot
2026-08-29 13:01 ` Robert Bozik [this message]
2026-08-29 11:58 ` [PATCH v3 3/3] media: ipu-bridge: Add " Robert Bozik
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=20260829130157.5859-1-robertbozik@gmail.com \
--to=robertbozik@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=media-ci@linuxtv.org \
--cc=sakari.ailus@linux.intel.com \
--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.