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 6A9D458F075; Wed, 9 Sep 2026 14:33:33 +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=1788964414; cv=none; b=CflVHcc73WSI48b74az00UXsSYJGGkYQqGS1+mJWh52yTUDxbzf2frEeYaUDXJjiM5FRUj5Ff/EkPZWmRa28KRsZXbFufRsZ1u55PSfac66rcCgbwRxVdYb80MxopmmhAvOZaiaYgH8BQfjmCb+yLBeKFxeSffasUUHmPimr8Jc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788964414; c=relaxed/simple; bh=22aYdzBHPAkKpoevVsuByv7M9ndcTOf7w7byyvJo8eY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IhjBj+bI49jdjUGg2YSLmd6ipJsk4jRuzaE3bhXpo19mVGH+xzmsL7xXVpKsj6UEHcrEu92M2JNXRJ0CGbXXk2CdAL3honUzGWVXQT2AZyEQ//Bcpy5Oe1h4tD4B/kwliHv9/d0bRkRpceN6AtclvC1aLsY40ndzM+oxqp7wMmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uAM+cKHr; 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="uAM+cKHr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2AC01F00A3D; Wed, 9 Sep 2026 14:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788964413; bh=4xL9B1nwMURfOrOmdhhiPuoy5ePOm2VMiMBGGq2ncpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uAM+cKHrDHMiOwF969LEslj982we+ruyTI4ap/cukVvD5gSv+S7cXxSROL1J7qkdE UTjWqkp901gFDEaHYe/wHuu95n3S6ugePcb3upxz2QBA17rGbKJkCzWqrVYxGSzeHy qjKoDY+iWvNLZMLPvNpRvmT5ppY9O7mzgQawcT1A= 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 6.18 414/583] drm/nouveau/uvmm: clear the dirty flag when unwinding an OP_UNMAP_SPARSE Date: Wed, 9 Sep 2026 15:41:39 +0200 Message-ID: <20260909134252.322037779@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134237.773280130@linuxfoundation.org> References: <20260909134237.773280130@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 6.18-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 @@ -1407,6 +1407,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);