From: sashiko-bot@kernel.org
To: "Hans Verkuil" <hverkuil+cisco@kernel.org>
Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org
Subject: Re: [PATCH 12/13] media: cec: core: implement CEC_EVENT_FL_STATE_EDID_PRESENT
Date: Mon, 02 Nov 2026 11:14:08 +0000 [thread overview]
Message-ID: <sashiko-outbox-193323@kernel.org> (raw)
In-Reply-To: <e5ad86f5e6a33e6b9c1b930a00c984f49eb316eb.1793615824.git.hverkuil+cisco@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] media: cec: missing CEC_EVENT_FL_STATE_EDID_PRESENT in cec_open()
--
commit 46a7f75b89b8be5b867c7e7aadb50668719e461a
Author: Hans Verkuil <hverkuil+cisco@kernel.org>
media: cec: core: implement CEC_EVENT_FL_STATE_EDID_PRESENT
This commit sets CEC_EVENT_FL_STATE_EDID_PRESENT on CEC_EVENT_STATE_CHANGE
events in cec_post_state_event() when CEC_LOG_ADDRS_FL_EDID_PRESENT is set
in adap->log_addrs.flags.
> diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c
> index 06a596a0ede3e..c0de5835fea01 100644
> --- a/drivers/media/cec/core/cec-adap.c
> +++ b/drivers/media/cec/core/cec-adap.c
> @@ -323,6 +323,8 @@ static void cec_post_state_event(struct cec_adapter *adap)
> ev.state_change.log_addr_mask = adap->log_addrs.log_addr_mask;
> ev.state_change.have_conn_info =
> adap->conn_info.type != CEC_CONNECTOR_TYPE_NO_CONNECTOR;
> + if (adap->log_addrs.flags & CEC_LOG_ADDRS_FL_EDID_PRESENT)
> + ev.flags |= CEC_EVENT_FL_STATE_EDID_PRESENT;
> cec_queue_event(adap, &ev);
> }
[Severity: Medium]
Should the initial CEC_EVENT_STATE_CHANGE event queued in cec_open() also
set CEC_EVENT_FL_STATE_EDID_PRESENT when an EDID is already present?
In drivers/media/cec/core/cec-api.c, cec_open() constructs the initial state
event directly:
drivers/media/cec/core/cec-api.c:cec_open() {
struct cec_event ev = {
.event = CEC_EVENT_STATE_CHANGE,
.flags = CEC_EVENT_FL_INITIAL_STATE,
};
...
/* Queue up initial state events */
ev.state_change.phys_addr = adap->phys_addr;
ev.state_change.log_addr_mask = adap->log_addrs.log_addr_mask;
ev.state_change.have_conn_info =
adap->conn_info.type != CEC_CONNECTOR_TYPE_NO_CONNECTOR;
cec_queue_event_fh(fh, &ev, 0);
}
When userspace opens a CEC device node while adap->log_addrs.flags has
CEC_LOG_ADDRS_FL_EDID_PRESENT set and dequeues the initial state event via
CEC_DQEVENT, ev.flags will be missing CEC_EVENT_FL_STATE_EDID_PRESENT.
Also note that under CONFIG_CEC_PIN, cec_open() reuses the same ev variable
to queue initial CEC_EVENT_PIN_HPD_HIGH/LOW and CEC_EVENT_PIN_5V_HIGH/LOW
events, so if CEC_EVENT_FL_STATE_EDID_PRESENT is set on ev.flags for the
initial state change event, it would need to be cleared before queueing the
pin events.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1793615824.git.hverkuil+cisco@kernel.org?part=12
next prev parent reply other threads:[~2026-11-02 11:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 10:36 [PATCH 00/13] media/drm: cec: add EDID_PRESENT Hans Verkuil
2026-11-02 10:36 ` [PATCH 01/13] gpu: drm: sti: call cec_notifier_phys_addr_invalidate if no EDID Hans Verkuil
2026-11-02 11:02 ` sashiko-bot
2026-11-02 10:36 ` [PATCH 02/13] gpu: drm: exynos: " Hans Verkuil
2026-11-02 11:03 ` sashiko-bot
2026-11-02 10:36 ` [PATCH 03/13] gpu: drm: omapdrm: call cec_s_phys_addr only if EDID is present Hans Verkuil
2026-11-02 11:28 ` Tomi Valkeinen
2026-11-02 10:36 ` [PATCH 04/13] media: i2c: adv7511-v4l2: " Hans Verkuil
2026-11-02 10:36 ` [PATCH 05/13] media: cec: extron-da-hd-4k-plus: " Hans Verkuil
2026-11-02 11:05 ` sashiko-bot
2026-11-02 10:36 ` [PATCH 06/13] media: cec: core: improve cec_notifier_phys_addr_invalidate Hans Verkuil
2026-11-02 11:04 ` sashiko-bot
2026-11-02 10:36 ` [PATCH 07/13] media: uapi: cec.h: add CEC_CAP_HAS_EDID_PRESENT/CEC_LOG_ADDRS_FL_EDID_PRESENT Hans Verkuil
2026-11-02 10:36 ` [PATCH 08/13] Documentation: media: document EDID_PRESENT cap and flag Hans Verkuil
2026-11-02 10:37 ` [PATCH 09/13] media: cec: core: add support for EDID_PRESENT Hans Verkuil
2026-11-02 11:13 ` sashiko-bot
2026-11-02 10:37 ` [PATCH 10/13] media: uapi: cec.h: add CEC_EVENT_FL_STATE_EDID_PRESENT flag Hans Verkuil
2026-11-02 10:37 ` [PATCH 11/13] Documentation: media: cec-ioc-dqevent.rst: document STATE_EDID_PRESENT flag Hans Verkuil
2026-11-02 10:37 ` [PATCH 12/13] media: cec: core: implement CEC_EVENT_FL_STATE_EDID_PRESENT Hans Verkuil
2026-11-02 11:14 ` sashiko-bot [this message]
2026-11-02 10:37 ` [PATCH 13/13] Documentation: media: document cec_phys_addr_invalidate Hans Verkuil
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-193323@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hverkuil+cisco@kernel.org \
--cc=media-ci@linuxtv.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.