All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hans Verkuil" <hverkuil+cisco@kernel.org>
Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org
Subject: Re: [PATCHv3 12/13] media: cec: core: implement CEC_EVENT_FL_STATE_HPD_PRESENT
Date: Thu, 05 Nov 2026 07:39:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-198689@kernel.org> (raw)
In-Reply-To: <b57a1fc1bb55bd53c9cfc938b0129a6b8b832e90.1793863347.git.hverkuil+cisco@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] media: cec: undeclared and unpopulated HPD_PRESENT flags in cec-adap and cec-api
--

commit 7888dab6341569ef2e99296246cbc101a56dde4e
Author: Hans Verkuil <hverkuil+cisco@kernel.org>

media: cec: core: implement CEC_EVENT_FL_STATE_HPD_PRESENT

This commit updates cec_post_state_event() and cec_open() to set
CEC_EVENT_FL_STATE_HPD_PRESENT on state change events when
CEC_LOG_ADDRS_FL_HPD_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 ee8a200b9803f..1920377d6b6e0 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_HPD_PRESENT)
> +		ev.flags |= CEC_EVENT_FL_STATE_HPD_PRESENT;
>  	cec_queue_event(adap, &ev);
>  }
>  
> diff --git a/drivers/media/cec/core/cec-api.c b/drivers/media/cec/core/cec-api.c
> index a491d7fc8a71a..f938668065fcb 100644
> --- a/drivers/media/cec/core/cec-api.c
> +++ b/drivers/media/cec/core/cec-api.c
> @@ -559,10 +559,7 @@ static int cec_open(struct inode *inode, struct file *filp)
>  	 * Initial events that are automatically sent when the cec device is
>  	 * opened.
>  	 */
> -	struct cec_event ev = {
> -		.event = CEC_EVENT_STATE_CHANGE,
> -		.flags = CEC_EVENT_FL_INITIAL_STATE,
> -	};
> +	struct cec_event ev = {};
>  	unsigned int i;
>  	int err;
>  
> @@ -588,12 +585,17 @@ static int cec_open(struct inode *inode, struct file *filp)
>  	filp->private_data = fh;
>  
>  	/* Queue up initial state events */
> +	ev.event = CEC_EVENT_STATE_CHANGE;
>  	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;
> +	ev.flags = CEC_EVENT_FL_INITIAL_STATE;
> +	if (adap->log_addrs.flags & CEC_LOG_ADDRS_FL_HPD_PRESENT)
> +		ev.flags |= CEC_EVENT_FL_STATE_HPD_PRESENT;

[Severity: High]
Does this break the build when CONFIG_CEC_CORE is enabled?

Both cec_post_state_event() in drivers/media/cec/core/cec-adap.c and
cec_open() in drivers/media/cec/core/cec-api.c reference
CEC_LOG_ADDRS_FL_HPD_PRESENT and CEC_EVENT_FL_STATE_HPD_PRESENT, but neither
symbol is defined in include/uapi/linux/cec.h (or anywhere else in the tree):

include/uapi/linux/cec.h:
    #define CEC_EVENT_FL_INITIAL_STATE	(1 << 0)
    #define CEC_EVENT_FL_DROPPED_EVENTS	(1 << 1)

In addition, nothing in drivers/media/cec/ or any CEC driver sets
CEC_LOG_ADDRS_FL_HPD_PRESENT in adap->log_addrs.flags, and
cec_adap_s_log_addrs() in drivers/media/cec/core/cec-api.c masks out any other
flags before __cec_s_log_addrs() overwrites adap->log_addrs:

drivers/media/cec/core/cec-api.c:cec_adap_s_log_addrs() {
    ...
	log_addrs.flags &= CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK |
			   CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU |
			   CEC_LOG_ADDRS_FL_CDC_ONLY;
    ...
}

Were the header definitions and the code that populates
CEC_LOG_ADDRS_FL_HPD_PRESENT left out of this commit?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/b57a1fc1bb55bd53c9cfc938b0129a6b8b832e90.1793863347.git.hverkuil+cisco@kernel.org?part=1

  reply	other threads:[~2026-11-05  7:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  7:22 [PATCHv3 00/13] media/drm: cec: add HPD_PRESENT Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 01/13] gpu: drm: sti: call cec_notifier_phys_addr_invalidate if no HPD Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 02/13] gpu: drm: exynos: " Hans Verkuil
2026-11-05  7:28   ` Krzysztof Kozlowski
2026-11-05  7:22 ` [PATCHv3 03/13] gpu: drm: omapdrm: call cec_s_phys_addr only if HPD is present Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 04/13] media: i2c: adv7511-v4l2: call cec_s_phys_addr only if HPD is high Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 05/13] media: cec: extron-da-hd-4k-plus: " Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 06/13] media: cec: core: improve cec_notifier_phys_addr_invalidate Hans Verkuil
2026-11-05  7:43   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 07/13] media: uapi: cec.h: add CEC_CAP_HAS_HPD_PRESENT/CEC_LOG_ADDRS_FL_HPD_PRESENT Hans Verkuil
2026-11-05  7:34   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 08/13] Documentation: media: document HPD_PRESENT cap and flag Hans Verkuil
2026-11-05  7:34   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 09/13] media: cec: core: add support for HPD_PRESENT Hans Verkuil
2026-11-05  7:39   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 10/13] media: uapi: cec.h: add CEC_EVENT_FL_STATE_HPD_PRESENT flag Hans Verkuil
2026-11-05  7:35   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 11/13] Documentation: media: cec-ioc-dqevent.rst: document STATE_HPD_PRESENT flag Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 12/13] media: cec: core: implement CEC_EVENT_FL_STATE_HPD_PRESENT Hans Verkuil
2026-11-05  7:39   ` sashiko-bot [this message]
2026-11-05  7:22 ` [PATCHv3 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-198689@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.