ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>
Cc: linux-sunxi@lists.linux.dev, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v8 5/5] drm/display: hdmi-state-helper: Init SCDC debugfs for HDMI
Date: Wed, 22 Jul 2026 09:50:32 +0000	[thread overview]
Message-ID: <20260722095033.3E37E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722-scdc-link-health-v8-5-cd1dacbb85d9@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing `mutex_unlock()` in `scdc_status_show()` error path leads to a permanent deadlock.
--

--- Patch [5]: [PATCH v8 5/5] drm/display: hdmi-state-helper: Init SCDC debugfs for HDMI ---
commit a1a858eb6a63d66446abae1340fa115153801dc6
Author: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

drm/display: hdmi-state-helper: Init SCDC debugfs for HDMI

This commit initialises the SCDC debugfs file for connectors that call the
HDMI state helper's debugfs_init helper, making the scdc_status file
available in their connector debugfs.

> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 8d5ee10ceb874..709524b40c26f 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
[ ... ]
> @@ -1116,6 +1117,7 @@ void drm_hdmi_connector_debugfs_init(struct drm_connector *connector,
>  		return;
>  
>  	create_hdmi_infoframe_files(connector, dir);
> +	drm_scdc_debugfs_init(connector, root);

[Severity: High]
Does exposing this debugfs file introduce a deadlock if it is read while the
display is disconnected?

Looking at the file operations wired up here, if a user reads the scdc_status
file when the connector is disconnected:

drivers/gpu/drm/display/drm_scdc_helper.c:scdc_status_show() {
	...
	mutex_lock(&connector->dev->mode_config.mutex);
	...
	if (connector->status != connector_status_connected) {
		ret = -ENODEV;
		goto err_conn_put;
	}
	...
err_unlock:
	mutex_unlock(&connector->dev->mode_config.mutex);
err_conn_put:
	drm_connector_put(connector);
	...
}

It appears the error path jumps to err_conn_put, bypassing the mutex_unlock() 
at err_unlock. Could this permanently lock mode_config.mutex and cause 
subsequent DRM mode setting operations to hang?

>  }
>  EXPORT_SYMBOL(drm_hdmi_connector_debugfs_init);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260722-scdc-link-health-v8-0-cd1dacbb85d9@collabora.com?part=5

      reply	other threads:[~2026-07-22  9:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  9:11 [PATCH v8 0/5] Add SCDC information to connector debugfs Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 1/5] drm/scdc-helper: Don't use ssize_t return type for scdc_read/write Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 2/5] drm/scdc-helper: Add scdc_status debugfs entry Nicolas Frattaroli
2026-07-22  9:27   ` sashiko-bot
2026-07-22  9:36     ` Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 3/5] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields Nicolas Frattaroli
2026-07-22  9:38   ` sashiko-bot
2026-07-22  9:11 ` [PATCH v8 4/5] drm/debugfs: Move HDMI debugfs registration to state helper Nicolas Frattaroli
2026-07-22  9:11 ` [PATCH v8 5/5] drm/display: hdmi-state-helper: Init SCDC debugfs for HDMI Nicolas Frattaroli
2026-07-22  9:50   ` sashiko-bot [this message]

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=20260722095033.3E37E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=nicolas.frattaroli@collabora.com \
    --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