From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ma, Le" Subject: RE: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in baco entry/exit helper Date: Wed, 27 Nov 2019 12:14:02 +0000 Message-ID: References: <1574846129-4826-1-git-send-email-le.ma@amd.com> <1574846129-4826-4-git-send-email-le.ma@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0521228470==" Return-path: In-Reply-To: Content-Language: en-US List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: "Zhang, Hawking" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" Cc: "Deucher, Alexander" , "Zhou1, Tao" , "Li, Dennis" , "Chen, Guchun" --===============0521228470== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_" --_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_ Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable From: Zhang, Hawking Sent: Wednesday, November 27, 2019 8:04 PM To: Ma, Le ; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Cc: Chen, Guchun ; Zhou1, Tao ; Li,= Dennis ; Deucher, Alexander = ; Ma, Le Subject: RE: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in= baco entry/exit helper Please check my comments inline Regards, Hawking -----Original Message----- From: Le Ma > Sent: 2019=1B$BG/=1B(B11=1B$B7n=1B(B27=1B$BF|=1B(B 17:15 To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Cc: Zhang, Hawking >; C= hen, Guchun >; Zhou1, Tao <= Tao.Zhou1-5C7GfCeVMHo@public.gmane.org>; Li, Dennis >; Deucher, Alexander >; Ma, Le > Subject: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in bac= o entry/exit helper This operation is needed when baco entry/exit for ras recovery Change-Id: I535c7231693f3138a8e3d5acd55672e2ac68232f Signed-off-by: Le Ma > --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_device.c index b1408c5..bd387bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4308,10 +4308,14 @@ static void amdgpu_device_get_pcie_info(struct amdg= pu_device *adev) int amdgpu_device_baco_enter(struct drm_device *dev) { struct amdgpu_device *adev =3D dev->dev_private; + struct amdgpu_ras *ras =3D amdgpu_ras_get_context(adev); if (!amdgpu_device_supports_baco(adev->ddev)) return -ENOTSUPP; + if (ras && ras->supported) + adev->nbio.funcs->enable_doorbell_interrupt(a= dev, false); + if (is_support_sw_smu(adev)) { struct smu_context *smu =3D &adev->smu; int ret; @@ -4319,8 +4323,6 @@ int amdgpu_device_baco_enter(struct drm_device *dev) ret =3D smu_baco_enter(smu); if (ret) return ret; - - return 0; } else { void *pp_handle =3D adev->powerplay.pp_handl= e; const struct amd_pm_funcs *pp_funcs =3D adev= ->powerplay.pp_funcs; @@ -4331,14 +4333,15 @@ int amdgpu_device_baco_enter(= struct drm_device *dev) /* enter BACO state */ if (pp_funcs->set_asic_baco_state(pp_handle,= 1)) return -EIO; - - return 0; } + + return 0; } int amdgpu_device_baco_exit(struct drm_device *dev) { struct amdgpu_device *adev =3D dev->dev_private; + struct amdgpu_ras *ras =3D amdgpu_ras_get_context(adev); if (!amdgpu_device_supports_baco(adev->ddev)) return -ENOTSUPP; @@ -4351,7 +4354,6 @@ int amdgpu_device_baco_exit(struct drm_device *dev) if (ret) return ret; - return 0; } else { void *pp_handle =3D adev->powerplay.pp_handl= e; const struct amd_pm_funcs *pp_funcs =3D adev= ->powerplay.pp_funcs; @@ -4362,7 +4364,10 @@ int amdgpu_device_baco_exit(st= ruct drm_device *dev) /* exit BACO state */ if (pp_funcs->set_asic_baco_state(pp_handle,= 0)) return -EIO; - - return 0; } + + if (ras && ras->supported) + adev->nbio.funcs->enable_doorbell_interrupt(a= dev, false); + [Hawking] Shouldn't be enabled doorbell interrupt after exit baco? Or do I = miss something? [Le]: Yes, the argument should be true. I made a typo here. + return 0; } -- 2.7.4 --_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_ Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable

 

 

From: Zhang, Hawking <Hawking.Zhang-urvtwAKJhsc@public.gmane.org= m>
Sent: Wednesday, November 27, 2019 8:04 PM
To: Ma, Le <Le.Ma-5C7GfCeVMHo@public.gmane.org>; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Chen, Guchun <Guchun.Chen-5C7GfCeVMHo@public.gmane.org>; Zhou1, Tao <Tao.Zho= u1-5C7GfCeVMHo@public.gmane.org>; Li, Dennis <Dennis.Li-5C7GfCeVMHo@public.gmane.org>; Deucher, Alexander &l= t;Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>; Ma, Le <Le.Ma-5C7GfCeVMHo@public.gmane.org>
Subject: RE: [PATCH 05/10] drm/amdgpu: enable/disable doorbell inter= rupt in baco entry/exit helper

=  

Please check my comments inline

 

Regards,
Hawking

 

-----Original Message-----
From: Le Ma <le.ma-5C7GfCeVMHo@public.gmane.org>
Sent: 2019=1B$BG/=1B(B<= /span>11=1B$B7n=1B(B27=1B$BF|=1B(B 17:15
To: amd-gfx-PD4FTy7X32lzq7FAFJ/aeQ@public.gmane.org= top.org
Cc: Zhang, Hawking <Hawking.Zha= ng-5C7GfCeVMHo@public.gmane.org>; Chen, Guchun <Guchun.Chen-5C7GfCeVMHo@public.gmane.org>; Zhou1, Tao <Tao.Zhou1-5C7GfCeVMHo@public.gmane.org>; Li, Dennis <Dennis.Li-5C7GfCeVMHo@public.gmane.org>; Deucher, Alexander <Alexan= der.Deucher-5C7GfCeVMHo@public.gmane.org>; Ma, Le <Le= .Ma-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in bac= o entry/exit helper

 

This operation is needed when baco entry/exit for= ras recovery

 

Change-Id: I535c7231693f3138a8e3d5acd55672e2ac682= 32f

Signed-off-by: Le Ma <le.ma-urvtwAKJhsc@public.gmane.org= m>

---

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 &= #43;+++++++++++-------

1 file changed, 12 insertions(+), 7 deletions= (-)

 

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_de= vice.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index b1408c5..bd387bb 100644

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<= o:p>

+++ b/drivers/gpu/drm/amd/amdgpu/amdg= pu_device.c

@@ -4308,10 +4308,14 @@ static void amdgpu_de= vice_get_pcie_info(struct amdgpu_device *adev)  int amdgpu_device_baco= _enter(struct drm_device *dev)  {

        &= nbsp;      struct amdgpu_device *adev =3D dev->= dev_private;

+       &n= bsp;     struct amdgpu_ras *ras =3D amdgpu_ras_get_cont= ext(adev);

 

        &= nbsp;       if (!amdgpu_device_supports_baco(= adev->ddev))

        &= nbsp;           &nbs= p;          return -ENOTSUPP;<= o:p>

 

+       &n= bsp;     if (ras && ras->supported)

+       &n= bsp;            = ;         adev->nbio.funcs->e= nable_doorbell_interrupt(adev, false);

+

        &= nbsp;      if (is_support_sw_smu(adev)) {

        &= nbsp;           &nbs= p;          struct smu_context= *smu =3D &adev->smu;

        &= nbsp;           &nbs= p;          int ret;

@@ -4319,8 +4323,6 @@ int amdgpu_device_baco_= enter(struct drm_device *dev)

        &= nbsp;           &nbs= p;          ret =3D smu_baco_e= nter(smu);

        &= nbsp;           &nbs= p;          if (ret)

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return ret;

-

-        =             &nb= sp;         return 0;

        &= nbsp;      } else {

        &= nbsp;           &nbs= p;          void *pp_handle = =3D adev->powerplay.pp_handle;

        &= nbsp;           &nbs= p;          const struct amd_p= m_funcs *pp_funcs =3D adev->powerplay.pp_funcs; @@ -4331,14 +4333,15= @@ int amdgpu_device_baco_enter(struct drm_device *dev)

        &= nbsp;           &nbs= p;          /* enter BACO stat= e */

        &= nbsp;           &nbs= p;          if (pp_funcs->s= et_asic_baco_state(pp_handle, 1))

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return -EIO;

-

-        =             &nb= sp;         return 0;

        &= nbsp;      }

+

+       &n= bsp;     return 0;

}

 

 int amdgpu_device_baco_exit(struct drm_devi= ce *dev)  {

        &= nbsp;      struct amdgpu_device *adev =3D dev->= dev_private;

+       &n= bsp;     struct amdgpu_ras *ras =3D amdgpu_ras_get_cont= ext(adev);

 

        &= nbsp;       if (!amdgpu_device_supports_baco(= adev->ddev))

        &= nbsp;           &nbs= p;          return -ENOTSUPP;<= o:p>

@@ -4351,7 +4354,6 @@ int amdgpu_device_baco_= exit(struct drm_device *dev)

        &= nbsp;           &nbs= p;          if (ret)

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return ret;

 

-        =             &nb= sp;         return 0;

        &= nbsp;      } else {

        &= nbsp;           &nbs= p;          void *pp_handle = =3D adev->powerplay.pp_handle;

        &= nbsp;           &nbs= p;          const struct amd_p= m_funcs *pp_funcs =3D adev->powerplay.pp_funcs; @@ -4362,7 +4364,10 = @@ int amdgpu_device_baco_exit(struct drm_device *dev)

        &= nbsp;           &nbs= p;          /* exit BACO state= */

        &= nbsp;           &nbs= p;          if (pp_funcs->s= et_asic_baco_state(pp_handle, 0))

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return -EIO;

-

-        =             &nb= sp;         return 0;

        &= nbsp;      }

+

+       &n= bsp;     if (ras && ras->supported)

+       &n= bsp;            = ;         adev->nbio.funcs->e= nable_doorbell_interrupt(adev, false);

+

 

 

[Hawking] Shouldn't= be enabled doorbell interrupt after exit baco? Or do I miss something?

 

[Le]: Yes, the argument should be true. I made a = typo here.

 

+       &n= bsp;     return 0;

}

--

2.7.4

 

--_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_-- --===============0521228470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4 --===============0521228470==-- 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.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_KAM_HTML_FONT_INVALID 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 53D55C432C0 for ; Wed, 27 Nov 2019 12:14:11 +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 258722068E for ; Wed, 27 Nov 2019 12:14:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 258722068E 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 C840D89C05; Wed, 27 Nov 2019 12:14:10 +0000 (UTC) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680050.outbound.protection.outlook.com [40.107.68.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 494AC89C05 for ; Wed, 27 Nov 2019 12:14:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KCz7eDR5C/merjr7z6dY+4ja7qNuarqkKiSvp5xnp/Hb0Ga+ZQMeMP5zkDsoXrNCxQJW2IjrDvLNR8P7B1Ixdr54DntwbTHXTkCdRlOkTSBR/pLYX4sM/0uFHb4oI5lB8vfYsp3gioZh6j8gZNpDpuDAP7PMEe4RjJwHpEx/ESZeNpEOOw8WO631DKUe4gYm9splGWAVdiRMjCMm6oCrkPz/wvtpppRCmSyCfPyD/T5Rf5RRhdy+semsnwI+SFv0H9fECtr5mhabPeyTc6NS41j9TgUBS99KC9V8EnUTrnNBmsbQGZNiGTp45RERxAHydp93q+UIO0DvzejFFl/5QQ== 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=ss+MR9JoRgNreYXG6vQiTX8f97dO0Z1EeaGj4W31HkY=; b=XCEoxY/jEtta2yxYyBaQnYN5dsoLrgxWoDBPgNZKjAQ7LO3Dt/NyNEOWJSAT3G1zeclAYf1X9MZj0BbSNUr61KPkpSv8TUL+jw+fcwJwsbcVL61mKQzsViOy5fVYliLq6pRM/1Edx8cwgaIx5+F//kvd8LDsBnEcNCUJlnSDzQgPbMEPWjgcgA6lMtQfmTdFettz2IEYSuNDtji2CDmR31x/lni12KQmBRiKRk+Q210W4i9E/58dUllx1DB3alzTJiTDZb+um4nCMADDmL8ZEFiUY49gm+Zh7uJm5FJETUSpt2MsCZsha/CUWL0MCP7v1iOGeYD3wNHLDfVtBO/J6g== 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 Received: from MN2PR12MB4285.namprd12.prod.outlook.com (52.135.49.140) by MN2PR12MB3936.namprd12.prod.outlook.com (10.255.238.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.24; Wed, 27 Nov 2019 12:14:04 +0000 Received: from MN2PR12MB4285.namprd12.prod.outlook.com ([fe80::b4d9:8cb3:3876:ed5]) by MN2PR12MB4285.namprd12.prod.outlook.com ([fe80::b4d9:8cb3:3876:ed5%6]) with mapi id 15.20.2495.014; Wed, 27 Nov 2019 12:14:02 +0000 From: "Ma, Le" To: "Zhang, Hawking" , "amd-gfx@lists.freedesktop.org" Subject: RE: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in baco entry/exit helper Thread-Topic: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in baco entry/exit helper Thread-Index: AQHVpQNEhgaUyPJRWUGLrnUUz2V006ee64OAgAACDrA= Date: Wed, 27 Nov 2019 12:14:02 +0000 Message-ID: References: <1574846129-4826-1-git-send-email-le.ma@amd.com> <1574846129-4826-4-git-send-email-le.ma@amd.com> In-Reply-To: Accept-Language: en-US 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_SetDate=2019-11-27T12:04:05Z; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Method=Standard; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Name=Internal Use Only - Unrestricted; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ActionId=bba7b64e-a35b-4685-8bb6-00007dff43d1; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ContentBits=1 x-originating-ip: [180.167.199.189] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 3b4d42bf-5953-4954-1fd0-08d773334a53 x-ms-traffictypediagnostic: MN2PR12MB3936:|MN2PR12MB3936: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 023495660C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(366004)(376002)(346002)(39860400002)(13464003)(189003)(199004)(33656002)(4326008)(81156014)(66556008)(2501003)(8936002)(81166006)(6246003)(236005)(14454004)(64756008)(446003)(6436002)(8676002)(66476007)(66446008)(478600001)(2906002)(66946007)(76116006)(5660300002)(52536014)(99286004)(7736002)(86362001)(74316002)(110136005)(54896002)(9686003)(316002)(54906003)(256004)(66066001)(186003)(229853002)(11346002)(6306002)(26005)(53546011)(6506007)(102836004)(55016002)(71190400001)(71200400001)(7696005)(3846002)(25786009)(76176011)(6116002)(790700001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3936; H:MN2PR12MB4285.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: rb09/p+oyDI6iiubDTMBpfnTKaM6Q1uILNZ6Ci21njLkoaFLU+lj9YXln9uKqLRGhvwqoCggrb4FhYb4keRz1T79U81GS52lu6+EkJ7crEqz21SzomZgwPl2N2y0MEh35DDi+9YbCSqiLbE9rYaEqsD1+8cZ4P5rQ4CU/hAq64L2rZ82MD5bKjWxuosssoroh5txwqgmUyfmyBN9i3qQvo74hapE/SA2A/senXOH+a1apqLM7RvyshONOdJ9qYV6VckqRiextUKNPLQpLt0tM09TkiFLWgrbAWq/5ZpP7RKSGbM/fuKINdRLKk/6X0MS6O2CeOFod39cQghXavKtJ/zSqfrX5qmabLVaW6oH0QpzdiePIMnc49s56febJfBfRWRTZlLPnKNqaBYXI5LrxSZvXZ2ppicnSsIUo2tcCEHz5GvQtfHG6ZG/FDdOT0BW MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b4d42bf-5953-4954-1fd0-08d773334a53 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Nov 2019 12:14:02.2358 (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: 1+S1N1S+1dUoUZDTsMw64IZon4MfrOJAVoRo1qnLtkTpSHtUNp7R/sOmZh4xjCZF X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3936 X-Mailman-Original-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=ss+MR9JoRgNreYXG6vQiTX8f97dO0Z1EeaGj4W31HkY=; b=r/N90dbsxF8kgdDbwpO2K3b4XCN5G4bCLv2aGeq0DH681xEy0MptnABM1E2I7yn5bKVYOFzOYLB/WJHamyLSSzrGw9DoS013WvUIj2E4pKN4QOfCZXC19fviW0SifReQMZly3IYlguXqmD0bT23E/3VLV5nyaxKCE6aTlgd4eIA= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Le.Ma@amd.com; X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Deucher, Alexander" , "Zhou1, Tao" , "Li, Dennis" , "Chen, Guchun" Content-Type: multipart/mixed; boundary="===============0521228470==" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" Message-ID: <20191127121402.J7WlLEg6CvlVEy6f9VLMhPeG70fQ7RkIWCJvr9e7DyQ@z> --===============0521228470== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_" --_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_ Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable From: Zhang, Hawking Sent: Wednesday, November 27, 2019 8:04 PM To: Ma, Le ; amd-gfx@lists.freedesktop.org Cc: Chen, Guchun ; Zhou1, Tao ; Li,= Dennis ; Deucher, Alexander = ; Ma, Le Subject: RE: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in= baco entry/exit helper Please check my comments inline Regards, Hawking -----Original Message----- From: Le Ma > Sent: 2019=1B$BG/=1B(B11=1B$B7n=1B(B27=1B$BF|=1B(B 17:15 To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking >; C= hen, Guchun >; Zhou1, Tao <= Tao.Zhou1@amd.com>; Li, Dennis >; Deucher, Alexander >; Ma, Le > Subject: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in bac= o entry/exit helper This operation is needed when baco entry/exit for ras recovery Change-Id: I535c7231693f3138a8e3d5acd55672e2ac68232f Signed-off-by: Le Ma > --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_device.c index b1408c5..bd387bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4308,10 +4308,14 @@ static void amdgpu_device_get_pcie_info(struct amdg= pu_device *adev) int amdgpu_device_baco_enter(struct drm_device *dev) { struct amdgpu_device *adev =3D dev->dev_private; + struct amdgpu_ras *ras =3D amdgpu_ras_get_context(adev); if (!amdgpu_device_supports_baco(adev->ddev)) return -ENOTSUPP; + if (ras && ras->supported) + adev->nbio.funcs->enable_doorbell_interrupt(a= dev, false); + if (is_support_sw_smu(adev)) { struct smu_context *smu =3D &adev->smu; int ret; @@ -4319,8 +4323,6 @@ int amdgpu_device_baco_enter(struct drm_device *dev) ret =3D smu_baco_enter(smu); if (ret) return ret; - - return 0; } else { void *pp_handle =3D adev->powerplay.pp_handl= e; const struct amd_pm_funcs *pp_funcs =3D adev= ->powerplay.pp_funcs; @@ -4331,14 +4333,15 @@ int amdgpu_device_baco_enter(= struct drm_device *dev) /* enter BACO state */ if (pp_funcs->set_asic_baco_state(pp_handle,= 1)) return -EIO; - - return 0; } + + return 0; } int amdgpu_device_baco_exit(struct drm_device *dev) { struct amdgpu_device *adev =3D dev->dev_private; + struct amdgpu_ras *ras =3D amdgpu_ras_get_context(adev); if (!amdgpu_device_supports_baco(adev->ddev)) return -ENOTSUPP; @@ -4351,7 +4354,6 @@ int amdgpu_device_baco_exit(struct drm_device *dev) if (ret) return ret; - return 0; } else { void *pp_handle =3D adev->powerplay.pp_handl= e; const struct amd_pm_funcs *pp_funcs =3D adev= ->powerplay.pp_funcs; @@ -4362,7 +4364,10 @@ int amdgpu_device_baco_exit(st= ruct drm_device *dev) /* exit BACO state */ if (pp_funcs->set_asic_baco_state(pp_handle,= 0)) return -EIO; - - return 0; } + + if (ras && ras->supported) + adev->nbio.funcs->enable_doorbell_interrupt(a= dev, false); + [Hawking] Shouldn't be enabled doorbell interrupt after exit baco? Or do I = miss something? [Le]: Yes, the argument should be true. I made a typo here. + return 0; } -- 2.7.4 --_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_ Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable

 

 

From: Zhang, Hawking <Hawking.Zhang@amd.co= m>
Sent: Wednesday, November 27, 2019 8:04 PM
To: Ma, Le <Le.Ma@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Chen, Guchun <Guchun.Chen@amd.com>; Zhou1, Tao <Tao.Zho= u1@amd.com>; Li, Dennis <Dennis.Li@amd.com>; Deucher, Alexander &l= t;Alexander.Deucher@amd.com>; Ma, Le <Le.Ma@amd.com>
Subject: RE: [PATCH 05/10] drm/amdgpu: enable/disable doorbell inter= rupt in baco entry/exit helper

=  

Please check my comments inline

 

Regards,
Hawking

 

-----Original Message-----
From: Le Ma <le.ma@amd.com>
Sent: 2019=1B$BG/=1B(B<= /span>11=1B$B7n=1B(B27=1B$BF|=1B(B 17:15
To: amd-gfx@lists.freedesk= top.org
Cc: Zhang, Hawking <Hawking.Zha= ng@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Li, Dennis <Dennis.Li@amd.com>; Deucher, Alexander <Alexan= der.Deucher@amd.com>; Ma, Le <Le= .Ma@amd.com>
Subject: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in bac= o entry/exit helper

 

This operation is needed when baco entry/exit for= ras recovery

 

Change-Id: I535c7231693f3138a8e3d5acd55672e2ac682= 32f

Signed-off-by: Le Ma <le.ma@amd.co= m>

---

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 &= #43;+++++++++++-------

1 file changed, 12 insertions(+), 7 deletions= (-)

 

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_de= vice.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index b1408c5..bd387bb 100644

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<= o:p>

+++ b/drivers/gpu/drm/amd/amdgpu/amdg= pu_device.c

@@ -4308,10 +4308,14 @@ static void amdgpu_de= vice_get_pcie_info(struct amdgpu_device *adev)  int amdgpu_device_baco= _enter(struct drm_device *dev)  {

        &= nbsp;      struct amdgpu_device *adev =3D dev->= dev_private;

+       &n= bsp;     struct amdgpu_ras *ras =3D amdgpu_ras_get_cont= ext(adev);

 

        &= nbsp;       if (!amdgpu_device_supports_baco(= adev->ddev))

        &= nbsp;           &nbs= p;          return -ENOTSUPP;<= o:p>

 

+       &n= bsp;     if (ras && ras->supported)

+       &n= bsp;            = ;         adev->nbio.funcs->e= nable_doorbell_interrupt(adev, false);

+

        &= nbsp;      if (is_support_sw_smu(adev)) {

        &= nbsp;           &nbs= p;          struct smu_context= *smu =3D &adev->smu;

        &= nbsp;           &nbs= p;          int ret;

@@ -4319,8 +4323,6 @@ int amdgpu_device_baco_= enter(struct drm_device *dev)

        &= nbsp;           &nbs= p;          ret =3D smu_baco_e= nter(smu);

        &= nbsp;           &nbs= p;          if (ret)

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return ret;

-

-        =             &nb= sp;         return 0;

        &= nbsp;      } else {

        &= nbsp;           &nbs= p;          void *pp_handle = =3D adev->powerplay.pp_handle;

        &= nbsp;           &nbs= p;          const struct amd_p= m_funcs *pp_funcs =3D adev->powerplay.pp_funcs; @@ -4331,14 +4333,15= @@ int amdgpu_device_baco_enter(struct drm_device *dev)

        &= nbsp;           &nbs= p;          /* enter BACO stat= e */

        &= nbsp;           &nbs= p;          if (pp_funcs->s= et_asic_baco_state(pp_handle, 1))

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return -EIO;

-

-        =             &nb= sp;         return 0;

        &= nbsp;      }

+

+       &n= bsp;     return 0;

}

 

 int amdgpu_device_baco_exit(struct drm_devi= ce *dev)  {

        &= nbsp;      struct amdgpu_device *adev =3D dev->= dev_private;

+       &n= bsp;     struct amdgpu_ras *ras =3D amdgpu_ras_get_cont= ext(adev);

 

        &= nbsp;       if (!amdgpu_device_supports_baco(= adev->ddev))

        &= nbsp;           &nbs= p;          return -ENOTSUPP;<= o:p>

@@ -4351,7 +4354,6 @@ int amdgpu_device_baco_= exit(struct drm_device *dev)

        &= nbsp;           &nbs= p;          if (ret)

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return ret;

 

-        =             &nb= sp;         return 0;

        &= nbsp;      } else {

        &= nbsp;           &nbs= p;          void *pp_handle = =3D adev->powerplay.pp_handle;

        &= nbsp;           &nbs= p;          const struct amd_p= m_funcs *pp_funcs =3D adev->powerplay.pp_funcs; @@ -4362,7 +4364,10 = @@ int amdgpu_device_baco_exit(struct drm_device *dev)

        &= nbsp;           &nbs= p;          /* exit BACO state= */

        &= nbsp;           &nbs= p;          if (pp_funcs->s= et_asic_baco_state(pp_handle, 0))

        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p; return -EIO;

-

-        =             &nb= sp;         return 0;

        &= nbsp;      }

+

+       &n= bsp;     if (ras && ras->supported)

+       &n= bsp;            = ;         adev->nbio.funcs->e= nable_doorbell_interrupt(adev, false);

+

 

 

[Hawking] Shouldn't= be enabled doorbell interrupt after exit baco? Or do I miss something?

 

[Le]: Yes, the argument should be true. I made a = typo here.

 

+       &n= bsp;     return 0;

}

--

2.7.4

 

--_000_MN2PR12MB4285A41D146EDAAE4918FB78F6440MN2PR12MB4285namp_-- --===============0521228470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4 --===============0521228470==--