All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Liu, Monk" <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
	<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: RE: [PATCH 3/6] drm/amdgpu:re-write sriov_reinit_early/late
Date: Wed, 3 May 2017 09:10:11 +0000	[thread overview]
Message-ID: <DM5PR12MB1610B39D23F8DC3CBCD18A3784160@DM5PR12MB1610.namprd12.prod.outlook.com> (raw)
In-Reply-To: <fe18ce3e-dc63-412b-7dbb-aa5265dfad9f-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>

It's correct and already working  on vega10/tonga for days, 
In fact the guilty context already works at my side 

BR Monk



-----Original Message-----
From: Christian König [mailto:deathsimple@vodafone.de] 
Sent: Wednesday, May 03, 2017 5:02 PM
To: Liu, Monk <Monk.Liu@amd.com>; amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/6] drm/amdgpu:re-write sriov_reinit_early/late

Am 03.05.2017 um 05:48 schrieb Monk Liu:
> 1,this way we make those routines compatible with the sequence
>    requirment for both Tonga and Vega10 2,ignore PSP hw init when 
> doing TDR, because for SR-IOV device the ucode won't get lost after VF 
> FLR, so no need to invoke PSP doing the ucode reloading again.
>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 63 ++++++++++++++++++------------
>   1 file changed, 39 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 5161c20..5573792 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1718,19 +1718,27 @@ static int amdgpu_sriov_reinit_early(struct amdgpu_device *adev)
>   {
>   	int i, r;
>   
> -	for (i = 0; i < adev->num_ip_blocks; i++) {
> -		if (!adev->ip_blocks[i].status.valid)
> -			continue;
> -
> -		if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON ||
> -				adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC ||
> -				adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH)
> -			r = adev->ip_blocks[i].version->funcs->hw_init(adev);
> +	static enum amd_ip_block_type ip_order[] = {
> +		AMD_IP_BLOCK_TYPE_GMC,
> +		AMD_IP_BLOCK_TYPE_COMMON,
> +		AMD_IP_BLOCK_TYPE_GFXHUB,
> +		AMD_IP_BLOCK_TYPE_MMHUB,
> +		AMD_IP_BLOCK_TYPE_IH,
> +	};
> +
> +	for (i = 0; i < sizeof(ip_order)/sizeof(ip_order[0]); i++) {

You should use ARRAY_SIZE here instead.

> +		int j;
> +		struct amdgpu_ip_block *block;
> +
> +		for (j = 0; j < adev->num_ip_blocks; j++) {
> +			block = &adev->ip_blocks[j];
> +
> +			if (block->version->type != ip_order[i] ||
> +				!block->status.valid)
> +				continue;
>   
> -		if (r) {
> -			DRM_ERROR("resume of IP block <%s> failed %d\n",
> -				  adev->ip_blocks[i].version->funcs->name, r);
> -			return r;
> +			r = block->version->funcs->hw_init(adev);
> +			DRM_INFO("RE-INIT: %s %s\n", block->version->funcs->name, 
> +r?"failed":"successed");
>   		}
>   	}
>   
> @@ -1741,20 +1749,27 @@ static int amdgpu_sriov_reinit_late(struct amdgpu_device *adev)
>   {
>   	int i, r;
>   
> -	for (i = 0; i < adev->num_ip_blocks; i++) {
> -		if (!adev->ip_blocks[i].status.valid)
> -			continue;
> +	static enum amd_ip_block_type ip_order[] = {
> +		AMD_IP_BLOCK_TYPE_SMC,
> +		AMD_IP_BLOCK_TYPE_DCE,
> +		AMD_IP_BLOCK_TYPE_GFX,
> +		AMD_IP_BLOCK_TYPE_SDMA,
> +		AMD_IP_BLOCK_TYPE_VCE,
> +	};
>   
> -		if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON ||
> -				adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC ||
> -				adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH )
> -			continue;
> +	for (i = 0; i < sizeof(ip_order)/sizeof(ip_order[0]); i++) {

And here as well.

> +		int j;
> +		struct amdgpu_ip_block *block;
>   
> -		r = adev->ip_blocks[i].version->funcs->hw_init(adev);
> -		if (r) {
> -			DRM_ERROR("resume of IP block <%s> failed %d\n",
> -				  adev->ip_blocks[i].version->funcs->name, r);
> -			return r;
> +		for (j = 0; j < adev->num_ip_blocks; j++) {
> +			block = &adev->ip_blocks[j];
> +
> +			if (block->version->type != ip_order[i] ||
> +				!block->status.valid)
> +				continue;
> +
> +			r = block->version->funcs->hw_init(adev);
> +			DRM_INFO("RE-INIT: %s %s\n", block->version->funcs->name, 
> +r?"failed":"successed");

This changes the order in which blocks are initialized which is probably not correct.

Alex needs to take a look at this, but we clearly need to improve the handling here.

Regards,
Christian.

>   		}
>   	}
>   


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-05-03  9:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03  3:48 [PATCH 1/6] drm/amdgpu:fix cannot receive rcv/ack irq bug Monk Liu
     [not found] ` <1493783292-2661-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-03  3:48   ` [PATCH 2/6] drm/amdgpu:need som change on vega10 mailbox Monk Liu
     [not found]     ` <1493783292-2661-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-03  6:27       ` Yu, Xiangliang
2017-05-03  9:05       ` Christian König
     [not found]         ` <09b3c7b4-19f9-2ca2-301e-324b71af1479-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-03 15:20           ` Alex Deucher
     [not found]             ` <CADnq5_MHdrQzRKQNHMSR5ucorerVZ9JMA3kE4LOVVx1Lwz0=KA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-03 15:22               ` Liu, Monk
2017-05-03  3:48   ` [PATCH 3/6] drm/amdgpu:re-write sriov_reinit_early/late Monk Liu
     [not found]     ` <1493783292-2661-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-03  6:43       ` Yu, Xiangliang
2017-05-03  9:02       ` Christian König
     [not found]         ` <fe18ce3e-dc63-412b-7dbb-aa5265dfad9f-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-03  9:10           ` Liu, Monk [this message]
     [not found]             ` <DM5PR12MB1610B39D23F8DC3CBCD18A3784160-2J9CzHegvk++jCVTvoAFKAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-03 15:23               ` Alex Deucher
2017-05-03  3:48   ` [PATCH 4/6] drm/amdgpu:cleanups KIQ ring_funcs emit_frame_size Monk Liu
     [not found]     ` <1493783292-2661-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-03  6:33       ` Yu, Xiangliang
2017-05-03  9:02       ` Christian König
2017-05-03 15:23       ` Alex Deucher
2017-05-03  3:48   ` [PATCH 5/6] drm/amdgpu:kiq reg access need timeout(v2) Monk Liu
     [not found]     ` <1493783292-2661-5-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-03  6:35       ` Yu, Xiangliang
2017-05-03  3:48   ` [PATCH 6/6] drm/amdgpu:PTE flag should be 64 bit width Monk Liu
     [not found]     ` <1493783292-2661-6-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-03 13:10       ` Alex Deucher
2017-05-03  6:24   ` [PATCH 1/6] drm/amdgpu:fix cannot receive rcv/ack irq bug Yu, Xiangliang
2017-05-03  9:05   ` Christian König
2017-05-03 15:19   ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2017-05-01  6:34 Monk Liu
     [not found] ` <1493620480-22002-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-01  6:34   ` [PATCH 3/6] drm/amdgpu:re-write sriov_reinit_early/late Monk Liu
     [not found]     ` <1493620480-22002-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-05-01 14:55       ` Alex Deucher
2017-05-01 14:58       ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR12MB1610B39D23F8DC3CBCD18A3784160@DM5PR12MB1610.namprd12.prod.outlook.com \
    --to=monk.liu-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.