From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE9F9171A9 for ; Mon, 22 May 2023 19:53:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 347A2C433EF; Mon, 22 May 2023 19:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684785189; bh=IwFQECVWWJbTDH1GzlGKGRxYhg4hwLA7xJx120R51fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zxaqrCegv62eNbmyFRdbft5HDQO0jNIVzAdhr+YjXDm+oWNaehzvMXymEkdKqw5ay LVjR87UPQEdXuf/9giI1+VEvzs+q0qeyrI4VwtnZRWd6XOgiesGcOOYofVMEWgk4/V ev72Cq8cuNv9X78+vxEOi8A0OYAaaCz0qwRGlZ9w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bas Nieuwenhuizen , "Guilherme G. Piccoli" , Alex Deucher Subject: [PATCH 6.3 339/364] drm/amdgpu/gfx10: Disable gfxoff before disabling powergating. Date: Mon, 22 May 2023 20:10:44 +0100 Message-Id: <20230522190421.247683785@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522190412.801391872@linuxfoundation.org> References: <20230522190412.801391872@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Bas Nieuwenhuizen commit 8173cab3368a13cdc3cad0bd5cf14e9399b0f501 upstream. Otherwise we get a full system lock (looks like a FW mess). Copied the order from the GFX9 powergating code. Fixes: 366468ff6c34 ("drm/amdgpu: Allow GfxOff on Vangogh as default") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2545 Signed-off-by: Bas Nieuwenhuizen Tested-by: Guilherme G. Piccoli Cc: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -8159,8 +8159,14 @@ static int gfx_v10_0_set_powergating_sta case IP_VERSION(10, 3, 3): case IP_VERSION(10, 3, 6): case IP_VERSION(10, 3, 7): + if (!enable) + amdgpu_gfx_off_ctrl(adev, false); + gfx_v10_cntl_pg(adev, enable); - amdgpu_gfx_off_ctrl(adev, enable); + + if (enable) + amdgpu_gfx_off_ctrl(adev, true); + break; default: break;