From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796220868; b=S5+JYlJWctUxChRrs+UjEiutNE1if7o4PbNg+cfGVQHAtwIJYG/SCNryqphTSvNzEWwb SrvRjnfS6TJA2mhhDdz60zoTqeOKI0BgD22jtQOokxJVZ8qHgCkZTgoY4d3DC+LWJp+eg Jk6h716I/s33wJvO7382ptjXg3JHV8Dfv1BF71xKp5dlQ5ZtvPWJi2NmYqYruAaYsgezE JcOTfqVUU332Fl2/dz9ymOFXDyr+PPowO5J31g73DgCFLl6r866pCyDa5LQsg/6ARGIZm K1Fsq/bGatRWK6E+U5qVKZ0XMg3TAfddrCQqC0J57GyV9GR2jChdUiA9gCtehGfjz1w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220868; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=/6irsfeJ08kqL8B0mumxR06IwMyNlDqPKIfUloXastg=; b=FX75IWpAGsLGsRCgx5C8ksxxfKyklUQJpVyrWRwtsNYWO52i6Ig0I2jbUUHxHJiCPCay dCxumwx5h9RPz8Sr1HNJfzWBwytSg2COLqhuzwC95Qgt+IPhaTbq87+ag9Xhbt0k3DyDP al5LqKt6tNqqSBrAWQrtEeC+nSGsICNfd7Haxe+wsP6CoQzNoQZ6lfEBs/be1f/eMGcW9 BBxObHa51IvHK8CcT7N0scz/+JAXCS5xS4u8ro35ePAnku3RKgW2BEotI9fofW9jYnW3n b6m9VgHkUkm1e8uHWjf2r1BIgrvkCuOGwhS9+9zZdGekDmlMHNdh0KbvNi1y1R6YLpQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yF9PXhyS; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DC06606A322 for ; Wed, 2 Dec 2026 14:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yF9PXhyS Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FC921F00897; Wed, 2 Dec 2026 14:14:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796220867; bh=/6irsfeJ08kqL8B0mumxR06IwMyNlDqPKIfUloXastg=; h=Subject:To:Cc:From:Date; b=yF9PXhySkjHBFd2M9V6d2NVTBgfAwd7KMJspbFJMcBfgE+kJmETSHtb7xjAedCanB vIY+0tFZk9zcZMyqmUmmgJ/55FLimqMJT7yz64hkgshp5BthsVUYPZSKhDMEUxyqjL hYExLIX7IyBog7SQrJEkaZAWE06rFGHSSlVWAsJg= Subject: FAILED: patch "[PATCH] drm/vc4: Rebuild the V3D interrupt mask on every power" failed to apply to 6.18-stable tree To: mcanal@igalia.com,itoral@igalia.com Cc: From: Date: Wed, 02 Dec 2026 13:49:20 +0100 Message-ID: <2026120220-radish-stir-e585@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 83dd19480c105c8bf96c93fb18b2ea554b44445d # git commit -s git send-email --to '' --in-reply-to '2026120220-radish-stir-e585@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 83dd19480c105c8bf96c93fb18b2ea554b44445d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ADra=20Canal?= Date: Wed, 11 Nov 2026 12:05:20 -0300 Subject: [PATCH] drm/vc4: Rebuild the V3D interrupt mask on every power transition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The out-of-memory interrupt is armed once, by bin_bo_alloc(), when the binner BO is allocated. vc4_irq_disable() masks it on the way down, vc4_irq_enable() brings back only the render bits, and bin_bo_alloc() does not run again for a binner BO that is still referenced. An overflow after an autosuspend therefore raises nothing and the binner stalls, until the hangcheck resets the GPU and arms the interrupt again. Therefore, derive the out-of-memory bit in vc4_irq_enable() from whether a binner BO exists, which is the condition bin_bo_alloc() was standing in for. While here, clear the complement of the wanted mask while enabling. V3D_INTENA and V3D_INTDIS are set/clear registers and the driver only ever set bits, so a source left enabled will stay enabled and can reach vc4_irq(), which returns IRQ_NONE for anything outside the three bits it handles. Cc: stable@vger.kernel.org Fixes: 35c8b4b2c0fe ("drm/vc4: Allocate binner bo when starting to use the V3D") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261111-vc4-irq-cleanup-v2-2-aa757bb742f2@igalia.com Signed-off-by: MaĆ­ra Canal diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c index c00a3e7c1358..d7aa698526dc 100644 --- a/drivers/gpu/drm/vc4/vc4_irq.c +++ b/drivers/gpu/drm/vc4/vc4_irq.c @@ -53,10 +53,6 @@ #include "vc4_regs.h" #include "vc4_trace.h" -#define V3D_DRIVER_IRQS (V3D_INT_OUTOMEM | \ - V3D_INT_FLDONE | \ - V3D_INT_FRDONE) - static void vc4_overflow_mem_work(struct work_struct *work) { @@ -249,6 +245,7 @@ void vc4_irq_enable(struct drm_device *dev) { struct vc4_dev *vc4 = to_vc4_dev(dev); + u32 mask = V3D_INT_FLDONE | V3D_INT_FRDONE; if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4)) return; @@ -256,10 +253,18 @@ vc4_irq_enable(struct drm_device *dev) if (!vc4->v3d) return; - /* Enable the render done interrupts. The out-of-memory interrupt is - * enabled as soon as we have a binner BO allocated. + /* Arming the OOM interrupt before there is a binner BO would raise an + * interrupt nothing can clear. */ - V3D_WRITE(V3D_INTENA, V3D_INT_FLDONE | V3D_INT_FRDONE); + if (vc4->bin_bo) + mask |= V3D_INT_OUTOMEM; + + /* Clear any pending interrupts someone might have left around for us. */ + V3D_WRITE(V3D_INTCTL, mask); + + /* Enable our set of interrupts, masking out any others. */ + V3D_WRITE(V3D_INTDIS, ~mask); + V3D_WRITE(V3D_INTENA, mask); } void @@ -274,14 +279,14 @@ vc4_irq_disable(struct drm_device *dev) return; /* Disable sending interrupts for our driver's IRQs. */ - V3D_WRITE(V3D_INTDIS, V3D_DRIVER_IRQS); - - /* Clear any pending interrupts we might have left. */ - V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS); + V3D_WRITE(V3D_INTDIS, ~0); /* Finish any interrupt handler still in flight. */ disable_irq(vc4->irq); + /* Clear any pending interrupts we might have left. */ + V3D_WRITE(V3D_INTCTL, ~0); + cancel_work_sync(&vc4->overflow_mem_work); } @@ -324,15 +329,12 @@ void vc4_irq_reset(struct drm_device *dev) if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4)) return; - /* Acknowledge any stale IRQs. */ - V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS); - - /* - * Turn all our interrupts on. Binner out of memory is the only - * one we expect to trigger at this point, since the reset cleared - * the overflow memory address and none has been supplied yet. + /* bin_bo_alloc() may arm OUTOMEM between the bin_bo check and the + * INTDIS write in vc4_irq_enable(), which would then mask it again. */ - V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS); + scoped_guard(mutex, &vc4->bin_bo_lock) { + vc4_irq_enable(dev); + } spin_lock_irqsave(&vc4->job_lock, irqflags); vc4_cancel_bin_job(dev);