From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D922E568FB6; Wed, 9 Sep 2026 14:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963137; cv=none; b=IVwboVpRxP8LMEz6C1RGRPA7O5sXTGh4iPDqoInIZ4GcIq/xizCZ7OStrY/BjnToNNaEAnd1c1jaqUWkrFALn5cyuTNKTH/zW/qFForl26h9414HbSe9HW32Eyr7ARjKSxq3588EB9DGiMwYHxdVxN57yDbDMj2Bhry6//8nVH4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963137; c=relaxed/simple; bh=W9sNCFr5crBtGdoFoNrXLntP00GRVbfmNeWWROC29lU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z6rifJLcGktmvxw+toY9qtC4Nf+nHCMkeJDnf6dwyJWmmdDyHOiOr0ZqOKP+mb4npQOXx1tP8m4yFdVTwow0x3H36B7rkywu+o1SJesTysyMXetuF5dhE48srmzsG94xMIUFcWy1Z9na30JuSVdNiXqpNnkbU9cgpJZ8A6waAiI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lUaP4uCZ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lUaP4uCZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EEB71F00A3A; Wed, 9 Sep 2026 14:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788963135; bh=3UI4I7lKmLMZsmylfg9Y3dzWMUUCKzU296Dq5wT3ObQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lUaP4uCZmAmo7v7BEoEoBHX/04QH5TcKZ5fQxawZhQHgEcq5eXNG04BcC9q5Kxwdu dYTiiES80YWpYBGwR9MidiXnfeJhjuQZykXF2LlmdWM/xHtkTpmlVEPP0xogBy+mAK caT4PAvwWckL3Wdz3+goedWISZ6i/2ppM1e6aBQU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yuhao Jiang , Zhenhao Wan , Lyude Paul , Danilo Krummrich Subject: [PATCH 7.2 533/556] drm/nouveau/uvmm: clear the dirty flag when unwinding an OP_UNMAP_SPARSE Date: Wed, 9 Sep 2026 15:43:33 +0200 Message-ID: <20260909134249.152457111@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134230.441546314@linuxfoundation.org> References: <20260909134230.441546314@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhenhao Wan commit 38a62306c4266bcb3cd89e33c7111ee33096ebb3 upstream. A successful OP_UNMAP_SPARSE marks its region dirty with nouveau_uvma_region_dirty() and defers the teardown to nouveau_uvmm_bind_job_cleanup(); it does not remove the region from uvmm->region_mt. If a later op in the job fails, the unwind path never clears reg->dirty (set in one place, cleared nowhere) and sets op->reg = NULL, so cleanup skips the teardown. The region is left in the tree with dirty set and its completion never signalled. Later binds over that range then fail permanently -- -ENOENT or -EINVAL from the dirty checks, or an unkillable wait_for_completion() in bind_validate_region() -- for the lifetime of the uvmm. Clear reg->dirty when the unwind reverts the sparse unmap, restoring the region to the state it was found in. Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") Reported-by: Yuhao Jiang Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Signed-off-by: Zhenhao Wan Reviewed-by: Lyude Paul Link: https://patch.msgid.link/20260811-nouveau-uvmm-vmbind-fixes-v2-3-aaee4b395d04@gmail.com Signed-off-by: Danilo Krummrich Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -1475,6 +1475,7 @@ unwind: op->va.range); break; case OP_UNMAP_SPARSE: + op->reg->dirty = false; __nouveau_uvma_region_insert(uvmm, op->reg); nouveau_uvmm_sm_unmap_prepare_unwind(uvmm, &op->new, op->ops);