Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3025888pxj; Mon, 17 May 2021 15:54:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXZCDocPGgAuien768lN+tlFz0llzvUxBJbfA8ix9ovzp2q3hyNq8sBGNi0sLm4+6SBSSP X-Received: by 2002:a05:6e02:12b0:: with SMTP id f16mr1604283ilr.132.1621292082889; Mon, 17 May 2021 15:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621292082; cv=none; d=google.com; s=arc-20160816; b=tDLHTGgKGSWydP1xNcxrnZxQXFQmY77hUiILUBJqOmyUYb6mbbK7RC8Z2Ne7H7Cq9t dOldRfzLDtFhrjRQyHPrixIAy5AmgvUWb/c5i67OFPJNmUEuBmUjOSg6YQt4FnPTGyD9 ojoPlNIqMHkjBqY5/RcajDlz6hsgDnawRJeqnW2mvDvixnvuRtp4FT3H4ImuqO+UTodt 4cmHom4pjVfYOYdfvnXz9JHydr+kubOuBNrSZz8Vx6pMm7q7dk6UrT5mSeatQVQU9z0B Q/hbYATaft6CIPN79K2hio3a/ZXedIDgb02BmE5GYxhfbqojjP828D+x90SCiGpV6P64 TiZQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zyjntB9DxnK7jIczifyqbzITPJH/u99laBUhxxrNAvs=; b=PWdcuCtDh14nIShJqZ/NIrK0XAGE8IraumdjDmu5j2ybCZfkoQszUtiH8d3Dj9KZyo BGXGym+SJ0mKcV3k+cIUFhY3lVVLkiBKGuJrCGzB8nOfsVhYvnXy233jwMs0mjZ6kGCf OhxgphjT19i5Gwi4QixJ11A3nQmIQf9B4xF6f54ILOu79X14U7sO8baHOTwmtcHt6yUu rT2iBegsLGh96pk+57lhVR6+QG0pVbdW/bYNojG3s9Pa+dEagQS6A74lQ+KpURMhnEuu C+Bzb9NDwjqFNLk9ineyUb5h4dwgy5od2pojmiHFg/St3589bJrrQtbhuqeWW9TLD2Am Bpkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C27pbBuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si6465426ilf.108.2021.05.17.15.54.04; Mon, 17 May 2021 15:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C27pbBuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238964AbhEQORc (ORCPT + 99 others); Mon, 17 May 2021 10:17:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:46666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239033AbhEQOOq (ORCPT ); Mon, 17 May 2021 10:14:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3550761166; Mon, 17 May 2021 14:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260548; bh=DiHdd7yDzIyuLxlC1zOMaexv0xacGPCFgIoI9D78zEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C27pbBuM3ORuip0jhpNkLhyXxffvGO99LfYeqaWf1WZJ2ouXOkrVS2CX59v4xdsXy CbmisVSa9bTBlo16GyBWouLEYVX22xDqCFz3Tn5CIu8jwak2EERRESjbhQhsEwa3Fy A5GL1OIY7qLlirTcyVQIEvGpFCL6n5IIp1cWNEXI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jinzhou Su , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin Subject: [PATCH 5.12 104/363] drm/amdgpu: Add mem sync flag for IB allocated by SA Date: Mon, 17 May 2021 15:59:30 +0200 Message-Id: <20210517140306.124847493@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jinzhou Su [ Upstream commit 5c88e3b86a88f14efa0a3ddd28641c6ff49fb9c4 ] The buffer of SA bo will be used by many cases. So it's better to invalidate the cache of indirect buffer allocated by SA before commit the IB. Signed-off-by: Jinzhou Su Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 7645223ea0ef..97c11aa47ad0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -77,6 +77,8 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, } ib->ptr = amdgpu_sa_bo_cpu_addr(ib->sa_bo); + /* flush the cache before commit the IB */ + ib->flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC; if (!vm) ib->gpu_addr = amdgpu_sa_bo_gpu_addr(ib->sa_bo); -- 2.30.2