From patchwork Mon Oct 24 11:31:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp391660wru; Mon, 24 Oct 2022 04:33:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gY/M2AfrU2FJfAc7oRYLK+ldsT+6wQTVg5rdsysTzrt7D7k11c8y6jIlnd8rkH1ezLz0k X-Received: by 2002:a17:902:d2cf:b0:17f:7b65:862f with SMTP id n15-20020a170902d2cf00b0017f7b65862fmr32875696plc.168.1666611220191; Mon, 24 Oct 2022 04:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666611220; cv=none; d=google.com; s=arc-20160816; b=uIbqeIBMCMPpd//Dx8Rth8dVooSJ6YceI62X7EFSKqlW5dTVbKWFfFtyfeGg0BumXz wgr/tG6mxNH2caP9UddWe6lpyxBgxBlmQF66P/CAvqGih7fl+KpAGnRJYEWXfm7dwhMl fSIDpVCLOgnV3O410djCYZUPbQIBNl5EEvigeWKYyklWJQRM4nUQb3ZRC9kBCfwpQ4b5 z6x9HHLtoUraV/+i1TsIfgSWAzh3z1adyNJhlyGJN0Y6DmkvpfjQ1ZfY57/gpu48DEu3 j+CsKSlLLRNkNjUcR0bBwtDCiQ6RLLrKiNHbE1G7zYRiLxdWEN21geCXmqLk3H4Yn0/B cqtw== 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=My5o85fGvKGQZLH0ByR3ugFumNkTMH1mb/JHJmvB+zk=; b=MNnFiESRqrtMrpEZICzJWcZ7syh8Ej5s07etPfOi5aHkvflu+C1Dq23niku+IldcU3 rYNCfDtHc5xi0pPBuuorrEZXUrgObuAEfwbRTC/KHldOubRocLQ7hP1V0jpdLGdS6H4p 2IuHEKMtIwoKqtyVBK+Ith3MNQFHQCoJy3NU3DykSBUIAFhhrl5phV6/JcDOEvmI1ywV cldhKPrwUHICN3pGClejIIUvNVuWbvbpHp6ABieSimYT4k/tMCKm6nKa/3wUxalTl56/ Jcu5EoDFxvWv9oQm7a/k1tY51qp+lCiGUNhaX4qe7k0LDi82rZaGmYDYjuHGajeboZIQ Rp/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UzqUfRRf; 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 66-20020a630245000000b0046ea4ef43d2si14330366pgc.378.2022.10.24.04.33.26; Mon, 24 Oct 2022 04:33:40 -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=UzqUfRRf; 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 S230267AbiJXLb4 (ORCPT + 99 others); Mon, 24 Oct 2022 07:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230262AbiJXLbw (ORCPT ); Mon, 24 Oct 2022 07:31:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691775603D; Mon, 24 Oct 2022 04:31:51 -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 ams.source.kernel.org (Postfix) with ESMTPS id A30CCB81133; Mon, 24 Oct 2022 11:31:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F19B4C43141; Mon, 24 Oct 2022 11:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611108; bh=/VSGSHF0sdxC4vEXEymNZSjiWrDALm65vLVmrVSJcNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UzqUfRRfKxXKGe7f+JguNlHAxyaM/YCmW9bhZnFgz+tXgLvLC6vi3f17WPIY9Jnel kir0x7klAv5JE8I/QZ0dv1icCu/SUMbMZD6ZULUJDDIOgbx87tt0swz9IkOsOv2gA0 oZASLvGaZ1/YgYkoXTneQxVXpJXzA9RytQhX67io= 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 12/20] drm/amd/pm: fulfill SMU13.0.0 cstate control interface Date: Mon, 24 Oct 2022 13:31:14 +0200 Message-Id: <20221024112934.932218124@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?1747568527096681435?= X-GMAIL-MSGID: =?utf-8?q?1747568527096681435?= From: Evan Quan commit 528c0e66e0c01a8c078d2d94431db80f9c75d2a0 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_0_ppt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -119,6 +119,7 @@ static struct cmn2asic_msg_mapping smu_v MSG_MAP(NotifyPowerSource, PPSMC_MSG_NotifyPowerSource, 0), MSG_MAP(Mode1Reset, PPSMC_MSG_Mode1Reset, 0), MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0), + MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), }; static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = { @@ -1753,6 +1754,15 @@ static int smu_v13_0_0_set_mp1_state(str return ret; } +static int smu_v13_0_0_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_0_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_0_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_0_set_default_dpm_table, @@ -1822,6 +1832,7 @@ static const struct pptable_funcs smu_v1 .mode1_reset_is_support = smu_v13_0_0_is_mode1_reset_supported, .mode1_reset = smu_v13_0_mode1_reset, .set_mp1_state = smu_v13_0_0_set_mp1_state, + .set_df_cstate = smu_v13_0_0_set_df_cstate, }; void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu)