From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.231.130 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384052; b=W+paXIkvk+H3mzbYuiIX39SVw10fn+kHJA5nBCwsg5T3VqK0UjjoC7TqneR7EJQ3TCoJ VtG3aHGFpohCixrYsQk0L1aW7fDO7T7SorYeSRl1hJZ3y3haawHWTUKrQV+Yli+JjB5t2 UFIByxueZIWsWnHY9LunRd4j0OEdR/yEfdEfs9F2zgymNiYC9Xjmnl77Li3BrG2lIpw9s w8czS2QqVYe6zt9qJiufNbZpYAFeAyRGw7WKD5/z/70rOJbynHR6bXYUd5Ypb0GFpR9ut KUgguA0lKcbDYXvKPmd95f2v1gumHcgy+D6d+VViDDFhNfVdxCFb5eAF2C/MTtHBZxA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384052; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=+7glOZ0zLYIMnCZAObc0ag89dZNgFfouVZnezYuJbEQ=; b=mrgkGQTVeeAlmEZBTcAyIg7drlg6k7uubKIxjuzpGWxO7SynapqLx08bsw7UDddgbLeT DZtug6G0aVIYiOpJeucmEMNO44t3N0pJ5c/Ow+AYV9x7/pjkf2Ef/Gt7wAwfo3WuJxHST 9yhB8EMzC1gSGB+ZKK4blT36L3F/cvhYRq1K0IGzndnWod3Jar6b7aAFfF7rXFmZ8fext t+wgeJvXE+sl+cufw9ejEFR73XXjByr1lODpW1lNTD4njNPrJ9CpdejPIWBjp0HLsGryQ tP8dwR5F9M8VVN1HaFlCs6hiOT/dnuvPqI/NJFxqUvLhF7Iy+T/JRJ3NpPR9ZlRGLOw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="cM/oejPb"; arc=none smtp.remote-ip=74.125.231.130 Received: from mail-oo2-f2.google.com (mail-oo2-f2.google.com [74.125.231.130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44B43606A32C for ; Fri, 4 Dec 2026 11:34:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 44B43606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cM/oejPb Received: by mail-oo2-f2.google.com with SMTP id 46e09a7af769-849c2965b9eso295377a34.1 for ; Fri, 04 Dec 2026 03:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796384051; x=1796988851; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=+7glOZ0zLYIMnCZAObc0ag89dZNgFfouVZnezYuJbEQ=; b=cM/oejPbl2C0vZnCxhQ81j/k+3fIWIl1Y2JsxMUHKekwh+5Dlda5L0Kgleu0BEup76 0YXjLriH1aJ1HXlTwfux0KuIpscMuxLk03Kh5WqwSid3thu27DqVvfo1Xp5Xb5mzx9s+ sqctK9zeZyMpYeko9M5IfBQlkjLGYs/mjXjGYIRHP6ofehrdx9B2Gpsl6lILPoD3I8U4 krXpNBUqQ1GlrgaSc6xgZTNK1Pb74p8+5BPqt6erXBLkWRZsxM4T0svi824CCnlAwwvo lpreaLpzDVFVevi6zx7w24Tk1Y9g0AYZNCUQFfp2t5NHgLu9IxYtY1mfK7GJ+I+mFZvW INCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796384051; x=1796988851; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+7glOZ0zLYIMnCZAObc0ag89dZNgFfouVZnezYuJbEQ=; b=X18rn9mL2eTqy8Lu6hlFWPGyA9EXhg17nV1C4EC1wpHO/T2sUqTZepn0hXjw+F6vKS N1H7aTtP+xqFV/pudqRgAg0iojrjFsRrjTOC5XrB+pY6VO6JNSxMhtXUSDJXPMRnwQ85 gnXr/Qt9Lajo4OBiVSYoMWNlY7ac1xDEjyQBCZp/G7qUmyOZoPeQ2RKfxaZwhUK4GQu5 euoOX3oRZcwatXMAyFT0e7qyFuRGsZgoollOksRpoPlUJVsALAuZXcvnsybrtmLTUIal UcOSzVlfOBW8V6eqUw06IZw0R2Mbfm94zOExhgogXZSR0DQ3ODC2SzG+WltnYyxgFXrc Zsxg== X-Forwarded-Encrypted: i=1; AL+hErHz0A2uMbZa+xQKDA4kW0S9PROb2+GqdbIAFxZbMnn2cLclaCUdv1lILUO0B5ptbDjbyhW/eyrMuWPU7ec=@vger.kernel.org X-Gm-Message-State: APuU4Z9MpS98stUHtL0FTOE5i1Wf9IQmthH6QASva4NrZuxybQr2KdEe nGfxM39+c1dMV8mIbSnAB4qYpSDwsvG6Ep26a/qqXTjytuYcSmuiypux X-Gm-Gg: AZFdTZeT6ZgZFpoyIiMTtZGpXm7wFyk3OSmf6h7LwovHCFqoiJX0gXMs4rBa/7IHfRI cHvGH6hwrD410LAk2jA/t3/x9Sgh5wHeSalVR/+l5Q7hGwCKxJXBiIeMDTMl+NBrRdAKXPawpZF zaxL+zVqE6qS/3XxsiW0hSfTO2/Kyy2j0QWlFxVeiz0RbJoB1D1+ViCAJ7Yo68LoeglDuDIm75G QPALnu8sdjjgFrtT5HbyaQ5id5VfYidVd9heTeegXA2IoyyvWA5Ep5Lxva6AueNR/7oeVa2xHGW grKlQPkZ/ksOqzB1P4lxeXpi2tTfosT0mdTU8W1MGCjF+0xvPBiKd99rQQikHqxPeJnL2F1VSvM FNIkgKuF2XP4aW/mPQ/tp15iNptWuhA5pZXAgUGbsHCyGDC6wt7RQGUx7/EOlRJw/+fffl+9eHI H6fKryoy88J5up3cZaJkHj8Eg3OLRYwIl8XLOzdzyjnLrd+AuEQKST9J9TtBlJIVps1WpkwIx+2 TA8Qt7PUDzzWZBur+ZcXZYxkpuf6L37lS4zwP6U+Fqt5uAS2jscROh+XAdivd3ZYevw5GGKqG1e jZDvEY9NZeBpBEOeWWlJ66yD1uAa3k77+IrBlMuUIjWj3w== X-Received: by 2002:a05:6830:2303:b0:862:ca2e:91a6 with SMTP id 46e09a7af769-863f89caf14mr1835596a34.19.1796384051076; Fri, 04 Dec 2026 03:34:11 -0800 (PST) Received: from AERO17.orionisli.com ([2604:a00:101:c:216:3eff:fe2e:ad51]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-863f8312e24sm1928955a34.17.2026.12.04.03.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 03:34:10 -0800 (PST) From: Pufan Jin To: Lyude Paul , Lyude Paul , Danilo Krummrich , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] drm/nouveau/intr: do not unmask hardware interrupts while unarmed Date: Fri, 4 Dec 2026 19:33:58 +0800 Message-ID: <20261204113358.191974-1-cyan2254650260@gmail.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit During device initialization in nvkm_device_init(), nvkm_intr_rearm() iterates through legacy subdevices and calls nvkm_intr_subdev_add(), which calls nvkm_inth_allow() -> nvkm_intr_allow_locked(). nvkm_intr_allow_locked() directly writes to the hardware interrupt allow registers (e.g. PMC register 0x160 on GP100/GP10B) to unmask the subdevice's interrupt in hardware, and nvkm_inth_allow() then restores CPU interrupts via spin_unlock_irqrestore(). However, at this point, device->intr.armed is still false because arming is performed only at the end of nvkm_intr_rearm(). On platforms where the GPU interrupt is level-triggered and directly wired to an interrupt controller (such as Tegra GP10B using GIC SPI 70), any pending interrupt assertion immediately triggers the top-level interrupt handler nvkm_intr(). In nvkm_intr(), because device->intr.armed is false, the handler bails out early and returns IRQ_NONE without reading or clearing the interrupt: spin_lock(&device->intr.lock); if (!device->intr.armed) goto done_unlock; Because the level-triggered line remains continuously asserted, this causes an immediate interrupt storm, leading the kernel to disable the IRQ line with "nobody cared": irq 142: nobody cared (try booting with the "irqpoll" option) handlers: [<...>] nvkm_intr [nouveau] Disabling IRQ #142 Fix this by only writing to the hardware allow/block registers in nvkm_intr_allow_locked() and nvkm_intr_block_locked() when device->intr.armed is true. While unarmed, only the software interest mask (intr->mask) is updated, and nvkm_intr_rearm() will later program and unmask the accumulated mask under spin_lock_irq() when arming the device. Fixes: 3ebd64aa3c4f ("drm/nouveau/intr: support multiple trees, and explicit interfaces") Signed-off-by: Pufan Jin --- Changes in v2: - Drop the nvkm_intr_unarm_locked() call from the !device->intr.armed path in nvkm_intr() to avoid BAR0 MMIO accesses while suspended in D3 and racing with nvkm_intr_dtor(). - Drop setting ret = IRQ_HANDLED in the unhandled-interrupt storm mitigation path so spurious IRQ detection still works on GPUs without intr->func->block (such as nv04_mc_intr). - Add Fixes tag for commit 3ebd64aa3c4f. drivers/gpu/drm/nouveau/nvkm/core/intr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/core/intr.c b/drivers/gpu/drm/nouveau/nvkm/core/intr.c index f31aca949e..ff9f1c36f1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/intr.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/intr.c @@ -91,7 +91,7 @@ static void nvkm_intr_allow_locked(struct nvkm_intr *intr, int leaf, u32 mask) { intr->mask[leaf] |= mask; - if (intr->func->allow) { + if (intr->subdev->device->intr.armed && intr->func->allow) { if (intr->func->reset) intr->func->reset(intr, leaf, mask); intr->func->allow(intr, leaf, mask); @@ -120,7 +120,7 @@ static void nvkm_intr_block_locked(struct nvkm_intr *intr, int leaf, u32 mask) { intr->mask[leaf] &= ~mask; - if (intr->func->block) + if (intr->subdev->device->intr.armed && intr->func->block) intr->func->block(intr, leaf, mask); } -- 2.56.1