From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 18F9A4963C3 for ; Wed, 12 Aug 2026 23:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786576420; cv=none; b=BEoiXH2iCGcAj2deFi7NK2v/WHf4em2hPhJpF4ZvIy7bap+v6Cx6XLEoy3jVPNhsepm0NW0NzQdB67gqZa9lC7YIC7znTrzLWo+yMTnq/hz6axoMywwZiRR/PlcdSbn7XPZpiTlxeIBJRRbe7+40CYSJnp6SMHLpq+6fm7UmSxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786576420; c=relaxed/simple; bh=I3WhJWLbx+mUMI83DKiCaZ/4Pz5Am1rpp/LVNrugUBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TxRy9fytYeSWNrTu2osbGFAke78YxagT/msBaY5gXnryRkVXapIpRWxgTd4uMi/5GRkV8gLDYpaTjv3k8f6fl+IhbZejx9OMKUE82u35/36NA/UJznTldc5eloozsP/e+Q44hG7OgkoyULrzh68BXBnogqBf5QP5a7JRuqAIZFg= 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=XoP1y8Jm; arc=none smtp.client-ip=209.85.221.53 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="XoP1y8Jm" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-4731f5ffa74so87349f8f.1 for ; Wed, 12 Aug 2026 16:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786576417; x=1787181217; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Z565EJ0GnjhReuEzH6bow6YJdlk7vm6R+vte4T3cg/Q=; b=XoP1y8JmaR19JaGy1adRugpv6j12oePfVQxm4bD+i4sLcxZctwL1HZuMzjklqvxtBz 3VZEsjjaLTM7ewdpIFsxSy9eCyczSSW4eSgUkVFHCqgwMeVwITjIB3LZWI73Sutrw0GU HtMuucOiMKhegoxPu2qYnErlGIQTeQUiPGp1xrGUqYwWYmFMxoPRJ4GTcrt5ViD944Qd +2eA/owoQd5GHFCFtgcg8gUJy9sc9jG/UfcCkWCTFbZKjAj5Sqzo895x7OLQZN/jQMzj 8XOjSefO3Y/IVgN4opElrAMHumRk7Yyyo3fajj4GVGkfOrFd71SAkGP8LiGCxHyR6MEq /DRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786576417; x=1787181217; h=content-transfer-encoding:mime-version:references:in-reply-to :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=Z565EJ0GnjhReuEzH6bow6YJdlk7vm6R+vte4T3cg/Q=; b=eFUcp1KODVQ0tmAsTBAYbuJKh0VDWVK2eyL4v+XHcNc4h1tu60ZcI12t8C1D2FRqiX 3VH5jHEwT9qarrMohICAdfnPUWdxlYWSBzfmTOwhc40ZJPcxrPpdIzdbvzngGIkzdWGc uNCT01W+x3DHzK/JG6AuepP1c7zIwIEZi5Sg/Yk5Ww+JyEmDNplBFcpJIUZDCWLPVqZ3 uBlkNormhqjzWNIg99SetwgwQxp3lCmLWx4cSGqzG7qu85byAsxlzRpxKFVLQUT/63t5 goyl6VMTl7nwFYujOTp3/yVYkRdqFBGSVOcEnbE/y8lkpTivfrx+ef8ktQeKnHfzO8/X qmGw== X-Gm-Message-State: AOJu0Yw/Hh21HEj40HpCqipWJaIDRnAeMm7RBIMmrEiuzrOEpMghYo+v 4Mk9Kxr5xuFGu86WVtsUWnQNx2kkBjV8zpiiUPEFElPeqFQ/PZcmPAWtVtq6ZZOG X-Gm-Gg: AR+sD11C94h8bqyMIS3qd0/B5RkSbwNy7f7skr1yYk91f3Hzcw9oiJTBvsHHE7Li8Ju ZcJMhv0f0HEKGmnVhrihmmgMYNPdnBH5BTkSv+QSE4ct+OHH7+iKeeT0j1VmAqqmwJJo6VsE8EI GR9SadAOUMTu3mdisFMJx5vZ6Jk2s6e6qDfPg4RKEar9zgsrtxzuQAIcP1FePs2+GDTUCd8DgFa uxGyKKRN+htmj85o1bSTEDL1Ps3NIOMFJVDxpYdH8mKgd3yQO+UHTMttTWe6Vw7EzWjmc8pan0S O5MbM2wO4i80UDF7m2cFYSiNdkHGirsoH/pr9GGnZDG1Q5SCMKQZTcgbwVdyXbkzdOfXjgKhg+a bGsVPbZNjxOyGcpW1yvqoX++xe5HkgatQ4YEm52V0Y49uOEDmSaR4aMeXTAYf2KGDyMUjF30sHF RLYaa+hR6zp8ei7hRpMyngjsnTrzb2206Co8fc6zcQfWQWZhx8NCRrQbCn1sDbS6///qNS1UDiD hpReGYHmzJw7rL4UfmI9a084/IjNSqSeQmZfiAMYm++WWwt30NWJnw= X-Received: by 2002:a05:600c:b93:b0:499:59da:12b9 with SMTP id 5b1f17b1804b1-499825cefdcmr4797315e9.0.1786576417330; Wed, 12 Aug 2026 16:13:37 -0700 (PDT) Received: from Neo.taile6b6ba.ts.net (ip-109-193-028-127.um39.pools.vodafone-ip.de. [109.193.28.127]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49981b631c1sm44532245e9.14.2026.08.12.16.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 16:13:36 -0700 (PDT) From: Marek Czernohous To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Danilo Krummrich , Lyude Paul , David Airlie , Simona Vetter , Ben Skeggs Subject: [PATCH v3 4/4] drm/nouveau: subscribe to channel-kill events on NV50 and newer Date: Thu, 13 Aug 2026 01:13:30 +0200 Message-ID: <20260812231330.705425-5-mczernohous@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812231330.705425-1-mczernohous@gmail.com> References: <20260812231330.705425-1-mczernohous@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Marek Czernohous 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 07b0bd1bc519..5c2f4b9342b7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_chan.c +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c @@ -485,7 +485,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) * lock and the pending list, so an event arriving in between would * find a non-NULL but unusable context and walk a NULL list head. */ - 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