From: Cosmin Tanislav <demonsingur@gmail.com>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
"Hans Verkuil" <hverkuil@xs4all.nl>,
"Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
"Cosmin Tanislav" <demonsingur@gmail.com>,
"Paweł Anikiel" <panikiel@google.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] media: v4l: subdev: Use dev_err() to print errors and clarify
Date: Fri, 22 Nov 2024 17:33:39 +0200 [thread overview]
Message-ID: <20241122153343.237308-1-demonsingur@gmail.com> (raw)
The error values end up being returned to userspace, it makes sense to
have some useful information printed when debugging them, even if the
reason for the errors are bad configs or internal driver issues.
Replace dev_dbg() with dev_err() for errors.
Also, when using complex pipelines with multiple bridges between the
video device and multiple source sub devices, printing just the video
device name for each error does not provide enough context as to which
operation failed.
Add sub device entity name to the messages where possible to clarify the
source of the errors.
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
drivers/media/v4l2-core/v4l2-subdev.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 4f0eecd7fd66f..d51b4594d11c5 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -2303,20 +2303,21 @@ int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad,
&found_streams, &enabled_streams);
if (found_streams != streams_mask) {
- dev_dbg(dev, "streams 0x%llx not found on %s:%u\n",
+ dev_err(dev, "streams 0x%llx not found on %s:%u\n",
streams_mask & ~found_streams, sd->entity.name, pad);
ret = -EINVAL;
goto done;
}
if (enabled_streams) {
- dev_dbg(dev, "streams 0x%llx already enabled on %s:%u\n",
+ dev_err(dev, "streams 0x%llx already enabled on %s:%u\n",
enabled_streams, sd->entity.name, pad);
ret = -EALREADY;
goto done;
}
- dev_dbg(dev, "enable streams %u:%#llx\n", pad, streams_mask);
+ dev_dbg(dev, "enable streams %s:%u:%#llx\n",
+ sd->entity.name, pad, streams_mask);
already_streaming = v4l2_subdev_is_streaming(sd);
@@ -2333,8 +2334,8 @@ int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad,
}
if (ret) {
- dev_dbg(dev, "enable streams %u:%#llx failed: %d\n", pad,
- streams_mask, ret);
+ dev_err(dev, "enable streams %s:%u:%#llx failed: %d\n",
+ sd->entity.name, pad, streams_mask, ret);
goto done;
}
@@ -2403,20 +2404,21 @@ int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad,
&found_streams, &enabled_streams);
if (found_streams != streams_mask) {
- dev_dbg(dev, "streams 0x%llx not found on %s:%u\n",
+ dev_err(dev, "streams 0x%llx not found on %s:%u\n",
streams_mask & ~found_streams, sd->entity.name, pad);
ret = -EINVAL;
goto done;
}
if (enabled_streams != streams_mask) {
- dev_dbg(dev, "streams 0x%llx already disabled on %s:%u\n",
+ dev_err(dev, "streams 0x%llx already disabled on %s:%u\n",
streams_mask & ~enabled_streams, sd->entity.name, pad);
ret = -EALREADY;
goto done;
}
- dev_dbg(dev, "disable streams %u:%#llx\n", pad, streams_mask);
+ dev_dbg(dev, "disable streams %s:%u:%#llx\n",
+ sd->entity.name, pad, streams_mask);
if (!use_s_stream) {
/* Call the .disable_streams() operation. */
@@ -2432,8 +2434,8 @@ int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad,
}
if (ret) {
- dev_dbg(dev, "disable streams %u:%#llx failed: %d\n", pad,
- streams_mask, ret);
+ dev_err(dev, "disable streams %s:%u:%#llx failed: %d\n",
+ sd->entity.name, pad, streams_mask, ret);
goto done;
}
--
2.47.0
next reply other threads:[~2024-11-22 15:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 15:33 Cosmin Tanislav [this message]
2024-11-23 21:32 ` [PATCH] media: v4l: subdev: Use dev_err() to print errors and clarify Laurent Pinchart
2024-11-25 20:34 ` Cosmin Tanislav
2024-11-27 7:20 ` Laurent Pinchart
2024-12-13 8:33 ` Sakari Ailus
2024-12-13 9:34 ` Laurent Pinchart
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=20241122153343.237308-1-demonsingur@gmail.com \
--to=demonsingur@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=panikiel@google.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen@ideasonboard.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