* [PATCH 6.1.y-cip 1/5] [PARTIAL BACKPORT]drm/i915: Fix HPD polling, reenabling the output poll work as needed
2025-07-23 12:54 [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
@ 2025-07-23 12:54 ` Nicusor Huhulea
2025-07-23 12:54 ` [PATCH 6.1.y-cip 2/5] [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll work Nicusor Huhulea
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Nicusor Huhulea @ 2025-07-23 12:54 UTC (permalink / raw)
To: cip-dev
Cc: Imre Deak, stable, Dmitry Baryshkov, dri-devel,
Jouni Högander, Rodrigo Vivi, Nicusor Huhulea
From: Imre Deak <imre.deak@intel.com>
After the commit in the Fixes: line below, HPD polling stopped working
on i915, since after that change calling drm_kms_helper_poll_enable()
doesn't restart drm_mode_config::output_poll_work if the work was
stopped (no connectors needing polling) and enabling polling for a
connector (during runtime suspend or detecting an HPD IRQ storm).
After the above change calling drm_kms_helper_poll_enable() is a nop
after it's been called already and polling for some connectors was
disabled/re-enabled.
Fix this by calling drm_kms_helper_poll_reschedule() added in the
previous patch instead, which reschedules the work whenever expected.
Fixes: d33a54e3991d ("drm/probe_helper: sort out poll_running vs poll_enabled")
CC: stable@vger.kernel.org # 6.4+
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-2-imre.deak@intel.com
(cherry picked from commit 50452f2f76852322620b63e62922b85e955abe94)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Partial-Backport-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
---
drivers/gpu/drm/i915/display/intel_hotplug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
index f7a2f485b177c..6ba2d7b0cd1b7 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
@@ -208,7 +208,7 @@ intel_hpd_irq_storm_switch_to_polling(struct drm_i915_private *dev_priv)
/* Enable polling and queue hotplug re-enabling. */
if (hpd_disabled) {
- drm_kms_helper_poll_enable(dev);
+ drm_kms_helper_poll_reschedule(&dev_priv->drm);
mod_delayed_work(system_wq, &dev_priv->display.hotplug.reenable_work,
msecs_to_jiffies(HPD_STORM_REENABLE_DELAY));
}
@@ -638,7 +638,7 @@ static void i915_hpd_poll_init_work(struct work_struct *work)
drm_connector_list_iter_end(&conn_iter);
if (enabled)
- drm_kms_helper_poll_enable(dev);
+ drm_kms_helper_poll_reschedule(&dev_priv->drm);
mutex_unlock(&dev->mode_config.mutex);
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6.1.y-cip 2/5] [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll work
2025-07-23 12:54 [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
2025-07-23 12:54 ` [PATCH 6.1.y-cip 1/5] [PARTIAL BACKPORT]drm/i915: Fix HPD polling, reenabling the output poll work as needed Nicusor Huhulea
@ 2025-07-23 12:54 ` Nicusor Huhulea
2025-07-23 13:38 ` Greg KH
2025-07-23 12:54 ` [PATCH 6.1.y-cip 3/5] [PARTIAL BACKPORT]drm/probe_helper: extract two helper functions Nicusor Huhulea
` (4 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Nicusor Huhulea @ 2025-07-23 12:54 UTC (permalink / raw)
To: cip-dev
Cc: Imre Deak, stable, Dmitry Baryshkov, dri-devel,
Jouni Högander, Rodrigo Vivi, Nicusor Huhulea
From: Imre Deak <imre.deak@intel.com>
Add a helper to reschedule drm_mode_config::output_poll_work after
polling has been enabled for a connector (and needing a reschedule,
since previously polling was disabled for all connectors and hence
output_poll_work was not running).
This is needed by the next patch fixing HPD polling on i915.
CC: stable@vger.kernel.org # 6.4+
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-1-imre.deak@intel.com
(cherry picked from commit fe2352fd64029918174de4b460dfe6df0c6911cd)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Partial-Backport-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
---
drivers/gpu/drm/drm_probe_helper.c | 74 +++++++++++++++++++-----------
include/drm/drm_probe_helper.h | 1 +
2 files changed, 49 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 0e5eadc6d44de..787f6699971f1 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -224,6 +224,26 @@ drm_connector_mode_valid(struct drm_connector *connector,
}
#define DRM_OUTPUT_POLL_PERIOD (10*HZ)
+static void reschedule_output_poll_work(struct drm_device *dev)
+{
+ unsigned long delay = DRM_OUTPUT_POLL_PERIOD;
+
+ if (dev->mode_config.delayed_event)
+ /*
+ * FIXME:
+ *
+ * Use short (1s) delay to handle the initial delayed event.
+ * This delay should not be needed, but Optimus/nouveau will
+ * fail in a mysterious way if the delayed event is handled as
+ * soon as possible like it is done in
+ * drm_helper_probe_single_connector_modes() in case the poll
+ * was enabled before.
+ */
+ delay = HZ;
+
+ schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
+}
+
/**
* drm_kms_helper_poll_enable - re-enable output polling.
* @dev: drm_device
@@ -244,43 +264,45 @@ drm_connector_mode_valid(struct drm_connector *connector,
*/
void drm_kms_helper_poll_enable(struct drm_device *dev)
{
- bool poll = false;
+
struct drm_connector *connector;
struct drm_connector_list_iter conn_iter;
- unsigned long delay = DRM_OUTPUT_POLL_PERIOD;
if (drm_WARN_ON_ONCE(dev, !dev->mode_config.poll_enabled) ||
!drm_kms_helper_poll || dev->mode_config.poll_running)
return;
- drm_connector_list_iter_begin(dev, &conn_iter);
- drm_for_each_connector_iter(connector, &conn_iter) {
- if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT |
- DRM_CONNECTOR_POLL_DISCONNECT))
- poll = true;
- }
- drm_connector_list_iter_end(&conn_iter);
+ if (drm_kms_helper_enable_hpd(dev) ||
+ dev->mode_config.delayed_event)
+ reschedule_output_poll_work(dev);
- if (dev->mode_config.delayed_event) {
- /*
- * FIXME:
- *
- * Use short (1s) delay to handle the initial delayed event.
- * This delay should not be needed, but Optimus/nouveau will
- * fail in a mysterious way if the delayed event is handled as
- * soon as possible like it is done in
- * drm_helper_probe_single_connector_modes() in case the poll
- * was enabled before.
- */
- poll = true;
- delay = HZ;
- }
-
- if (poll)
- schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
+ dev->mode_config.poll_running = true;
}
EXPORT_SYMBOL(drm_kms_helper_poll_enable);
+/**
+ * drm_kms_helper_poll_reschedule - reschedule the output polling work
+ * @dev: drm_device
+ *
+ * This function reschedules the output polling work, after polling for a
+ * connector has been enabled.
+ *
+ * Drivers must call this helper after enabling polling for a connector by
+ * setting %DRM_CONNECTOR_POLL_CONNECT / %DRM_CONNECTOR_POLL_DISCONNECT flags
+ * in drm_connector::polled. Note that after disabling polling by clearing these
+ * flags for a connector will stop the output polling work automatically if
+ * the polling is disabled for all other connectors as well.
+ *
+ * The function can be called only after polling has been enabled by calling
+ * drm_kms_helper_poll_init() / drm_kms_helper_poll_enable().
+ */
+void drm_kms_helper_poll_reschedule(struct drm_device *dev)
+{
+ if (dev->mode_config.poll_running)
+ reschedule_output_poll_work(dev);
+}
+EXPORT_SYMBOL(drm_kms_helper_poll_reschedule);
+
static enum drm_connector_status
drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force)
{
diff --git a/include/drm/drm_probe_helper.h b/include/drm/drm_probe_helper.h
index 5880daa146240..429a85f38036a 100644
--- a/include/drm/drm_probe_helper.h
+++ b/include/drm/drm_probe_helper.h
@@ -25,6 +25,7 @@ void drm_kms_helper_connector_hotplug_event(struct drm_connector *connector);
void drm_kms_helper_poll_disable(struct drm_device *dev);
void drm_kms_helper_poll_enable(struct drm_device *dev);
+void drm_kms_helper_poll_reschedule(struct drm_device *dev);
bool drm_kms_helper_is_poll_worker(void);
enum drm_mode_status drm_crtc_helper_mode_valid_fixed(struct drm_crtc *crtc,
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 6.1.y-cip 2/5] [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll work
2025-07-23 12:54 ` [PATCH 6.1.y-cip 2/5] [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll work Nicusor Huhulea
@ 2025-07-23 13:38 ` Greg KH
2025-07-23 17:18 ` nicusor.huhulea
0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2025-07-23 13:38 UTC (permalink / raw)
To: Nicusor Huhulea
Cc: cip-dev, Imre Deak, stable, Dmitry Baryshkov, dri-devel,
Jouni Högander, Rodrigo Vivi
On Wed, Jul 23, 2025 at 03:54:24PM +0300, Nicusor Huhulea wrote:
> From: Imre Deak <imre.deak@intel.com>
>
> Add a helper to reschedule drm_mode_config::output_poll_work after
> polling has been enabled for a connector (and needing a reschedule,
> since previously polling was disabled for all connectors and hence
> output_poll_work was not running).
>
> This is needed by the next patch fixing HPD polling on i915.
>
> CC: stable@vger.kernel.org # 6.4+
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: dri-devel@lists.freedesktop.org
> Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-1-imre.deak@intel.com
> (cherry picked from commit fe2352fd64029918174de4b460dfe6df0c6911cd)
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Partial-Backport-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
What does "Partial-Backport-by:" mean? I don't see that in the
documentation files as a valid tag to put in kernel commits :(
confused,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 6.1.y-cip 2/5] [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll work
2025-07-23 13:38 ` Greg KH
@ 2025-07-23 17:18 ` nicusor.huhulea
0 siblings, 0 replies; 12+ messages in thread
From: nicusor.huhulea @ 2025-07-23 17:18 UTC (permalink / raw)
To: Greg KH
Cc: cip-dev@lists.cip-project.org, Imre Deak, stable@vger.kernel.org,
Dmitry Baryshkov, dri-devel@lists.freedesktop.org,
Jouni Högander, Rodrigo Vivi
thank you for your review! :)
I'll refine the series as I forgot to add all the authors/participants, therefore the confusion on the context/issue
Nicu
________________________________________
From: Greg KH <gregkh@linuxfoundation.org>
Sent: Wednesday, July 23, 2025 4:38 PM
To: Huhulea, Nicusor Liviu (FT FDS CES LX PBU 1)
Cc: cip-dev@lists.cip-project.org; Imre Deak; stable@vger.kernel.org; Dmitry Baryshkov; dri-devel@lists.freedesktop.org; Jouni Högander; Rodrigo Vivi
Subject: Re: [PATCH 6.1.y-cip 2/5] [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll work
On Wed, Jul 23, 2025 at 03:54:24PM +0300, Nicusor Huhulea wrote:
> From: Imre Deak <imre.deak@intel.com>
>
> Add a helper to reschedule drm_mode_config::output_poll_work after
> polling has been enabled for a connector (and needing a reschedule,
> since previously polling was disabled for all connectors and hence
> output_poll_work was not running).
>
> This is needed by the next patch fixing HPD polling on i915.
>
> CC: stable@vger.kernel.org # 6.4+
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: dri-devel@lists.freedesktop.org
> Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-1-imre.deak@intel.com
> (cherry picked from commit fe2352fd64029918174de4b460dfe6df0c6911cd)
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Partial-Backport-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
What does "Partial-Backport-by:" mean? I don't see that in the
documentation files as a valid tag to put in kernel commits :(
confused,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 6.1.y-cip 3/5] [PARTIAL BACKPORT]drm/probe_helper: extract two helper functions
2025-07-23 12:54 [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
2025-07-23 12:54 ` [PATCH 6.1.y-cip 1/5] [PARTIAL BACKPORT]drm/i915: Fix HPD polling, reenabling the output poll work as needed Nicusor Huhulea
2025-07-23 12:54 ` [PATCH 6.1.y-cip 2/5] [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll work Nicusor Huhulea
@ 2025-07-23 12:54 ` Nicusor Huhulea
2025-07-23 12:54 ` [PATCH 6.1.y-cip 4/5] [PARTIAL BACKPORT]drm/probe-helper: enable and disable HPD on connectors Nicusor Huhulea
` (3 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Nicusor Huhulea @ 2025-07-23 12:54 UTC (permalink / raw)
To: cip-dev
Cc: Dmitry Baryshkov, Neil Armstrong, Jani Nikula, Thomas Zimmermann,
Nicusor Huhulea
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Extract drm_kms_helper_enable_hpd() and drm_kms_helper_disable_hpd(),
two helpers that enable and disable HPD handling on all device's
connectors.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230124104548.3234554-1-dmitry.baryshkov@linaro.org
(cherry picked from commit cbf143b282c64e59559cc8351c0b5b1ab4bbdcbe)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Partial-Backport-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
---
drivers/gpu/drm/drm_probe_helper.c | 39 ++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 787f6699971f1..938649e3a282f 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -244,6 +244,45 @@ static void reschedule_output_poll_work(struct drm_device *dev)
schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
}
+static void drm_kms_helper_disable_hpd(struct drm_device *dev)
+{
+ struct drm_connector *connector;
+ struct drm_connector_list_iter conn_iter;
+
+ drm_connector_list_iter_begin(dev, &conn_iter);
+ drm_for_each_connector_iter(connector, &conn_iter) {
+ const struct drm_connector_helper_funcs *funcs =
+ connector->helper_private;
+
+ if (funcs && funcs->disable_hpd)
+ funcs->disable_hpd(connector);
+ }
+ drm_connector_list_iter_end(&conn_iter);
+}
+
+static bool drm_kms_helper_enable_hpd(struct drm_device *dev)
+{
+ bool poll = false;
+ struct drm_connector *connector;
+ struct drm_connector_list_iter conn_iter;
+
+ drm_connector_list_iter_begin(dev, &conn_iter);
+ drm_for_each_connector_iter(connector, &conn_iter) {
+ const struct drm_connector_helper_funcs *funcs =
+ connector->helper_private;
+
+ if (funcs && funcs->enable_hpd)
+ funcs->enable_hpd(connector);
+
+ if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT |
+ DRM_CONNECTOR_POLL_DISCONNECT))
+ poll = true;
+ }
+ drm_connector_list_iter_end(&conn_iter);
+
+ return poll;
+}
+
/**
* drm_kms_helper_poll_enable - re-enable output polling.
* @dev: drm_device
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6.1.y-cip 4/5] [PARTIAL BACKPORT]drm/probe-helper: enable and disable HPD on connectors
2025-07-23 12:54 [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
` (2 preceding siblings ...)
2025-07-23 12:54 ` [PATCH 6.1.y-cip 3/5] [PARTIAL BACKPORT]drm/probe_helper: extract two helper functions Nicusor Huhulea
@ 2025-07-23 12:54 ` Nicusor Huhulea
2025-07-23 12:54 ` [PATCH 6.1.y-cip 5/5] [PARTIAL BACKPORT]fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Nicusor Huhulea @ 2025-07-23 12:54 UTC (permalink / raw)
To: cip-dev; +Cc: Dmitry Baryshkov, Tomi Valkeinen, Neil Armstrong, Nicusor Huhulea
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Introduce two drm_connector_helper_funcs: enable_hpd() and disable_hpd().
They are called by drm_kms_helper_poll_enable() and
drm_kms_helper_poll_disable() (and thus drm_kms_helper_poll_init() and
drm_kms_helper_poll_fini()) respectively.
This allows DRM drivers to rely on drm_kms_helper_poll for enabling and
disabling HPD detection rather than doing that manually.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221102180705.459294-3-dmitry.baryshkov@linaro.org
Partial-Backport-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
---
include/drm/drm_modeset_helper_vtables.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index 6f19cf5c210e5..54f4848a655ab 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1144,6 +1144,28 @@ struct drm_connector_helper_funcs {
*/
void (*cleanup_writeback_job)(struct drm_writeback_connector *connector,
struct drm_writeback_job *job);
+
+ /**
+ * @enable_hpd:
+ *
+ * Enable hot-plug detection for the connector.
+ *
+ * This operation is optional.
+ *
+ * This callback is used by the drm_kms_helper_poll_enable() helpers.
+ */
+ void (*enable_hpd)(struct drm_connector *connector);
+
+ /**
+ * @disable_hpd:
+ *
+ * Disable hot-plug detection for the connector.
+ *
+ * This operation is optional.
+ *
+ * This callback is used by the drm_kms_helper_poll_disable() helpers.
+ */
+ void (*disable_hpd)(struct drm_connector *connector);
};
/**
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6.1.y-cip 5/5] [PARTIAL BACKPORT]fixes for i915 Hot Plug Detection and build/runtime issues
2025-07-23 12:54 [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
` (3 preceding siblings ...)
2025-07-23 12:54 ` [PATCH 6.1.y-cip 4/5] [PARTIAL BACKPORT]drm/probe-helper: enable and disable HPD on connectors Nicusor Huhulea
@ 2025-07-23 12:54 ` Nicusor Huhulea
2025-07-24 20:38 ` [PATCH 6.1.y-cip 0/5] drm/i915: fixes " Jan Kiszka
2025-07-25 0:39 ` [cip-dev] " nobuhiro1.iwamatsu
6 siblings, 0 replies; 12+ messages in thread
From: Nicusor Huhulea @ 2025-07-23 12:54 UTC (permalink / raw)
To: cip-dev; +Cc: Nicusor Huhulea
This collects and adapts several upstream fixes to make i915 and related
DRM subsystem build and function.
The hot plug mechanism is fixed by
"drm/i915: Fix HPD polling, reenabling the output poll work as needed"
Upstream commits:
drm/i915: Fix HPD polling, reenabling the output poll work as needed
drm: Add an HPD poll helper to reschedule the poll work
drm/probe_helper: extract two helper functions
drm/probe-helper: enable and disable HPD on connectors
...
Due to significant codebase divergence and numerous dependencies, it was not
possible to cherry-pick these commits cleanly. Instead, this patch will resolve
compile-time errors and fixes the hot plug mechanism.
Auxiliary fixes in upstream commits were not ported here as this would require
substantial work and dependency tracking.
Signed-off-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
---
drivers/gpu/drm/drm_probe_helper.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 938649e3a282f..46e664e69bbf3 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -304,9 +304,6 @@ static bool drm_kms_helper_enable_hpd(struct drm_device *dev)
void drm_kms_helper_poll_enable(struct drm_device *dev)
{
- struct drm_connector *connector;
- struct drm_connector_list_iter conn_iter;
-
if (drm_WARN_ON_ONCE(dev, !dev->mode_config.poll_enabled) ||
!drm_kms_helper_poll || dev->mode_config.poll_running)
return;
@@ -314,8 +311,6 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
if (drm_kms_helper_enable_hpd(dev) ||
dev->mode_config.delayed_event)
reschedule_output_poll_work(dev);
-
- dev->mode_config.poll_running = true;
}
EXPORT_SYMBOL(drm_kms_helper_poll_enable);
@@ -779,8 +774,11 @@ static void output_poll_execute(struct work_struct *work)
changed = dev->mode_config.delayed_event;
dev->mode_config.delayed_event = false;
- if (!drm_kms_helper_poll)
+ if (!drm_kms_helper_poll && dev->mode_config.poll_running) {
+ drm_kms_helper_disable_hpd(dev);
+ dev->mode_config.poll_running = false;
goto out;
+ }
if (!mutex_trylock(&dev->mode_config.mutex)) {
repoll = true;
@@ -896,10 +894,12 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
*/
void drm_kms_helper_poll_disable(struct drm_device *dev)
{
- if (drm_WARN_ON(dev, !dev->mode_config.poll_enabled))
- return;
+ if (dev->mode_config.poll_running)
+ drm_kms_helper_disable_hpd(dev);
cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+
+ dev->mode_config.poll_running = false;
}
EXPORT_SYMBOL(drm_kms_helper_poll_disable);
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues
2025-07-23 12:54 [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
` (4 preceding siblings ...)
2025-07-23 12:54 ` [PATCH 6.1.y-cip 5/5] [PARTIAL BACKPORT]fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
@ 2025-07-24 20:38 ` Jan Kiszka
2025-07-28 16:49 ` nicusor.huhulea
2025-07-25 0:39 ` [cip-dev] " nobuhiro1.iwamatsu
6 siblings, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2025-07-24 20:38 UTC (permalink / raw)
To: Nicusor Huhulea, cip-dev
On 23.07.25 14:54, Nicusor Huhulea wrote:
> Hello maintainers,
>
> This series addresses a defect observed on certain hardware platforms using Linux kernel 6.1.127 with the i915 driver. The issue concerns hot plug detection (HPD) logic,
> leading to unreliable or missed detection events on affected hardware. This is happening on some specific devices.
>
> ### Background
>
> Issue:
> On Simatic IPC227E, we observed unreliable or missing hot plug detection events, while on Simatic IPC227G (otherwise similar platform), expected hot plug behavior was maintained.
> Affected kernel:
> Most of the tests were conducted on 6.1.127 (manual/standalone kernel build, CIP/Isar context). But it also happens on 6.1.145-cip44
> Root cause analysis:
> Through testing and diagnostics, it appears that the HPD finite state machine or polling logic in kernel 6.1.127 is marginal for this edge case. Device IPC227E's behavior triggers
> this kernel edge case, likely due to slight variations in signal integrity, electrical margins, or internal component timing.
> Simatic IPC227G, functions as expected, possibly due to cleaner electrical signaling or more optimal timing characteristics, thus avoiding the triggering condition.
> Summary:
> This points to a hardware-software interaction where kernel code assumes nicer signaling or margins than IPC227E is able to provide, exposing logic gaps not visible on more robust hardware.
>
> ### Patches
>
> Patches 1-4:
> - Partial backports of upstream commits; only the relevant logic or fixes are applied, with other code omitted due to downstream divergence.
> Patch 5:
> - Additional modifications to ensure the driver builds and resolves run-time issues
> - Contains cherry-picked logic plus context/compatibility amendments as needed.
> - Together these fixes greatly improve reliability of hotplug detection on both devices, with no regression detected in our setups.
What is this series targeting, regular stable 6.1 or 6.1-cip only? If
the latter, why only cip? 6.1 stable is still alive, and this introduces
itself as fix.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues
2025-07-24 20:38 ` [PATCH 6.1.y-cip 0/5] drm/i915: fixes " Jan Kiszka
@ 2025-07-28 16:49 ` nicusor.huhulea
0 siblings, 0 replies; 12+ messages in thread
From: nicusor.huhulea @ 2025-07-28 16:49 UTC (permalink / raw)
To: Kiszka, Jan, cip-dev@lists.cip-project.org
________________________________________
From: Kiszka, Jan (FT RPD CED) <jan.kiszka@siemens.com>
Sent: Thursday, July 24, 2025 11:38 PM
To: Huhulea, Nicusor Liviu (FT FDS CES LX PBU 1); cip-dev@lists.cip-project.org
Subject: Re: [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues
On 23.07.25 14:54, Nicusor Huhulea wrote:
> Hello maintainers,
>
> This series addresses a defect observed on certain hardware platforms using Linux kernel 6.1.127 with the i915 driver. The issue concerns hot plug detection (HPD) logic,
> leading to unreliable or missed detection events on affected hardware. This is happening on some specific devices.
>
> ### Background
>
> Issue:
> On Simatic IPC227E, we observed unreliable or missing hot plug detection events, while on Simatic IPC227G (otherwise similar platform), expected hot plug behavior was maintained.
> Affected kernel:
> Most of the tests were conducted on 6.1.127 (manual/standalone kernel build, CIP/Isar context). But it also happens on 6.1.145-cip44
> Root cause analysis:
> Through testing and diagnostics, it appears that the HPD finite state machine or polling logic in kernel 6.1.127 is marginal for this edge case. Device IPC227E's behavior triggers
> this kernel edge case, likely due to slight variations in signal integrity, electrical margins, or internal component timing.
> Simatic IPC227G, functions as expected, possibly due to cleaner electrical signaling or more optimal timing characteristics, thus avoiding the triggering condition.
> Summary:
> This points to a hardware-software interaction where kernel code assumes nicer signaling or margins than IPC227E is able to provide, exposing logic gaps not visible on more robust hardware.
>
> ### Patches
>
> Patches 1-4:
> - Partial backports of upstream commits; only the relevant logic or fixes are applied, with other code omitted due to downstream divergence.
> Patch 5:
> - Additional modifications to ensure the driver builds and resolves run-time issues
> - Contains cherry-picked logic plus context/compatibility amendments as needed.
> - Together these fixes greatly improve reliability of hotplug detection on both devices, with no regression detected in our setups.
What is this series targeting, regular stable 6.1 or 6.1-cip only? If
the latter, why only cip? 6.1 stable is still alive, and this introduces
itself as fix.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
Thank you for your review. I was targeting 6.1-cip but not anymore.
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [cip-dev] [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues
2025-07-23 12:54 [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues Nicusor Huhulea
` (5 preceding siblings ...)
2025-07-24 20:38 ` [PATCH 6.1.y-cip 0/5] drm/i915: fixes " Jan Kiszka
@ 2025-07-25 0:39 ` nobuhiro1.iwamatsu
2025-07-28 16:51 ` nicusor.huhulea
6 siblings, 1 reply; 12+ messages in thread
From: nobuhiro1.iwamatsu @ 2025-07-25 0:39 UTC (permalink / raw)
To: nicusor.huhulea, cip-dev
Hi Nicusor,
Thank you for the patch.
I've looked at this patch and it looks like a fix that's needed not just for CIP
but also for the stable tree.
Please send these to the stable mailing list instead of the CIP.
Best regards,
Nobuhiro
> -----Original Message-----
> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On
> Behalf Of Nicusor Huhulea via lists.cip-project.org
> Sent: Wednesday, July 23, 2025 9:54 PM
> To: cip-dev@lists.cip-project.org
> Cc: Nicusor Huhulea <nicusor.huhulea@siemens.com>
> Subject: [cip-dev] [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug
> Detection and build/runtime issues
>
> Hello maintainers,
>
> This series addresses a defect observed on certain hardware platforms using
> Linux kernel 6.1.127 with the i915 driver. The issue concerns hot plug detection
> (HPD) logic, leading to unreliable or missed detection events on affected
> hardware. This is happening on some specific devices.
>
> ### Background
>
> Issue:
> On Simatic IPC227E, we observed unreliable or missing hot plug detection
> events, while on Simatic IPC227G (otherwise similar platform), expected hot
> plug behavior was maintained.
> Affected kernel:
> Most of the tests were conducted on 6.1.127 (manual/standalone kernel
> build, CIP/Isar context). But it also happens on 6.1.145-cip44 Root cause
> analysis:
> Through testing and diagnostics, it appears that the HPD finite state
> machine or polling logic in kernel 6.1.127 is marginal for this edge case. Device
> IPC227E's behavior triggers
> this kernel edge case, likely due to slight variations in signal integrity,
> electrical margins, or internal component timing.
> Simatic IPC227G, functions as expected, possibly due to cleaner electrical
> signaling or more optimal timing characteristics, thus avoiding the triggering
> condition.
> Summary:
> This points to a hardware-software interaction where kernel code assumes
> nicer signaling or margins than IPC227E is able to provide, exposing logic gaps
> not visible on more robust hardware.
>
> ### Patches
>
> Patches 1-4:
> - Partial backports of upstream commits; only the relevant logic or fixes are
> applied, with other code omitted due to downstream divergence.
> Patch 5:
> - Additional modifications to ensure the driver builds and resolves
> run-time issues
> - Contains cherry-picked logic plus context/compatibility amendments as
> needed.
> - Together these fixes greatly improve reliability of hotplug detection on
> both devices, with no regression detected in our setups.
>
> Thank you for your review,
> Nicusor Liviu Huhulea
>
> This patch series contains the following changes:
>
> Dmitry Baryshkov (2):
> [PARTIAL BACKPORT]drm/probe_helper: extract two helper functions
> [PARTIAL BACKPORT]drm/probe-helper: enable and disable HPD on
> connectors
>
> Imre Deak (2):
> [PARTIAL BACKPORT]drm/i915: Fix HPD polling, reenabling the output
> poll work as needed
> [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll
> work
>
> Nicusor Huhulea (1):
> [PARTIAL BACKPORT]fixes for i915 Hot Plug Detection and build/runtime
> issues
>
> drivers/gpu/drm/drm_probe_helper.c | 125
> ++++++++++++++-----
> drivers/gpu/drm/i915/display/intel_hotplug.c | 4 +-
> include/drm/drm_modeset_helper_vtables.h | 22 ++++
> include/drm/drm_probe_helper.h | 1 +
> 4 files changed, 118 insertions(+), 34 deletions(-)
>
> --
> 2.39.2
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [cip-dev] [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues
2025-07-25 0:39 ` [cip-dev] " nobuhiro1.iwamatsu
@ 2025-07-28 16:51 ` nicusor.huhulea
0 siblings, 0 replies; 12+ messages in thread
From: nicusor.huhulea @ 2025-07-28 16:51 UTC (permalink / raw)
To: nobuhiro1.iwamatsu@toshiba.co.jp, cip-dev@lists.cip-project.org
________________________________________
From: nobuhiro1.iwamatsu@toshiba.co.jp <nobuhiro1.iwamatsu@toshiba.co.jp>
Sent: Friday, July 25, 2025 3:39 AM
To: Huhulea, Nicusor Liviu (FT FDS CES LX PBU 1); cip-dev@lists.cip-project.org
Subject: RE: [cip-dev] [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug Detection and build/runtime issues
Hi Nicusor,
Thank you for the patch.
I've looked at this patch and it looks like a fix that's needed not just for CIP
but also for the stable tree.
Please send these to the stable mailing list instead of the CIP.
Best regards,
Nobuhiro
Thank you for your review. I will resubmit the series to the stable soon.
I took the liberty of doing another round of tests on stable
> -----Original Message-----
> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On
> Behalf Of Nicusor Huhulea via lists.cip-project.org
> Sent: Wednesday, July 23, 2025 9:54 PM
> To: cip-dev@lists.cip-project.org
> Cc: Nicusor Huhulea <nicusor.huhulea@siemens.com>
> Subject: [cip-dev] [PATCH 6.1.y-cip 0/5] drm/i915: fixes for i915 Hot Plug
> Detection and build/runtime issues
>
> Hello maintainers,
>
> This series addresses a defect observed on certain hardware platforms using
> Linux kernel 6.1.127 with the i915 driver. The issue concerns hot plug detection
> (HPD) logic, leading to unreliable or missed detection events on affected
> hardware. This is happening on some specific devices.
>
> ### Background
>
> Issue:
> On Simatic IPC227E, we observed unreliable or missing hot plug detection
> events, while on Simatic IPC227G (otherwise similar platform), expected hot
> plug behavior was maintained.
> Affected kernel:
> Most of the tests were conducted on 6.1.127 (manual/standalone kernel
> build, CIP/Isar context). But it also happens on 6.1.145-cip44 Root cause
> analysis:
> Through testing and diagnostics, it appears that the HPD finite state
> machine or polling logic in kernel 6.1.127 is marginal for this edge case. Device
> IPC227E's behavior triggers
> this kernel edge case, likely due to slight variations in signal integrity,
> electrical margins, or internal component timing.
> Simatic IPC227G, functions as expected, possibly due to cleaner electrical
> signaling or more optimal timing characteristics, thus avoiding the triggering
> condition.
> Summary:
> This points to a hardware-software interaction where kernel code assumes
> nicer signaling or margins than IPC227E is able to provide, exposing logic gaps
> not visible on more robust hardware.
>
> ### Patches
>
> Patches 1-4:
> - Partial backports of upstream commits; only the relevant logic or fixes are
> applied, with other code omitted due to downstream divergence.
> Patch 5:
> - Additional modifications to ensure the driver builds and resolves
> run-time issues
> - Contains cherry-picked logic plus context/compatibility amendments as
> needed.
> - Together these fixes greatly improve reliability of hotplug detection on
> both devices, with no regression detected in our setups.
>
> Thank you for your review,
> Nicusor Liviu Huhulea
>
> This patch series contains the following changes:
>
> Dmitry Baryshkov (2):
> [PARTIAL BACKPORT]drm/probe_helper: extract two helper functions
> [PARTIAL BACKPORT]drm/probe-helper: enable and disable HPD on
> connectors
>
> Imre Deak (2):
> [PARTIAL BACKPORT]drm/i915: Fix HPD polling, reenabling the output
> poll work as needed
> [PARTIAL BACKPORT]drm: Add an HPD poll helper to reschedule the poll
> work
>
> Nicusor Huhulea (1):
> [PARTIAL BACKPORT]fixes for i915 Hot Plug Detection and build/runtime
> issues
>
> drivers/gpu/drm/drm_probe_helper.c | 125
> ++++++++++++++-----
> drivers/gpu/drm/i915/display/intel_hotplug.c | 4 +-
> include/drm/drm_modeset_helper_vtables.h | 22 ++++
> include/drm/drm_probe_helper.h | 1 +
> 4 files changed, 118 insertions(+), 34 deletions(-)
>
> --
> 2.39.2
^ permalink raw reply [flat|nested] 12+ messages in thread