From patchwork Mon Oct 24 11:31:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp392248wru; Mon, 24 Oct 2022 04:34:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JWFmtc2Q+/bXVPcJcAblcBmb+/LDFcvy1eZUfjNYHcFHcVzlvXRbIe/K/RFnupQR1lCwu X-Received: by 2002:a17:90a:e10:b0:211:9e6a:a099 with SMTP id v16-20020a17090a0e1000b002119e6aa099mr26895750pje.27.1666611294460; Mon, 24 Oct 2022 04:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666611294; cv=none; d=google.com; s=arc-20160816; b=f/hIjUx2hq/KwQvLA5plx0kQxx8A02gEweNfTQhMVV1nxYzHECstERCObe90pTp3T0 nlXLy4NzvPTljEzzi5XwcmY425HFsi48YLGYbI8e73Dq0dN+IQD5gEK/2vf46j/2ZPek ZN0VIyIlwR8l5xtODrT3UQS7hTpaYtHJwf4nyXIM0rAM1p4ZHYxaoVJmNT9W/2/w7dcj Jchlxe8Bvq9yBGfdgzRy9XXmXxOKaqz2F8VCyEN1gPZmiCMolT7URLqOFvORDro4hVZM J3dWqedNtWuJNTX+wRMhKG5Wkh5H1c3t8Tz8+HTNVolqMZ0jyBT3ssCmzNSwaO94rzQD 1QIA== 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=Rxi5wQMHFDCfDoqoiPzh2ZKzF+CkucYWZw+cBP+ADEY=; b=DIIaarX7F/0HoFutFbB6p23psGz0f5BLkiClN25ERma91dpmfMRG5Lb9c3cnp4MY8V OYEqoD1977NiFlercVj3BeTaR9821zzPiuK8V2FgEf7SELGCbza29LagwClWoThF55mB iZhKSoqT9B8+LLLHBubLyj6kDR3hGT8lVOpY8n0uJYAp0CqaaCH+toJcE3odEsseSDBx /MkUzCozrZ1xBBeGVt1ZyJ7Sq+BE1CubWI8vhLha6JbpojVRqSBHCCG6H2np8bcGfHHO QchvYzP4P7M+0XJriDKNd/nRHpgwwqklvUh2Yvolob27QRHqn0P+csskcz8dV8lZ2x+6 4RDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SwrOAyZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a056a0014d200b00542deddc4e0si35197390pfu.46.2022.10.24.04.34.40; Mon, 24 Oct 2022 04:34:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SwrOAyZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229974AbiJXLdr (ORCPT + 99 others); Mon, 24 Oct 2022 07:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbiJXLcq (ORCPT ); Mon, 24 Oct 2022 07:32:46 -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 C539A5C9EE; Mon, 24 Oct 2022 04:32:36 -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 DEB1A61259; Mon, 24 Oct 2022 11:32:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0D27C433C1; Mon, 24 Oct 2022 11:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611150; bh=rsXY7MlL90l2tYjwIfEorWd85y0jhMH3uOXqrnAp2YM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwrOAyZx/oEI3Di8ApVEhL2DCmPNqkv/IOZkj2mSRhf/AyA2bK9o4zsUhZvd8OWkZ 3TJMoTrijfNSxhlA8mx7bnVtIzNHInxQ32tIroAzSADgqG9wTM7P4Gvm30CpTC8x3K 0do68CAMWbq3mQ6c+0hke5xUwcGBlPG5Uu4zN3YM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Hawking Zhang , Lijo Lazar , Alex Deucher Subject: [PATCH 6.0 09/20] drm/amd/pm: fulfill SMU13.0.7 cstate control interface Date: Mon, 24 Oct 2022 13:31:11 +0200 Message-Id: <20221024112934.822526084@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112934.415391158@linuxfoundation.org> References: <20221024112934.415391158@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747568604650306612?= X-GMAIL-MSGID: =?utf-8?q?1747568604650306612?= From: Evan Quan commit ba2f09960e75accf757ed12b4ef61409dcc97df8 upstream. Fulfill the functionality for cstate control. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.0.x Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c @@ -121,6 +121,7 @@ static struct cmn2asic_msg_mapping smu_v MSG_MAP(Mode1Reset, PPSMC_MSG_Mode1Reset, 0), MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0), MSG_MAP(SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm, 0), + MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), }; static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = { @@ -1587,6 +1588,16 @@ static bool smu_v13_0_7_is_mode1_reset_s return true; } + +static int smu_v13_0_7_set_df_cstate(struct smu_context *smu, + enum pp_df_cstate state) +{ + return smu_cmn_send_smc_msg_with_param(smu, + SMU_MSG_DFCstateControl, + state, + NULL); +} + static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_7_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_7_set_default_dpm_table, @@ -1649,6 +1660,7 @@ static const struct pptable_funcs smu_v1 .mode1_reset_is_support = smu_v13_0_7_is_mode1_reset_supported, .mode1_reset = smu_v13_0_mode1_reset, .set_mp1_state = smu_v13_0_7_set_mp1_state, + .set_df_cstate = smu_v13_0_7_set_df_cstate, }; void smu_v13_0_7_set_ppt_funcs(struct smu_context *smu)