Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 3/5] drm/connector: Propagate content type property creation errors
       [not found] ` <20261126081602.2901498-4-a.kazinsky@ideco.ru>
@ 2026-11-26 15:46   ` Albert Esteve
  2026-11-27  8:38   ` sashiko-bot
  1 sibling, 0 replies; 2+ messages in thread
From: Albert Esteve @ 2026-11-26 15:46 UTC (permalink / raw)
  To: Alex Kazinsky
  Cc: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Jani Nikula,
	Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin, Alex Hung,
	Bhawanpreet Lakha, Fangzhi Zuo, George Zhang, Adrian Betschart,
	Alex Huang, Ivan Lipski, Ville Syrjälä,
	Stanislav Lisovskiy, Hans Verkuil, amd-gfx, dri-devel, intel-gfx,
	intel-xe, lvc-project

On Thu, Nov 26, 2026 at 9:33 AM Alex Kazinsky <a.kazinsky@ideco.ru> wrote:
>
> drm_connector_attach_content_type_property() returns success even when
> drm_mode_create_content_type_property() fails. The property is safely
> left unattached, but callers cannot detect the failure.
>
> Propagate the creation error and document the return value. Check the
> result in the Intel HDMI and DP/LSPCON paths and in AMDGPU, logging the
> failure while preserving initialization without the optional property.
>
> Fixes: 50525c332b55 ("drm: content-type property for HDMI connector")
> Signed-off-by: Alex Kazinsky <a.kazinsky@ideco.ru>

Reviewed-by: Albert Esteve <aesteve@redhat.com>

Thanks!
Albert

> ---
>  .../amd/display/amdgpu_dm/amdgpu_dm_connector.c  |  3 ++-
>  drivers/gpu/drm/drm_connector.c                  | 16 +++++++++++-----
>  drivers/gpu/drm/i915/display/intel_dp.c          |  3 ++-
>  drivers/gpu/drm/i915/display/intel_hdmi.c        |  3 ++-
>  4 files changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> index 8a039ef6e4b7..3d163c2fc106 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> @@ -3325,7 +3325,8 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
>
>         if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {
>                 /* Content Type is currently only implemented for HDMI. */
> -               drm_connector_attach_content_type_property(&aconnector->base);
> +               if (drm_connector_attach_content_type_property(&aconnector->base))
> +                       drm_err(adev_to_drm(adev), "Failed to attach content type property\n");
>         }
>
>         if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 51e616f5aa5e..5ab121860050 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -2253,14 +2253,20 @@ EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property);
>   *
>   * Called by a driver the first time a HDMI connector is made.
>   *
> - * Returns: %0
> + * Returns:
> + * Zero on success, negative errno on failure.
>   */
>  int drm_connector_attach_content_type_property(struct drm_connector *connector)
>  {
> -       if (!drm_mode_create_content_type_property(connector->dev))
> -               drm_object_attach_property(&connector->base,
> -                                          connector->dev->mode_config.content_type_property,
> -                                          DRM_MODE_CONTENT_TYPE_NO_DATA);
> +       int ret;
> +
> +       ret = drm_mode_create_content_type_property(connector->dev);
> +       if (ret)
> +               return ret;
> +
> +       drm_object_attach_property(&connector->base,
> +                                  connector->dev->mode_config.content_type_property,
> +                                  DRM_MODE_CONTENT_TYPE_NO_DATA);
>         return 0;
>  }
>  EXPORT_SYMBOL(drm_connector_attach_content_type_property);
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 47741957935a..768cb02f22fb 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -7012,7 +7012,8 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *_connec
>
>         /* Register HDMI colorspace for case of lspcon */
>         if (intel_bios_encoder_is_lspcon(dp_to_dig_port(intel_dp)->base.devdata)) {
> -               drm_connector_attach_content_type_property(&connector->base);
> +               if (drm_connector_attach_content_type_property(&connector->base))
> +                       drm_err(connector->base.dev, "Failed to attach content type property\n");
>                 intel_attach_hdmi_colorspace_property(&connector->base);
>         } else {
>                 intel_attach_dp_colorspace_property(&connector->base);
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index b6fa1a1558b8..83daf6d1af4a 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -2719,7 +2719,8 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *_
>         intel_attach_aspect_ratio_property(&connector->base);
>
>         intel_attach_hdmi_colorspace_property(&connector->base);
> -       drm_connector_attach_content_type_property(&connector->base);
> +       if (drm_connector_attach_content_type_property(&connector->base))
> +               drm_err(connector->base.dev, "Failed to attach content type property\n");
>
>         if (DISPLAY_VER(display) >= 10)
>                 drm_connector_attach_hdr_output_metadata_property(&connector->base);
> --
> 2.56.0
>
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/5] drm/connector: Propagate content type property creation errors
       [not found] ` <20261126081602.2901498-4-a.kazinsky@ideco.ru>
  2026-11-26 15:46   ` [PATCH 3/5] drm/connector: Propagate content type property creation errors Albert Esteve
@ 2026-11-27  8:38   ` sashiko-bot
  1 sibling, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-27  8:38 UTC (permalink / raw)
  To: Alex Kazinsky; +Cc: amd-gfx, dri-devel, intel-gfx, intel-xe

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/amd/display: active work reinit in
  amdgpu_dm_connector_init_helper() [1]
--

commit b9748e6639f50b5b110c49b43861b3ed27424ab6
Author: Alex Kazinsky <a.kazinsky@ideco.ru>

drm/connector: Propagate content type property creation errors

This commit propagates errors from drm_mode_create_content_type_property()
in drm_connector_attach_content_type_property() and logs attachment failures
in AMDGPU and i915.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> index 8a039ef6e4b76..3d163c2fc1066 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> @@ -3325,7 +3325,8 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
>  
>  	if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {
>  		/* Content Type is currently only implemented for HDMI. */
> -		drm_connector_attach_content_type_property(&aconnector->base);
> +		if (drm_connector_attach_content_type_property(&aconnector->base))
> +			drm_err(adev_to_drm(adev), "Failed to attach content type property\n");
>  	}
>  
>  	if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {

[Severity: High]
This problem wasn't introduced by this patch, but can
amdgpu_dm_connector_init_helper() reinitialize active delayed work in
dm->hdmi_frl_status_polling_work [1]?

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c:amdgpu_dm_connector_init_helper() {
    ...
	dm->hdmi_frl_status_polling_delay_ms = 200;
	INIT_DELAYED_WORK(&dm->hdmi_frl_status_polling_work, hdmi_frl_status_polling_work);
    ...
}

amdgpu_dm_connector_init_helper() runs for every connector, including
DisplayPort MST connectors created at runtime by dm_dp_add_mst_connector().
While an HDMI FRL stream is active, dm->hdmi_frl_status_polling_work rearms
itself every 200ms, so hotplugging an MST connector while that work is
armed reinitializes an active timer and corrupts the timer wheel.

[1] https://sashiko.dev/#/bug/linux-bb56a34e-fe01-46fd-8aea-d7d3688e24ce

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126081602.2901498-1-a.kazinsky@ideco.ru?part=3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-27  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261126081602.2901498-1-a.kazinsky@ideco.ru>
     [not found] ` <20261126081602.2901498-4-a.kazinsky@ideco.ru>
2026-11-26 15:46   ` [PATCH 3/5] drm/connector: Propagate content type property creation errors Albert Esteve
2026-11-27  8:38   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox