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 X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_HTML_MOSTLY,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D0A4C2D0C0 for ; Mon, 23 Dec 2019 10:10:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65DCF206B7 for ; Mon, 23 Dec 2019 10:10:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="Q5UYvZOQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65DCF206B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 195C56E258; Mon, 23 Dec 2019 10:10:34 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2086.outbound.protection.outlook.com [40.107.237.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F7616E241 for ; Mon, 23 Dec 2019 10:10:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WyJcPjOMJ/BqVDzQTm+jjPkJvo45vPFyD/ocrJiXEDmtaP1ClnEyAfgUXHXgPiXI6ICgPzy5yoq9KltkwGqk2G5orum5tHezLr7CuEBQSMzMiNbWuuwDAAZ8ijxSW1TJYBaKXn4N68k4EllTH1L6nutGm+chE/TkuXPM0nWpIOlFDa4yHc7v5Rxvrg+m27sVKt0jBshmeCZaQRYRr6bUjnBGbQ2JQSRy6m47gf4f0v4g6yaM7RMgQJQNsHGZxsJ6Jh3InMPS5wXDA6yQYM8PIdcSOd0C7xSlfPwyuFzCL2eoK5t3YseGeGb4iRoDHf0SCGaaRUEIjVWI8FONwV0IgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZGLsULmXIJLSxhgRiAtdKpBEezwqM/a8dij4DenZx3o=; b=daa83mG3xyGBT6OQF6yX7KX+QQ+M7wuzjFuo3wv6NMh7G0JSTuiuzE14WjzbnSmUj655i9+EnX3+2ZhjumXke7/kMsQTBWyc/+eJJmVFWSUBTWUiwffbhXHIAurflu51Pb6D5zIaDHDOYmCxKdCEFhuzwQcCccEnL8sJ+ni2RBi4GoPMf6Laji2GKmULWCMdnA4uISDDlk2lkmGn4tkQtH6StBhv657xDr77Eg4Ng0BZ1FA79vRbQtjEpW2gK1v5p8WeO6LDm8/I0xK7j/c2gueOj5AowK8cqNMsTR/q0V3YnodpJJ9IXXJivbxfVbolOHT1iHEw7waD/eIZp4Pung== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZGLsULmXIJLSxhgRiAtdKpBEezwqM/a8dij4DenZx3o=; b=Q5UYvZOQlaluzjAmqjYQ2HFJK43Sm7HLV3J/jI2KjlCoiJfCim6gOXOwmhpcLe9QDKFqQpd9LmiQD8CQNmdrbUG23eN558fwiTbwkMpiNt9yJQmS/q5jdNnZjArQDQDW9VBF4Oak+tKr2S9HLNxU8jRExZIcKmYL1BlyiJh/oO4= Received: from MN2PR12MB3296.namprd12.prod.outlook.com (20.179.80.139) by MN2PR12MB4318.namprd12.prod.outlook.com (52.135.49.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14; Mon, 23 Dec 2019 10:10:31 +0000 Received: from MN2PR12MB3296.namprd12.prod.outlook.com ([fe80::b02a:3af3:a3c2:61f3]) by MN2PR12MB3296.namprd12.prod.outlook.com ([fe80::b02a:3af3:a3c2:61f3%6]) with mapi id 15.20.2559.017; Mon, 23 Dec 2019 10:10:30 +0000 From: "Wang, Kevin(Yang)" To: "Zhang, Jack (Jian)" , "Feng, Kenneth" , "Tao, Yintian" , "amd-gfx@lists.freedesktop.org" , "Deng, Emily" Subject: Re: [PATCH] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF Thread-Topic: [PATCH] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF Thread-Index: AQHVuWyH98p430LSk0KUV3nPXXgyTqfHZojQgAAUr/E= Date: Mon, 23 Dec 2019 10:10:30 +0000 Message-ID: References: <20191223083939.9669-1-Jack.Zhang1@amd.com>, In-Reply-To: Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Enabled=True; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SetDate=2019-12-23T10:10:29.876Z; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Name=Internal Distribution Only; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ContentBits=0; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Method=Standard; authentication-results: spf=none (sender IP is ) smtp.mailfrom=Kevin1.Wang@amd.com; x-originating-ip: [180.167.199.189] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a3bc61b6-5d6d-4cc0-e7a3-08d787905741 x-ms-traffictypediagnostic: MN2PR12MB4318:|MN2PR12MB4318: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0260457E99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(376002)(346002)(136003)(366004)(396003)(189003)(199004)(13464003)(66556008)(5660300002)(64756008)(19627405001)(71200400001)(7696005)(66574012)(6506007)(66946007)(53546011)(66476007)(110136005)(86362001)(76116006)(26005)(91956017)(52536014)(316002)(66446008)(186003)(33656002)(55016002)(4326008)(6636002)(8676002)(81156014)(9686003)(2906002)(478600001)(81166006)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB4318; H:MN2PR12MB3296.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ht0eaJivupmChRGGEMgI5TTirKMOLRvoopuDYuGipvF35XR41k3qUSzHQPkyxGxorVn2gnB1MIA+9Lmz1NJc9VxEpssJLLX2vF6ivDRNsiuRuSQMJaThtMNTqTBtvoF+r6qMvXLZFt3bfwNEO6RBrxXjRphyQgx6Uu8oe3LyjlBMAjGsIz9wVmExrNZ9pA+Ju67I7l4u1RPTydgWMP6L6eInbbXnhHx9OrJgHiiQzS19t4Bi8yCqYDDLfP7Vd5QT7cuYNj6E00S/Ig109LhCcHXqyttetwthwfXkzj7emG1q1xllOZ/+PHRui6+vNMtF3gr2eP2xFI0kIexvokUcxfpS2Nsj+dyEJcdCHQalz6i66thj2ElC7S6fdhY0nXRE5DcdpTx+e4ryC65ILpETlYHtjL27uKWYNa1+rgHQFG5vRTR8hrwBFpRyAPO3n59HriuLAoSbjAozFklfND00Xnufy7AsgV6foCRqW1PHfSzGol9m1rS+KCHqqgTqonIX MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3bc61b6-5d6d-4cc0-e7a3-08d787905741 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Dec 2019 10:10:30.3782 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UArbovhd+PMsmjXgH0rHwOLyoCOD51qAza3imMMbsBVhxXHpWx7wDQ4YOqnYO0yC X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4318 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Quan, Evan" Content-Type: multipart/mixed; boundary="===============0176392829==" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" --===============0176392829== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN2PR12MB3296FCACEC21D2A6B3F71FE4A22E0MN2PR12MB3296namp_" --_000_MN2PR12MB3296FCACEC21D2A6B3F71FE4A22E0MN2PR12MB3296namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - Internal Distribution Only] add @Quan, Evan to support arcturus asic. comment inline. ________________________________ From: Zhang, Jack (Jian) Sent: Monday, December 23, 2019 4:42 PM To: Feng, Kenneth ; Wang, Kevin(Yang) ; Tao, Yintian ; amd-gfx@lists.freedesktop.org <= amd-gfx@lists.freedesktop.org>; Deng, Emily Cc: Zhang, Jack (Jian) Subject: RE: [PATCH] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF -----Original Message----- From: Jack Zhang Sent: Monday, December 23, 2019 4:40 PM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Jack (Jian) Subject: [PATCH] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF Before, initialization of smu ip block would be skipped for sriov ASICs. Bu= t if there's only one VF being used, guest driver should be able to dump so= me HW info such as clks, temperature,etc. To solve this, now after onevf mode is enabled, host driver will notify gue= st. If it's onevf mode, guest will do smu hw_init and skip some steps in no= rmal smu hw_init flow because host driver has already done it for smu. With this fix, guest app can talk with smu and dump hw information from smu= . Signed-off-by: Jack Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 49 ++++++++++++++++++--------= ---- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/= amdgpu/amdgpu_psp.c index 8469834..08130a6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1448,7 +1448,8 @@ static int psp_np_fw_load(struct psp_context *psp) || ucode->ucode_id =3D=3D AMDGPU_UCODE_ID_RLC_G || ucode->ucode_id =3D=3D AMDGPU_UCODE_ID_RLC_RESTORE_= LIST_CNTL || ucode->ucode_id =3D=3D AMDGPU_UCODE_ID_RLC_RESTORE_= LIST_GPM_MEM - || ucode->ucode_id =3D=3D AMDGPU_UCODE_ID_RLC_RESTORE_L= IST_SRM_MEM)) + || ucode->ucode_id =3D=3D AMDGPU_UCODE_ID_RLC_RESTORE_L= IST_SRM_MEM + || ucode->ucode_id =3D=3D AMDGPU_UCODE_ID_SMC)) /*skip ucode loading in SRIOV VF */ continue; diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgp= u/soc15.c index b53d401..a271496 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -827,8 +827,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev) amdgpu_device_ip_block_add(adev, &dce_virtual_ip_b= lock); amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block); amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block); - if (!amdgpu_sriov_vf(adev)) - amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_bloc= k); + amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block); if (amdgpu_sriov_vf(adev)) { if (likely(adev->firmware.load_type =3D=3D AMDGPU_= FW_LOAD_PSP)) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/dri= vers/gpu/drm/amd/powerplay/amdgpu_smu.c index 936c682..c07fb26 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -531,10 +531,14 @@ bool is_support_sw_smu(struct amdgpu_device *adev) if (adev->asic_type =3D=3D CHIP_VEGA20) return (amdgpu_dpm =3D=3D 2) ? true : false; else if (adev->asic_type >=3D CHIP_ARCTURUS) { - if (amdgpu_sriov_vf(adev)) - return false; - else + if (amdgpu_sriov_vf(adev)) { + if(amdgpu_sriov_is_pp_one_vf(adev)) + return true; + else + return false; + } else { return true; + } } else return false; } @@ -1062,20 +1066,19 @@ static int smu_smc_table_hw_init(struct smu_context= *smu, } /* smu_dump_pptable(smu); */ + if(amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)){ + /* + * Copy pptable bo in the vram to smc with SMU MSGs such as + * SetDriverDramAddr and TransferTableDram2Smu. + */ [kevin]: this comment is not neccessary in smu module. and could you describe the function of pp_one_vf and sriov_vf ? it is useful to help us understand your patch. thanks. + ret =3D smu_write_pptable(smu); + if (ret) + return ret; - /* - * Copy pptable bo in the vram to smc with SMU MSGs such as - * SetDriverDramAddr and TransferTableDram2Smu. - */ - ret =3D smu_write_pptable(smu); - if (ret) - return ret; - - /* issue Run*Btc msg */ - ret =3D smu_run_btc(smu); - if (ret) - return ret; - + /* issue Run*Btc msg */ + ret =3D smu_run_btc(smu); + if (ret) + return ret; ret =3D smu_feature_set_allowed_mask(smu); if (ret) return ret; @@ -1083,7 +1086,7 @@ static int smu_smc_table_hw_init(struct smu_context *= smu, ret =3D smu_system_features_control(smu, true); if (ret) return ret; - + } if (adev->asic_type !=3D CHIP_ARCTURUS) { ret =3D smu_notify_display_change(smu); if (ret) @@ -1136,8 +1139,9 @@ static int smu_smc_table_hw_init(struct smu_context *= smu, /* * Set PMSTATUSLOG table bo address with SetToolsDramAddr MSG for = tools. */ - ret =3D smu_set_tool_table_location(smu); - + if(amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)){ + ret =3D smu_set_tool_table_location(smu); + } if (!smu_is_dpm_running(smu)) pr_info("dpm has been disabled\n"); @@ -1249,6 +1253,13 @@ static int smu_hw_init(void *handle) smu_set_gfx_cgpg(&adev->smu, true); } + if (amdgpu_sriov_vf(adev)) { + if(amdgpu_sriov_is_pp_one_vf(adev)) + smu->pm_enabled =3D true; + else + smu->pm_enabled =3D false; + } + [kevin]: the variable of "smu->pm_enabeld" is initialize in smu_eary_init(), it is o= nly depend on module param amdgpu_dpm. after initialized, this variable should not be changed arbitrarily. so i hope you can refine the above code logic. if (!smu->pm_enabled) return 0; -- 2.7.4 --_000_MN2PR12MB3296FCACEC21D2A6B3F71FE4A22E0MN2PR12MB3296namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only - Internal Distribution Only]


add @Quan, Evan to support arcturus asic.
comment inline.

From: Zhang, Jack (Jian) &l= t;Jack.Zhang1@amd.com>
Sent: Monday, December 23, 2019 4:42 PM
To: Feng, Kenneth <Kenneth.Feng@amd.com>; Wang, Kevin(Yang) &l= t;Kevin1.Wang@amd.com>; Tao, Yintian <Yintian.Tao@amd.com>; amd-gf= x@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Deng, Emily = <Emily.Deng@amd.com>
Cc: Zhang, Jack (Jian) <Jack.Zhang1@amd.com>
Subject: RE: [PATCH] amd/amdgpu/sriov enable onevf mode for ARCTURUS= VF
 


-----Original Message-----
From: Jack Zhang <Jack.Zhang1@amd.com>
Sent: Monday, December 23, 2019 4:40 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Jack (Jian) <Jack.Zhang1@amd.com>
Subject: [PATCH] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

Before, initialization of smu ip block would be skipped for sriov ASICs. Bu= t if there's only one VF being used, guest driver should be able to dump so= me HW info such as clks, temperature,etc.

To solve this, now after onevf mode is enabled, host driver will notify gue= st. If it's onevf mode, guest will do smu hw_init and skip some steps in no= rmal smu hw_init flow because host driver has already done it for smu.

With this fix, guest app can talk with smu and dump hw information from smu= .

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    |  3 &= #43;-
 drivers/gpu/drm/amd/amdgpu/soc15.c      = ;   |  3 +-
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 49 ++++&= #43;+++++++++++++------= ------
 3 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/= amdgpu/amdgpu_psp.c
index 8469834..08130a6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1448,7 +1448,8 @@ static int psp_np_fw_load(struct psp_context *psp= )
            &nb= sp;        || ucode->ucode_id =3D=3D = AMDGPU_UCODE_ID_RLC_G
            &nb= sp;        || ucode->ucode_id =3D=3D = AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL
            &nb= sp;        || ucode->ucode_id =3D=3D = AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM
-            &n= bsp;      || ucode->ucode_id =3D=3D AMDGPU_UCOD= E_ID_RLC_RESTORE_LIST_SRM_MEM))
+           &nbs= p;       || ucode->ucode_id =3D=3D AMDGPU_= UCODE_ID_RLC_RESTORE_LIST_SRM_MEM
+           &nbs= p;       || ucode->ucode_id =3D=3D AMDGPU_= UCODE_ID_SMC))
            &nb= sp;            /*ski= p ucode loading in SRIOV VF */
            &nb= sp;            conti= nue;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgp= u/soc15.c
index b53d401..a271496 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -827,8 +827,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)=
            &nb= sp;            amdgp= u_device_ip_block_add(adev, &dce_virtual_ip_block);
            &nb= sp;    amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_blo= ck);
            &nb= sp;    amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_bl= ock);
-            &n= bsp;  if (!amdgpu_sriov_vf(adev))
-            &n= bsp;          amdgpu_device_ip= _block_add(adev, &smu_v11_0_ip_block);
+           &nbs= p;   amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);  
            &nb= sp;    if (amdgpu_sriov_vf(adev)) {
            &nb= sp;            if (l= ikely(adev->firmware.load_type =3D=3D AMDGPU_FW_LOAD_PSP)) diff --git a/= drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/= amdgpu_smu.c
index 936c682..c07fb26 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -531,10 +531,14 @@ bool is_support_sw_smu(struct amdgpu_device *adev= )
         if (adev->asic_type =3D= =3D CHIP_VEGA20)
            &nb= sp;    return (amdgpu_dpm =3D=3D 2) ? true : false;
         else if (adev->asic_typ= e >=3D CHIP_ARCTURUS) {
-            &n= bsp;  if (amdgpu_sriov_vf(adev))
-            &n= bsp;          return false; -            &n= bsp;  else
+           &nbs= p;   if (amdgpu_sriov_vf(adev)) {
+           &nbs= p;           if(amdgpu_sr= iov_is_pp_one_vf(adev))
+           &nbs= p;            &= nbsp;      return true;
+           &nbs= p;           else
+           &nbs= p;            &= nbsp;      return false;
+           &nbs= p;   } else {
            &nb= sp;            retur= n true;
+           &nbs= p;   }
         } else
            &nb= sp;    return false;
 }
@@ -1062,20 +1066,19 @@ static int smu_smc_table_hw_init(struct smu_con= text *smu,
         }
 
         /* smu_dump_pptable(smu); = */
+       if(amdgpu_sriov_vf(adev) &&am= p; !amdgpu_sriov_is_pp_one_vf(adev)){
+           &nbs= p;   /*
+           &nbs= p;    * Copy pptable bo in the vram to smc with SMU MSGs suc= h as
+           &nbs= p;    * SetDriverDramAddr and TransferTableDram2Smu.
+           &nbs= p;    */
[kevin]: this comment is not neccessary in smu mod= ule.
and could you describe the function of pp_on= e_vf and sriov_vf ?
it is useful to help us understand your patc= h. 
thanks.

+       &nb= sp;       ret =3D smu_write_pptable(smu);
+           &nbs= p;   if (ret)
+           &nbs= p;           return ret;<= br>  
-       /*
-        * Copy pptable bo in the vram t= o smc with SMU MSGs such as
-        * SetDriverDramAddr and Transfe= rTableDram2Smu.
-        */
-       ret =3D smu_write_pptable(smu);
-       if (ret)
-            &n= bsp;  return ret;
-
-       /* issue Run*Btc msg */
-       ret =3D smu_run_btc(smu);
-       if (ret)
-            &n= bsp;  return ret;
-
+           &nbs= p;   /* issue Run*Btc msg */
+           &nbs= p;   ret =3D smu_run_btc(smu);
+           &nbs= p;   if (ret)
+           &nbs= p;           return ret;<= br>          ret =3D smu_feature_set_al= lowed_mask(smu);
         if (ret)
            &nb= sp;    return ret;
@@ -1083,7 +1086,7 @@ static int smu_smc_table_hw_init(struct smu_conte= xt *smu,
         ret =3D smu_system_feature= s_control(smu, true);
         if (ret)
            &nb= sp;    return ret;
-
+       }
         if (adev->asic_type != =3D CHIP_ARCTURUS) {
            &nb= sp;    ret =3D smu_notify_display_change(smu);
            &nb= sp;    if (ret)
@@ -1136,8 +1139,9 @@ static int smu_smc_table_hw_init(struct smu_conte= xt *smu,
         /*
          * Set PMSTATUSLOG ta= ble bo address with SetToolsDramAddr MSG for tools.
          */
-       ret =3D smu_set_tool_table_location(s= mu);
-
+       if(amdgpu_sriov_vf(adev) &&am= p; !amdgpu_sriov_is_pp_one_vf(adev)){
+           &nbs= p;   ret =3D smu_set_tool_table_location(smu);
+       }
         if (!smu_is_dpm_running(sm= u))
            &nb= sp;    pr_info("dpm has been disabled\n");
 
@@ -1249,6 +1253,13 @@ static int smu_hw_init(void *handle)
            &nb= sp;    smu_set_gfx_cgpg(&adev->smu, true);
         }
 
+       if (amdgpu_sriov_vf(adev)) {
+           &nbs= p;   if(amdgpu_sriov_is_pp_one_vf(adev))
+           &nbs= p;           smu->pm_e= nabled =3D true;
+           &nbs= p;   else
+           &nbs= p;           smu->pm_e= nabled =3D false;
+       }
+

[kevin]:
the variable of "smu->pm_enabeld" is = initialize in smu_eary_init(), it is only depend on module param amdgpu_dpm= .
after initialized, this variable should not be changed arbitrarily.
so i hope you can refine the above code logic.<= /div>

         i= f (!smu->pm_enabled)
            &nb= sp;    return 0;
 
--
2.7.4

--_000_MN2PR12MB3296FCACEC21D2A6B3F71FE4A22E0MN2PR12MB3296namp_-- --===============0176392829== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx --===============0176392829==--