From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8D8CC2EAE6; Mon, 23 Dec 2024 16:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734969907; cv=none; b=OiMJmgDJ7BuU6g9blgXiueYXcbC0BaWg2ujS5YWv33DMFNSjxnnFZ+1n/xABpl/win+ypjGPj5A1PXxd1qr3dqFkPaBTyWzW9TQCsU77Bmf5u5fGLfTzAqusC6jT80szxkn1BaPIal+2NZQvU6/f2fVQ+GQUKxEXisg2nTlZAKw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734969907; c=relaxed/simple; bh=/Yoj6p5Q3DMULVTkLFMOrgEdPYtkXsFXe8RFWWUSHSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U/cgPrDoUdE21ToS4OFnEwJDRZ6FWxoNnjcbeGf6vfvcwAe0zS1/e264WEYsolXjd88xIHwQ0gApmPLuDjGPPz2nE5+V64DBn+9GpLQP7GafpVQ1ORnMUc4/qkIPwfx28ARCB7i9Ib3MXU6jURlQj7td85A/uoeZdI2zFxGldFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VoTnaMGA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VoTnaMGA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2007C4CED3; Mon, 23 Dec 2024 16:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734969907; bh=/Yoj6p5Q3DMULVTkLFMOrgEdPYtkXsFXe8RFWWUSHSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VoTnaMGATKYIAaxbFFNsWL4oAsMdgp4sU6cr55yazwdHJYwryjHHEqrjfbLrgXkKR jJJgDwZBjCs9H1JJWeJ84HhNHX+L8ew9reE68ayMEWawdy5oD6S6SA+92a3ZpO7+ev 36yCuLImMLK7eLvL6+AoL4+OBIWCUnfR9UmLvrlo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Christian=20K=C3=B6nig?= , =?UTF-8?q?Michel=20D=C3=A4nzer?= , Alex Deucher Subject: [PATCH 6.12 089/160] drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update Date: Mon, 23 Dec 2024 16:58:20 +0100 Message-ID: <20241223155412.134024240@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241223155408.598780301@linuxfoundation.org> References: <20241223155408.598780301@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michel Dänzer commit 85230ee36d88e7a09fb062d43203035659dd10a5 upstream. Third time's the charm, I hope? Fixes: d3116756a710 ("drm/ttm: rename bo->mem and make it a pointer") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3837 Reviewed-by: Christian König Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher (cherry picked from commit 695c2c745e5dff201b75da8a1d237ce403600d04) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1260,10 +1260,9 @@ int amdgpu_vm_bo_update(struct amdgpu_de * next command submission. */ if (amdgpu_vm_is_bo_always_valid(vm, bo)) { - uint32_t mem_type = bo->tbo.resource->mem_type; - - if (!(bo->preferred_domains & - amdgpu_mem_type_to_domain(mem_type))) + if (bo->tbo.resource && + !(bo->preferred_domains & + amdgpu_mem_type_to_domain(bo->tbo.resource->mem_type))) amdgpu_vm_bo_evicted(&bo_va->base); else amdgpu_vm_bo_idle(&bo_va->base);