Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp338970pxj; Tue, 18 May 2021 04:42:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz4Penybk5m6n0HNuqxBps3SB1DM5vkdYaOsYtBcJPcJra27YZmLcW8LaPkou/3iPHh0tz X-Received: by 2002:a92:c564:: with SMTP id b4mr3883489ilj.257.1621338144544; Tue, 18 May 2021 04:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621338144; cv=none; d=google.com; s=arc-20160816; b=EtyHL0Gjjb2DJJFSQTdVCI1i9kgullz9ebgypfL26JAnF3bojhWDfFYswnEbqJZ4Y7 zVZThl6M6zExZELAgjNaTUyTRfwdGxEgJWS1re/oAfjDEPD06jEieGAaJpq7im9TDsu4 znyM/P+AzBX21gZ1lHx1SROcpB8Qb2bDrvFfVIcWGbpEaIriVDzwpPbKBY5WokqQpj/3 vdGRGtYhZBa6LfAOqVcf7PwXa3Xi3zMYnwwfYyX3hjXwKU6+srEGCbOPYKGJ16yQw+QZ AjnhpQBjydx8bDf2EOfq3bO8kJxmpvhkJ+VlekrZZhjWRz4eufAKLVrqeQk5kiKztsHW lpdQ== 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=4pvMFscCW4dCj2DHj4bChv6+qEUcIUCghODPVTcc0oE=; b=b91p36kZUx21txIgislYQ6pcJTimT93JdYCegMU4DfooLP0P3tB3hRevZT36Lmg0f8 ypMgbipTz7RrEASNrYhd/jvvbq15igu5HZbQQiGZCOcZxSrtIZHFKANFFbQLCwtTVEkZ wBqunOxdLaLDrE/ok+O9unQrNJDdEBJLNZZ5PkAA7kO0R4CnNA16xdkjqE/Qh0Oi9clM SHp0Ok6w7jRgklk8tgf5eJ02OzhG+/t/KWXpJ/OTV2H8QLkXU/XC3sdgPMBdJiD4qtnW kiJdtqibs+D+vOqlMJgq9rVm9laJBCYNrJwmJOHGDpjjgYflzUVg8ShzbWdkYQ0ab/Sy 2o+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WTcFtb5n; 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 q4si22206739ilv.82.2021.05.18.04.42.10; Tue, 18 May 2021 04:42:24 -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=WTcFtb5n; 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 S243828AbhEQPYU (ORCPT + 99 others); Mon, 17 May 2021 11:24:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:37272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242993AbhEQPKf (ORCPT ); Mon, 17 May 2021 11:10:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 46921616E9; Mon, 17 May 2021 14:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261846; bh=gYSpMSpcemkS+AZtk7k2jROkybl1/SgYrbZvQokyg7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WTcFtb5nzLTV0f2yRUUJU2zf7aWWZm3e4bp7+Ej/tl87tAKRt3T1we62RstZmWh4z XlC2SXiGddJS0sSzaGXS2JBWwgGvjq5kyZl01UBlnaj2KlxQ0M73+MCv6DFvGcpJYb fOtxCgdK7BQFEDfMf9sskWofsb8dBu9mowZ4QVAE= 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.10 075/289] drm/amdgpu: Add mem sync flag for IB allocated by SA Date: Mon, 17 May 2021 16:00:00 +0200 Message-Id: <20210517140307.712892198@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 2f53fa0ae9a6..28f20f0b722f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -75,6 +75,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