From: Imre Deak <imre.deak@intel.com>
To: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>, <ankit.k.nautiyal@intel.com>,
<uma.shankar@intel.com>
Subject: Re: [PATCH] drm/xe/display: Block hpd during suspend
Date: Tue, 22 Jul 2025 13:47:15 +0300 [thread overview]
Message-ID: <aH9sMxdRfHQB41PE@ideak-desk> (raw)
In-Reply-To: <20250717085425.1347043-1-dibin.moolakadan.subrahmanian@intel.com>
On Thu, Jul 17, 2025 at 02:24:25PM +0530, Dibin Moolakadan Subrahmanian wrote:
> It has been observed that during `xe_display_pm_suspend()` execution,
> an HPD interrupt can still be triggered, resulting in `dig_port_work`
> being scheduled. The issue arises when this work executes after
> `xe_display_pm_suspend_late()`, by which time the display is fully
> suspended.
>
> This can lead to errors such as "DC state mismatch", as the dig_port
> work accesses display resources that are no longer available or
> powered.
>
> To address this, introduce 'intel_hpd_block_all_encoders()' and
> 'intel_hpd_unblock_all_encoders()' functions, which iterate over all
> encoders and block/unblock HPD respectively.
>
> These are used to:
> - Block HPD IRQs before calling 'intel_hpd_cancel_work' in suspend
> - Unblock HPD IRQs after 'intel_hpd_init' in resume
>
> This will prevent 'dig_port_work' being scheduled during display
> suspend.
>
> Continuation of previous patch discussion:
> https://patchwork.freedesktop.org/patch/663964/
>
> Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_hotplug.c | 24 ++++++++++++++++++--
> drivers/gpu/drm/i915/display/intel_hotplug.h | 2 ++
> drivers/gpu/drm/xe/display/xe_display.c | 4 ++++
> 3 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> index 265aa97fcc75..7ffd8ded1c26 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> @@ -223,6 +223,28 @@ queue_detection_work(struct intel_display *display, struct work_struct *work)
> return queue_work(display->wq.unordered, work);
> }
>
> +void intel_hpd_unblock_all_encoders(struct intel_display *display)
> +{
> + struct intel_encoder *encoder;
> +
> + if (!HAS_DISPLAY(display))
> + return;
> +
> + for_each_intel_encoder(display->drm, encoder)
> + intel_hpd_unblock(encoder);
> +}
> +
> +void intel_hpd_block_all_encoders(struct intel_display *display)
> +{
> + struct intel_encoder *encoder;
> +
> + if (!HAS_DISPLAY(display))
> + return;
> +
> + for_each_intel_encoder(display->drm, encoder)
> + intel_hpd_block(encoder);
> +}
intel_encoder.c has the intel_encoder_{suspend,shutdown}_all() helpers
called in the same suspend/shutdown paths, so I'd also add these to there
calling them stg like intel_encoder_{block,unblock}_all_hpds().
> +
> static void
> intel_hpd_irq_storm_switch_to_polling(struct intel_display *display)
> {
> @@ -971,8 +993,6 @@ void intel_hpd_cancel_work(struct intel_display *display)
>
> spin_lock_irq(&display->irq.lock);
>
> - drm_WARN_ON(display->drm, get_blocked_hpd_pin_mask(display));
> -
> display->hotplug.long_hpd_pin_mask = 0;
> display->hotplug.short_hpd_pin_mask = 0;
> display->hotplug.event_bits = 0;
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.h b/drivers/gpu/drm/i915/display/intel_hotplug.h
> index edc41c9d3d65..3938c93d2385 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.h
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.h
> @@ -34,5 +34,7 @@ void intel_hpd_debugfs_register(struct intel_display *display);
> void intel_hpd_enable_detection_work(struct intel_display *display);
> void intel_hpd_disable_detection_work(struct intel_display *display);
> bool intel_hpd_schedule_detection(struct intel_display *display);
> +void intel_hpd_block_all_encoders(struct intel_display *display);
> +void intel_hpd_unblock_all_encoders(struct intel_display *display);
>
> #endif /* __INTEL_HOTPLUG_H__ */
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index e2e0771cf274..51584ea3ed09 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -340,6 +340,8 @@ void xe_display_pm_suspend(struct xe_device *xe)
>
> xe_display_flush_cleanup_work(xe);
>
> + intel_hpd_block_all_encoders(display);
> +
Yes, I still think blocking here only the HPD IRQs makes sense,
disabling all the display IRQs suggested by Maarten only later.
xe_display_pm_shutdown() also misses this.
Also xe_display_fini_early() - which is called after disabling all IRQs
- misses intel_hpd_cancel_work().
> intel_hpd_cancel_work(display);
>
> if (has_display(xe)) {
> @@ -471,6 +473,8 @@ void xe_display_pm_resume(struct xe_device *xe)
>
> intel_hpd_init(display);
>
> + intel_hpd_unblock_all_encoders(display);
> +
> if (has_display(xe)) {
> intel_display_driver_resume(display);
> drm_kms_helper_poll_enable(&xe->drm);
> --
> 2.43.0
>
prev parent reply other threads:[~2025-07-22 10:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-17 8:54 [PATCH] drm/xe/display: Block hpd during suspend Dibin Moolakadan Subrahmanian
2025-07-17 9:46 ` ✓ CI.KUnit: success for " Patchwork
2025-07-17 9:49 ` ✓ i915.CI.BAT: " Patchwork
2025-07-17 10:24 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-17 11:54 ` [PATCH] " Maarten Lankhorst
2025-07-18 5:21 ` Dibin Moolakadan Subrahmanian
2025-07-18 11:31 ` Maarten Lankhorst
2025-07-18 11:21 ` Imre Deak
2025-07-17 21:42 ` ✓ i915.CI.Full: success for " Patchwork
2025-07-18 13:54 ` ✗ Xe.CI.Full: failure " Patchwork
2025-07-21 20:16 ` ✓ CI.KUnit: success for drm/xe/display: Block hpd during suspend (rev2) Patchwork
2025-07-21 21:37 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-22 0:01 ` ✗ Xe.CI.Full: failure " Patchwork
2025-07-22 5:00 ` Dibin Moolakadan Subrahmanian
2025-07-22 10:47 ` Imre Deak [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=aH9sMxdRfHQB41PE@ideak-desk \
--to=imre.deak@intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=dibin.moolakadan.subrahmanian@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=uma.shankar@intel.com \
/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.