Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3546470pxj; Mon, 24 May 2021 09:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmFUFx5Y3FHMgF245Lh2RcnhIOXjfGaIbE8PnQyvDnqa8vqOH85D+fQljRpiDKLVGwICkd X-Received: by 2002:a17:907:7283:: with SMTP id dt3mr23793628ejc.253.1621872354974; Mon, 24 May 2021 09:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872354; cv=none; d=google.com; s=arc-20160816; b=tjz0nWSKD+p1URot0yyt52pctzfJ4S9uZo4BTz3baZWQ0ZmCnL2ixqMnOjrEyInBRJ B9fVHH+aoSYo5jU4SR9B+bhxfPuHRSHZk/DcyfP+bCyx3ZHgNXHJCjqljK5VVRFXBXRu 5kBWPfU0ys7XX/5oA7Q6Ph2Xd8g0GVkV72gxwf2V02FYTG3e0BCW9xsdrwmayJKpidUh SxiB5EUuQxhi9Pm0EczNVDRWzXY5WQ2/PyiOpE8+RXbaO/nUUayrrsNAdUeu84gLNboc iaSRpzahb8k8ozMnlh5VIGL4E7WNAd8ZqdPMjJK3bEyJAjHMl9CAXlFjOwyb0jFadOvA RU1A== 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=m6hwbimvfLXidMB7V8RufS9Fw63o6/EYbOE/FRZ7DxI=; b=KVFh53ZbWvMFUTn83XOsyk8G5kdt5ma/UVJh9DEzhBXfZJR37GBP5IoTVUThxsVS7G H9KfRqqQ+42pIEMd30DV/+waRGG48Zb/KVdOtZrcY41FXMIfNhxvtVMlxneRWTbQx9oY J2joA3LCOmtOdwaYtcxEIKyjKuWpc2R2Ckj82S3c8yOYNkUA4NSPpus7JKf5xdSob82p 7UdKKnsX+UyUwUMYOMoIzqjj3f45LPR2ExVxfX1kmkPcw6gMzKrlHVgtYMAo6ZFzA4xP kgIrP0pNE7JZHexqXrAn1Iqz/Zbj44pydVI8+oxnDC9mqiQnpRE6+R3n18QZ6knCxrWo 18/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ra5Ne+P8; 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 l16si14555502edj.405.2021.05.24.09.05.22; Mon, 24 May 2021 09:05:54 -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=Ra5Ne+P8; 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 S234957AbhEXQFs (ORCPT + 99 others); Mon, 24 May 2021 12:05:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:42710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235838AbhEXP7P (ORCPT ); Mon, 24 May 2021 11:59:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1CEC9610CB; Mon, 24 May 2021 15:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871109; bh=yWGoagD7je4bCFJe3xmVWzn6dRxdct0Rh/ztAJtI6Gw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ra5Ne+P8fCyHKvq4jMRR5/RdDYTXVVXxRm0ZW4q9zqF3e0Shf3kMKzv+vCxgtqxQD IZRCeAnsRReKgsC4Bljo+Hqmm2GzDzbAUaJMTwNe2Mhb228HWIoPFe0NTMrh8qw+u6 elKjUOHJMRrTL7YjTKE2TLbNFWivzOsVFfIzbHJM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changfeng , Alex Deucher , Huang Rui Subject: [PATCH 5.12 078/127] drm/amdgpu: disable 3DCGCG on picasso/raven1 to avoid compute hang Date: Mon, 24 May 2021 17:26:35 +0200 Message-Id: <20210524152337.487819212@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@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: Changfeng commit dbd1003d1252db5973dddf20b24bb0106ac52aa2 upstream. There is problem with 3DCGCG firmware and it will cause compute test hang on picasso/raven1. It needs to disable 3DCGCG in driver to avoid compute hang. Signed-off-by: Changfeng Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 +++++++--- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -4864,7 +4864,7 @@ static void gfx_v9_0_update_3d_clock_gat amdgpu_gfx_rlc_enter_safe_mode(adev); /* Enable 3D CGCG/CGLS */ - if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_3D_CGCG)) { + if (enable) { /* write cmd to clear cgcg/cgls ov */ def = data = RREG32_SOC15(GC, 0, mmRLC_CGTT_MGCG_OVERRIDE); /* unset CGCG override */ @@ -4876,8 +4876,12 @@ static void gfx_v9_0_update_3d_clock_gat /* enable 3Dcgcg FSM(0x0000363f) */ def = RREG32_SOC15(GC, 0, mmRLC_CGCG_CGLS_CTRL_3D); - data = (0x36 << RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT) | - RLC_CGCG_CGLS_CTRL_3D__CGCG_EN_MASK; + if (adev->cg_flags & AMD_CG_SUPPORT_GFX_3D_CGCG) + data = (0x36 << RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT) | + RLC_CGCG_CGLS_CTRL_3D__CGCG_EN_MASK; + else + data = 0x0 << RLC_CGCG_CGLS_CTRL_3D__CGCG_GFX_IDLE_THRESHOLD__SHIFT; + if (adev->cg_flags & AMD_CG_SUPPORT_GFX_3D_CGLS) data |= (0x000F << RLC_CGCG_CGLS_CTRL_3D__CGLS_REP_COMPANSAT_DELAY__SHIFT) | RLC_CGCG_CGLS_CTRL_3D__CGLS_EN_MASK; --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -1151,7 +1151,6 @@ static int soc15_common_early_init(void adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG | AMD_CG_SUPPORT_GFX_MGLS | AMD_CG_SUPPORT_GFX_CP_LS | - AMD_CG_SUPPORT_GFX_3D_CGCG | AMD_CG_SUPPORT_GFX_3D_CGLS | AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS | @@ -1170,7 +1169,6 @@ static int soc15_common_early_init(void AMD_CG_SUPPORT_GFX_MGLS | AMD_CG_SUPPORT_GFX_RLC_LS | AMD_CG_SUPPORT_GFX_CP_LS | - AMD_CG_SUPPORT_GFX_3D_CGCG | AMD_CG_SUPPORT_GFX_3D_CGLS | AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS |