[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250416-drm_adp_fixes-v1-0-772699f13293@jannau.net>
Date: Wed, 16 Apr 2025 22:25:26 +0200
From: Janne Grunau via B4 Relay <devnull+j.jannau.net@...nel.org>
To: Sasha Finkelstein <fnkl.kernel@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Neal Gompa <neal@...pa.dev>, Alyssa Rosenzweig <alyssa@...enzweig.io>,
Dmitry Baryshkov <lumag@...nel.org>
Cc: dri-devel@...ts.freedesktop.org, asahi@...ts.linux.dev,
linux-kernel@...r.kernel.org, Janne Grunau <j@...nau.net>
Subject: [PATCH 0/4] Apple Display Pipe driver fixes
While looking at a suspend issue in the Asahi downstream kernel I
noticed several issues in the the ADP driver. This series fixes those
issue.
The root cause of the issue was that the device is unexpectedly powered
down on suspend. The driver relies on initialization done by the boot
loader and can not bring the device up from reset. The change in [1]
annotates the power-domain as always on on devices with touchbars. This
is preferable to driver changes since keeps the device powered on if the
adpdrm module is not available during boot.
The device comes out of reset firing interrupts with a rate of 60Hz even
if vblank interrupts are disabled. This itself is not an issue.
The event_lock outside of the irq handler is locked with spin_lock()
resulting in a deadlock if the irq fires while the lock is held and
processed on the same CPU core. This happens eventually and results in a
soft-locked CPU. [Patch 1/4] "drm: adp: Use spin_lock_irqsave for drm
device event_lock" addresses this.
In addition I noticed that the driver does not use drm_crtc_vblank_on()
and instead enables HW vblank interrupts in probe(). This may have been
done to avoid errors from drm_crtc_vblank_get() after crtc reset.
drm_crtc_vblank_reset() intentionally leaves struct drm_vblank_crtc in
state where drm_crtc_vblank_get() cannot enable vblank interrupts.
Handle this case explictly in [Patch 2/4] "drm: adp: Handle
drm_crtc_vblank_get() errors".
[Patch 3/4] "drm: adp: Enable vblank interrupts in crtc's
.atomic_enable" then uses the expected drm_crtc_vblank_on() call to
enable vblank interrupts.
[Patch 4/4] "drm: adp: Remove pointless irq_lock spinlock" removes an
unnecessary spinlock protecting the irq handler from itself.
[1] https://lore.kernel.org/asahi/20250416-arm64_dts_apple_touchbar-v1-1-e1c0b53b9125@jannau.net/
---
Janne Grunau (4):
drm: adp: Use spin_lock_irqsave for drm device event_lock
drm: adp: Handle drm_crtc_vblank_get() errors
drm: adp: Enable vblank interrupts in crtc's .atomic_enable
drm: adp: Remove pointless irq_lock spin lock
drivers/gpu/drm/adp/adp_drv.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250416-drm_adp_fixes-1abfd4edecfe
Best regards,
--
Janne Grunau <j@...nau.net>
Powered by blists - more mailing lists