From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B05A4C7EE2E for ; Wed, 7 Jun 2023 21:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236186AbjFGVD6 (ORCPT ); Wed, 7 Jun 2023 17:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235870AbjFGVDj (ORCPT ); Wed, 7 Jun 2023 17:03:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8CF92705 for ; Wed, 7 Jun 2023 14:03:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5E82664981 for ; Wed, 7 Jun 2023 21:03:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F3CBC433D2; Wed, 7 Jun 2023 21:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686171793; bh=nWRd9A0QqN0dca2ZUipSd+A8s4jl7a7f1n3vUpuk5kY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rHVFyYBCePQQOYbvBVhMzsINd0SDxPXBQbSPioxO6/zhBRDD+uXYYDkfQ/vyPiARo A83M/JVW4UqJuAB4ZWfxtdzvAf+vRTembmtKCro/2RPQpAP26ADbmbG2+YgpdtSL0C eqU3Q1ln+JloYKGvLSalO9pJYNz/07NTaWx0BA4E= 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 5.15 152/159] drm/amdgpu/gfx10: Disable gfxoff before disabling powergating. Date: Wed, 7 Jun 2023 22:17:35 +0200 Message-ID: <20230607200908.638917788@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230607200903.652580797@linuxfoundation.org> References: <20230607200903.652580797@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 [gpiccoli: adjusted to 5.15, before amdgpu changes from chip names to numbers.] Signed-off-by: Guilherme G. Piccoli 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 @@ -8422,8 +8422,14 @@ static int gfx_v10_0_set_powergating_sta break; case CHIP_VANGOGH: case CHIP_YELLOW_CARP: + 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;