From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59FA24D8D80 for ; Fri, 21 Aug 2026 15:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787325798; cv=none; b=bpVgmH+WOPyxl6KJMgZlhfUGpG1deszK+68FPx0wIzTcbJD+3+UoSTXNtEBeMEVf2dhNx+Hx0d/uyS+5JykJKGfFXzVe1ekXjIo6dpH0qjjHeTLCmp7kFmVMZxot81+3xKccc4gyL62agIG5PKAp5fcPU3HnuexNV5TwKJayHhA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787325798; c=relaxed/simple; bh=lfEv8+TXGNaNlN4Myl3yrEVhPwe7zSuQawloB7wkKZo=; h=From:Date:Subject:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CnpRAtOrkmzRS7OhhPFAYEuYGQWjKBrLGum1XMOeQeTqGaoE8enGhX3IgMJqkUf2eoEbeH9m90M8TT65GSp+G1DYd58Dh4iVzkG4RN7xajc9xek8i5M/UWOF5JmxKyFObNk3CNK7LpKGluMrXcYFemuwYR2+UIjrd6IoKktVGIc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Dd8Q+ncQ; arc=none smtp.client-ip=209.85.218.54 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.b="Dd8Q+ncQ" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-c160875e029so13301466b.3 for ; Fri, 21 Aug 2026 08:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787325794; x=1787930594; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:cc:to:subject:date:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=8sdbNeUe6ctrJEy+VKy4nn9z2qBfoh++mokomXoK9cc=; b=Dd8Q+ncQgppH4+oOpA/dFNPTl3OOaY1lzMj/mMwtCC+4vas1exkJpBiOmbc+Wz2NTu IvaoeZorpma3Oq7ZXesnMpq3cd5gjan/t6/Fi6JJ82z7qcQ3T1mpEvBZRyi1be9ku4Dn Y1AJSHKFmB0qzmZ0cPcjXNYj3ZmTpKri2eZlzrPcpcStXumEDCpbegU3PJ/uMhpa1g4G QA0y9fnNi2UxbgDx4FwTO++7X/lLCJO7R8tt4v1Z+UokEykN+GQtZNY38zW/mq9+xK9m 8e/22oewZDSZ2XVlwaktkQXpGfTM78dYEAO+5/7vDzAt96ZarKJjC1uaxqdt0pECNLB8 e0lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787325794; x=1787930594; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:cc:to:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8sdbNeUe6ctrJEy+VKy4nn9z2qBfoh++mokomXoK9cc=; b=OziBroei63lNd8XHfuEptl/1j+79xu47xA/4MUvT5/jJ3Gd2U2r8Qa5VzkV/Z31Y9x LSuKFYbTQZJJxm3mtISl62HbKdUZAcooZM1e8n6X1Y3Mg4yIRfKBQ09QKK1SqT1LTfG1 B1LW1mbL0geO87+TOtdx84zMFAcN3nkLBab4+6gxrQWdydS1CdZ8x5D6BMhvqKIxBBib LI94003tpY2UUsyvg74Tet6WC2QKCiISGWVCJ/tqLYh4BrgvIX8Bo2kdhdeL6jxCMb+z sOfwITz/mPHImZUhIZ0KXeuBWb1h05d0d9joGpAMf2StTogNOieDGSpti5XR2ECI7vKi 7upw== X-Gm-Message-State: AFuF++mtNWNk/h1U4YyF5aZNeW68YTxJfar4Wy/KcTOvNDAtDUnp+H1Z QMYnkP51nTGwCv/127HwB5XwUUoRppPi/TlauUkLbXy8Djl3cFTJg7CE X-Gm-Gg: AR+sD10AexhrsLWxx45sq4OAEWZrepHG14II+zUvTB/vEJHh/R5Ymu74iEy4txCL6YN EvceQuMTEnTubwJ4q4LLxzjdpCtHkrEWJW6jtjXEe+RVBbPuEtNyaDZn1Dgtm98LBIybkeE5mS2 kZGtHY09TmsLgjpEoFqN7lh04er1m4h9Tn/DuY5PrTN23qcUVt6EWznflcXfgeiD/Tk8yB2LEyb vNZSVevzvdDnnmF5GjxFOa7xH+uiKYJQDml3pY5AM+cROxpq4N5vR5e4EqPbPhWxRsNbROJ0YOe oHLw0SuOVOGW3zJ36/GJptO92MsXZ9df3R/2t8UCa4goZg+OqawI7RFwIerR3q0/3sLXglrFArR mMcoVsldAPRAYaMs8PYPm9W6LZ+H9KgQQofuYblDcUF+2VCU6gDD/A8vxsfxNNH0sRp3oMFlMtI RqVsREkpXqXJiYGwCCQl9GMonUeas79ESGJGokBQ3+4e61/AO+GcTtOx22GnyqEe0sHqArNN51t hHCVLPEQWpVcvJdDOXg2OClmc3DMtEbhC2wCHz1OA== X-Received: by 2002:a17:907:cd0e:b0:c15:ccda:26d5 with SMTP id a640c23a62f3a-c246a63d6b3mr388498966b.4.1787325794415; Fri, 21 Aug 2026 08:23:14 -0700 (PDT) Received: from [127.0.0.1] (ip-109-193-028-127.um39.pools.vodafone-ip.de. [109.193.28.127]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c24591dc662sm506198566b.42.2026.08.21.08.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 08:23:13 -0700 (PDT) From: Marek Czernohous X-Google-Original-From: Marek Czernohous Date: Fri, 21 Aug 2026 17:23:01 +0200 Subject: [PATCH v4 3/3] drm/nouveau: subscribe to channel-kill events on NV50 and newer To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Lyude Paul , Danilo Krummrich , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Ben Skeggs Message-ID: <178732578167.167481.2178147998794444181@gmail.com> In-Reply-To: <178732578167.167481.5619512544301226563@gmail.com> References: <178732578167.167481.5619512544301226563@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nouveau_channel_init() only subscribes to the channel-killed event for FERMI_CHANNEL_GPFIFO and newer. On NV50/Tesla the subscription therefore never happens, and nvkm_chan_error()'s NVKM_CHAN_EVENT_ERRORED is delivered into an empty notifier list. Today that is harmless, because nothing kills a channel on Tesla: the only nvkm_chan_error() callers are the Fermi and newer recovery paths. So this patch changes no observable behaviour on its own, and that is deliberate: it removes a latent trap before anything can fall into it. I am carrying a Tesla recovery path that does add such a caller and will send it separately once it is ready. Without a subscriber in place the consequences there are severe: nouveau_channel_killed() never runs, so nouveau_fence_context_kill() never runs either, and the pending fences of the killed channel are never signalled. Everything waiting on them waits forever: drm_atomic_helper_wait_for_fences() in the display commit tail waits uninterruptibly and without a timeout, and the TTM delayed delete workers wait in TASK_UNINTERRUPTIBLE. The user sees a frozen desktop on a machine that is otherwise alive, and nothing in the kernel ends that state: both waits pass MAX_SCHEDULE_TIMEOUT, so the fences cannot time out. They are signalled only when the fence context is torn down, that is when the DRM client owning the channel closes its fd and nouveau_fence_context_del() runs. Killing the client, or rebooting, clears it; waiting does not. That is also a dma-fence contract violation: a fence must always be signalled, with an error if necessary. Lower the class gate to NV50_CHANNEL_GPFIFO. The nvkm side is already class neutral: the KILLED case hangs the notifier on runl->chid->event, which every fifo owns since the runlist rework, and nvkm_uchan_uevent() does not discriminate by class. Pre-NV50 chips keep the old behaviour, so NV04 to NV40 are unaffected. Assisted-by: Claude:claude-opus-5 Signed-off-by: Marek Czernohous --- drivers/gpu/drm/nouveau/nouveau_chan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c index 605ce74c0d15..54e2202cb852 100644 --- a/drivers/gpu/drm/nouveau/nouveau_chan.c +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c @@ -378,7 +378,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) if (ret) return ret; - if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO) { + if (chan->user.oclass >= NV50_CHANNEL_GPFIFO) { DEFINE_RAW_FLEX(struct nvif_event_v0, args, data, sizeof(struct nvif_chan_event_v0)); struct nvif_chan_event_v0 *host = -- 2.54.0