summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/lima/lima_pp.c
diff options
context:
space:
mode:
authorErico Nunes <nunes.erico@gmail.com>2024-04-02 00:43:28 +0200
committerQiang Yu <yuq825@gmail.com>2024-04-15 09:06:18 +0800
commita6683c690bbfd1f371510cb051e8fa49507f3f5e (patch)
treeadb26c314c2aba49d0f1834f409bbd694ece475f /drivers/gpu/drm/lima/lima_pp.c
parenta421cc7a6a001b70415aa4f66024fa6178885a14 (diff)
drm/lima: fix shared irq handling on driver remove
lima uses a shared interrupt, so the interrupt handlers must be prepared to be called at any time. At driver removal time, the clocks are disabled early and the interrupts stay registered until the very end of the remove process due to the devm usage. This is potentially a bug as the interrupts access device registers which assumes clocks are enabled. A crash can be triggered by removing the driver in a kernel with CONFIG_DEBUG_SHIRQ enabled. This patch frees the interrupts at each lima device finishing callback so that the handlers are already unregistered by the time we fully disable clocks. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240401224329.1228468-2-nunes.erico@gmail.com
Diffstat (limited to 'drivers/gpu/drm/lima/lima_pp.c')
-rw-r--r--drivers/gpu/drm/lima/lima_pp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c
index a4a2ffe6527c..eaab4788dff4 100644
--- a/drivers/gpu/drm/lima/lima_pp.c
+++ b/drivers/gpu/drm/lima/lima_pp.c
@@ -286,7 +286,9 @@ int lima_pp_init(struct lima_ip *ip)
void lima_pp_fini(struct lima_ip *ip)
{
+ struct lima_device *dev = ip->dev;
+ devm_free_irq(dev->dev, ip->irq, ip);
}
int lima_pp_bcast_resume(struct lima_ip *ip)
@@ -319,7 +321,9 @@ int lima_pp_bcast_init(struct lima_ip *ip)
void lima_pp_bcast_fini(struct lima_ip *ip)
{
+ struct lima_device *dev = ip->dev;
+ devm_free_irq(dev->dev, ip->irq, ip);
}
static int lima_pp_task_validate(struct lima_sched_pipe *pipe,