Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2423908rdh; Sun, 29 Oct 2023 16:01:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOlVDDJa+9Mdnjh96hsd+bu++LJVCTRhPCTMoNB4yx/U+g+pgqfO3vPM+nzmsDfdCcWY6G X-Received: by 2002:a17:902:db11:b0:1c3:61d9:2b32 with SMTP id m17-20020a170902db1100b001c361d92b32mr7567045plx.45.1698620481163; Sun, 29 Oct 2023 16:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620481; cv=none; d=google.com; s=arc-20160816; b=RXyUSC+Or7p7wvFily2dJ7X4UnUx05uJEFo9sdz4MF/F5iYrRhpYPJKFMk1ZWFwOVH mSJ8TSsvrFXBjYE9RPM/E0nrzfTdnQPdpMpzH2MMfJNedw8NQybu5Xo5dHj5O6vEHtau gt4Tirro1EEqBZXFftmcR8stSE9eJ4XkVQK6tia+4fqJ2JqWhdCWxCeSjSwf3yaXO1x8 1e2EmX/UVxlhO39SoCFBuGG8EpDqQLczvNC40Ty8gBs4lH35iwca7wEmCVk6lRfDoYLq lYBl4Pe0DRKCzbsC0Q6/x7ethMcGRDMASivD63i4hh6HraZzTHh6G3+qHsLW+6VCYTBn 5t9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2ypfEfSA3cYGAaWkGDFEL165NhOq6gaHbZJPpntWSfQ=; fh=EL5J9HN/zvsndeVkV7O3TVjR2YgDedeO9+OX7I58yGk=; b=xZ1P6GTfdM/jDxcf3Z318Na2ixjiab4kj4EG+a5hkAiAu0I5dW4IhgtTwdB2k1OEt+ JAsL8JRQkfhUWIE62aKE88ink8b6TeQpDH+8bo2r44YAspNESC22xsELxUrMmv4WYU6e xt0qqhTvtCgPPGX/C1JRDZIxmsl+Zz3KXt41yigARQeQq7YMI/M2ATNW5UFhGOHV/TnY AViwrMdXL6d3vYuOSYcWd6uaFqxbiweJiAiuiyrt4HMvKrx4/jBlzIc/S29SpMkoLXRa LK1AKZ5rrX4kPepyId9nJPzV5tmsT2z2hOIrzPMX6m+pMIHUqhcmJM8d1R73oAiCaX+L gYSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jTinBTSa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id la7-20020a170902fa0700b001ca1bd1e09bsi4111919plb.376.2023.10.29.16.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 16:01:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jTinBTSa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E7EA380A1E04; Sun, 29 Oct 2023 16:01:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231434AbjJ2XAj (ORCPT + 99 others); Sun, 29 Oct 2023 19:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231562AbjJ2XAD (ORCPT ); Sun, 29 Oct 2023 19:00:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B13D47; Sun, 29 Oct 2023 15:57:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58F5EC433B7; Sun, 29 Oct 2023 22:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620228; bh=jGXXUx8iaeHPMaEHKaAXeM6iKlz7xPyaHyWjHBeR5Wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jTinBTSaeBq39SzJVz4D1gUKUZASfrPfeJY0Hfvm/dQ4pW1umBXpvcCtMxmgmfdrd Xl8gkSj2iBgxdL22gITvARTU6+2abYgSTlFxHj8Ag3e+Y5giN7GoMBAadgPUkW7CDY HbRnIwlDOMqX6QDXrsmaOpkzyYciWo5qAcO4cu0arAxD9O0IfjyCni8dMSyGCzlIV4 oElmHD9P8kmWRgDIBSS6Z2gXC/dKRqwZJNi+yJCmS4C6m0T9pAHzr3dW5D55hE5XuF UzceJaHJXJgcFkzi8YOLtwOwzUPqhfrLWyN4MhacTHxZ24IrKYj8nZRKPqI5c1+5Hd kuvuS4HhOjtMg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Felix Kuehling , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin , Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, srinivasan.shanmugam@amd.com, Arunpravin.PaneerSelvam@amd.com, Philip.Yang@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.5 52/52] drm/amdgpu: Reserve fences for VM update Date: Sun, 29 Oct 2023 18:53:39 -0400 Message-ID: <20231029225441.789781-52-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 29 Oct 2023 16:01:14 -0700 (PDT) From: Felix Kuehling [ Upstream commit 316baf09d355aec1179981b6dfe28eba50c5ee5b ] In amdgpu_dma_buf_move_notify reserve fences for the page table updates in amdgpu_vm_clear_freed and amdgpu_vm_handle_moved. This fixes a BUG_ON in dma_resv_add_fence when using SDMA for page table updates. Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c index 12210598e5b8e..ba3a87cb88ccc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -403,7 +403,10 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach) continue; } - r = amdgpu_vm_clear_freed(adev, vm, NULL); + /* Reserve fences for two SDMA page table updates */ + r = dma_resv_reserve_fences(resv, 2); + if (!r) + r = amdgpu_vm_clear_freed(adev, vm, NULL); if (!r) r = amdgpu_vm_handle_moved(adev, vm); -- 2.42.0