dri-devel Archive on 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: [PATCHv2 01/13] gpu: drm: sti: call cec_notifier_phys_addr_invalidate if no EDID
Date: Tue, 03 Nov 2026 07:51:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-194750@kernel.org> (raw)
In-Reply-To: <5dd7ac527b4d3143fea73bf93c60b22a66d16d3d.1793691124.git.hverkuil+cisco@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/sti: sti_hdmi_connector_get_modes() sets CEC phys addr when !drm_edid
--

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

gpu: drm: sti: call cec_notifier_phys_addr_invalidate if no EDID

This commit replaces calls to cec_notifier_set_phys_addr() passing
CEC_PHYS_ADDR_INVALID with cec_notifier_phys_addr_invalidate() in the STI
HDMI driver so the CEC framework can distinguish between missing EDIDs and
EDIDs without a physical address.

> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 7ba9e0b7ba6c0..12e05505bbdef 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -790,7 +790,7 @@ static void sti_hdmi_disable(struct drm_bridge *bridge,
>  
>  	hdmi->enabled = false;
>  
> -	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
> +	cec_notifier_phys_addr_invalidate(hdmi->notifier);
>  }
>  
>  /*
> @@ -1068,7 +1068,7 @@ sti_hdmi_connector_detect(struct drm_connector *connector, bool force)
>  	}
>  
>  	DRM_DEBUG_DRIVER("hdmi cable disconnected\n");
> -	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
> +	cec_notifier_phys_addr_invalidate(hdmi->notifier);
>  	return connector_status_disconnected;
>  }

[Severity: Medium]
The commit message states: "If an EDID is present, then call
cec_notifier_set_phys_addr. If not, then call
cec_notifier_phys_addr_invalidate."

However, in drivers/gpu/drm/sti/sti_hdmi.c, sti_hdmi_connector_get_modes()
still calls cec_notifier_set_phys_addr() unconditionally before checking
whether drm_edid is NULL:

drivers/gpu/drm/sti/sti_hdmi.c:sti_hdmi_connector_get_modes() {
	...
	drm_edid = drm_edid_read(connector);

	drm_edid_connector_update(connector, drm_edid);

	cec_notifier_set_phys_addr(hdmi->notifier,
				   connector->display_info.source_physical_address);

	if (!drm_edid)
		goto fail;
	...
}

When drm_edid_read() returns NULL, drm_edid_connector_update(connector, NULL)
resets connector->display_info.source_physical_address to
CEC_PHYS_ADDR_INVALID, and sti_hdmi_connector_get_modes() then passes
CEC_PHYS_ADDR_INVALID to cec_notifier_set_phys_addr() (a pattern introduced
in commit f7945d9fa8b7 ("drm/sti/sti_hdmi: convert to struct drm_edid") to
invalidate the physical address on EDID read failure).

Should sti_hdmi_connector_get_modes() also check !drm_edid first and call
cec_notifier_phys_addr_invalidate(hdmi->notifier) on the failure path before
calling cec_notifier_set_phys_addr()?

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

  reply	other threads:[~2026-11-03  7:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  7:31 [PATCHv2 00/13] media/drm: cec: add EDID_PRESENT Hans Verkuil
2026-11-03  7:31 ` [PATCHv2 01/13] gpu: drm: sti: call cec_notifier_phys_addr_invalidate if no EDID Hans Verkuil
2026-11-03  7:51   ` sashiko-bot [this message]
2026-11-03  7:31 ` [PATCHv2 02/13] gpu: drm: exynos: " Hans Verkuil
2026-11-03  7:50   ` sashiko-bot
2026-11-03  7:31 ` [PATCHv2 03/13] gpu: drm: omapdrm: call cec_s_phys_addr only if EDID is present Hans Verkuil
2026-11-03 14:13   ` Tomi Valkeinen
2026-11-03  7:31 ` [PATCHv2 04/13] media: i2c: adv7511-v4l2: " Hans Verkuil
2026-11-03  7:31 ` [PATCHv2 05/13] media: cec: extron-da-hd-4k-plus: " Hans Verkuil
2026-11-03  7:31 ` [PATCHv2 06/13] media: cec: core: improve cec_notifier_phys_addr_invalidate Hans Verkuil
2026-11-03  7:31 ` [PATCHv2 07/13] media: uapi: cec.h: add CEC_CAP_HAS_EDID_PRESENT/CEC_LOG_ADDRS_FL_EDID_PRESENT Hans Verkuil
2026-11-03  7:49   ` sashiko-bot
2026-11-03  7:31 ` [PATCHv2 08/13] Documentation: media: document EDID_PRESENT cap and flag Hans Verkuil
2026-11-03  7:48   ` sashiko-bot
2026-11-03  7:32 ` [PATCHv2 09/13] media: cec: core: add support for EDID_PRESENT Hans Verkuil
2026-11-03  7:53   ` sashiko-bot
2026-11-03  7:32 ` [PATCHv2 10/13] media: uapi: cec.h: add CEC_EVENT_FL_STATE_EDID_PRESENT flag Hans Verkuil
2026-11-03  7:49   ` sashiko-bot
2026-11-03  7:32 ` [PATCHv2 11/13] Documentation: media: cec-ioc-dqevent.rst: document STATE_EDID_PRESENT flag Hans Verkuil
2026-11-03  7:32 ` [PATCHv2 12/13] media: cec: core: implement CEC_EVENT_FL_STATE_EDID_PRESENT Hans Verkuil
2026-11-03  7:48   ` sashiko-bot
2026-11-03  7:32 ` [PATCHv2 13/13] Documentation: media: document cec_phys_addr_invalidate Hans Verkuil
2026-11-04 10:01 ` [PATCHv2 00/13] media/drm: cec: add EDID_PRESENT 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-194750@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox