Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2282450ybl; Thu, 19 Dec 2019 10:58:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyD44WKYiNeCZIbILs8w0N0Lvxce7QDQRPiYoJzp3Gr41xfP0MGLssgjnFeKv4SkQ3ybPE5 X-Received: by 2002:a9d:7495:: with SMTP id t21mr10502763otk.86.1576781928855; Thu, 19 Dec 2019 10:58:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781928; cv=none; d=google.com; s=arc-20160816; b=aJmssjl8PDOFz6A0nuMyK2qXYcVMLgqrKW9mJ5ZWLu+4T1bxI1h0EBCEpkW6efUnJk EVLt4+Gee7X7Cd/es3dH2QtocXAmUfGuGtPlKtFtKzW9SFzZfaNXEF3zjy3kSB8T3K8k e0O2JFXFB3QLkKfES4j7Fqx8/uygzC6lWDmXxZb8PSPuCfupuGGi8dHl6XHZGhEmxlqh mJwyVTVdgxZYYfttb2kuAwVy2FcpxeYXsQZbVLbCdZ3mL/PZrN7SXUNF1IOkz2JAf5eh raPGT+pzkxEDmjhfclZZz2/+XgKvjQUazBY/83f+72LELZiPiXHE3EY4Q5TYK3iJj+vD a1fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=k69Zrq+5AaVYr/YyPmumhU8A1kwC+5qWLATa3+Ugoho=; b=s68ht+2WSU5Wd6dQ7edKvUWBuworojnJK4tEAtE4XSJSm5lBkXVg6S50zM6vs6m1Ny jg4kwvrXoXJ/FSHUYlLViw/KO9yP+m6wfviPg/0zzzgYs6j3LP6WYHW5wiIEb/sVDNG9 6kJE1XJPQJnKy8ubnwpZKR9mP/+3ze1edxtmX3aS/N2nXjveyDagDNPO1ClpZKh7uETU bnR9KUm4WtWEjyEZn3xSNTjvt9fSXkOdbY2pThhgIjxQ92JkBv2mrokg4Hb+mHg9C3Xs 4PCrR13MvdHaahwq8ZuqGxR8vSoGYxnnCzryazDSiqiudKLdirZjEHWXSVSEme5gVven WqEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NoXc2cGJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si678998oib.226.2019.12.19.10.58.36; Thu, 19 Dec 2019 10:58:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NoXc2cGJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730864AbfLSS4p (ORCPT + 99 others); Thu, 19 Dec 2019 13:56:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:53374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730851AbfLSS4l (ORCPT ); Thu, 19 Dec 2019 13:56:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5489A24680; Thu, 19 Dec 2019 18:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781800; bh=n3LB/i2T6bdeabCrViHehSXGPiFqsgg13s0tmfgofSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NoXc2cGJlVV/D/3mrVx1DIMp6R+pUWvWl6TFX2UZOF5vaFMOIylshjr1YoRj0ezkW F94PX6KGETb0fKGojeY8YReXCAQSu6L1RCbWsd8ef5UJx2ClIUOQUlB/UV4FEhTC1q 3u+BJW9YHkoQ4XGd601BH/zkxSSwhIqQWo4I7A+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, changzhu , Huang Rui , Alex Deucher Subject: [PATCH 5.4 79/80] drm/amdgpu: avoid using invalidate semaphore for picasso Date: Thu, 19 Dec 2019 19:35:11 +0100 Message-Id: <20191219183149.722641313@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183031.278083125@linuxfoundation.org> References: <20191219183031.278083125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: changzhu commit 413fc385a594ea6eb08843be33939057ddfdae76 upstream. It may cause timeout waiting for sem acquire in VM flush when using invalidate semaphore for picasso. So it needs to avoid using invalidate semaphore for piasso. Signed-off-by: changzhu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -500,8 +500,11 @@ static void gmc_v9_0_flush_gpu_tlb(struc */ /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ - if (vmhub == AMDGPU_MMHUB_0 || - vmhub == AMDGPU_MMHUB_1) { + if ((vmhub == AMDGPU_MMHUB_0 || + vmhub == AMDGPU_MMHUB_1) && + (!(adev->asic_type == CHIP_RAVEN && + adev->rev_id < 0x8 && + adev->pdev->device == 0x15d8))) { for (j = 0; j < adev->usec_timeout; j++) { /* a read return value of 1 means semaphore acuqire */ tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem + eng); @@ -531,8 +534,11 @@ static void gmc_v9_0_flush_gpu_tlb(struc } /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ - if (vmhub == AMDGPU_MMHUB_0 || - vmhub == AMDGPU_MMHUB_1) + if ((vmhub == AMDGPU_MMHUB_0 || + vmhub == AMDGPU_MMHUB_1) && + (!(adev->asic_type == CHIP_RAVEN && + adev->rev_id < 0x8 && + adev->pdev->device == 0x15d8))) /* * add semaphore release after invalidation, * write with 0 means semaphore release @@ -563,8 +569,11 @@ static uint64_t gmc_v9_0_emit_flush_gpu_ */ /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ - if (ring->funcs->vmhub == AMDGPU_MMHUB_0 || - ring->funcs->vmhub == AMDGPU_MMHUB_1) + if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 || + ring->funcs->vmhub == AMDGPU_MMHUB_1) && + (!(adev->asic_type == CHIP_RAVEN && + adev->rev_id < 0x8 && + adev->pdev->device == 0x15d8))) /* a read return value of 1 means semaphore acuqire */ amdgpu_ring_emit_reg_wait(ring, hub->vm_inv_eng0_sem + eng, 0x1, 0x1); @@ -580,8 +589,11 @@ static uint64_t gmc_v9_0_emit_flush_gpu_ req, 1 << vmid); /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ - if (ring->funcs->vmhub == AMDGPU_MMHUB_0 || - ring->funcs->vmhub == AMDGPU_MMHUB_1) + if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 || + ring->funcs->vmhub == AMDGPU_MMHUB_1) && + (!(adev->asic_type == CHIP_RAVEN && + adev->rev_id < 0x8 && + adev->pdev->device == 0x15d8))) /* * add semaphore release after invalidation, * write with 0 means semaphore release