AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: zhoucm1 <david1.zhou-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
	<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/3] drm/amdgpu: add some extra VM error handling
Date: Tue, 16 May 2017 10:39:26 +0800	[thread overview]
Message-ID: <591A665E.1020805@amd.com> (raw)
In-Reply-To: <1494849459-3221-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>



On 2017年05月15日 19:57, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> If updating the PDs fails we now invalidate all entries to try again later.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 34 +++++++++++++++++++++++++++++++++-
>   1 file changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 344f943..b877f9f3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1105,6 +1105,32 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
>   }
>   
>   /*
> + * amdgpu_vm_invalidate_level - mark all PD levels as invalid
> + *
> + * @parent: parent PD
> + *
> + * Mark all PD level as invalid after an error.
> + */
> +static void amdgpu_vm_invalidate_level(struct amdgpu_vm_pt *parent)
> +{
> +	unsigned pt_idx;
> +
> +	/*
> +	 * Recurse into the subdirectories. This recursion is harmless because
> +	 * we only have a maximum of 5 layers.
> +	 */
> +	for (pt_idx = 0; pt_idx <= parent->last_entry_used; ++pt_idx) {
> +		struct amdgpu_vm_pt *entry = &parent->entries[pt_idx];
> +
> +		if (!entry->bo)
> +			continue;
> +
> +		entry->addr = ~0ULL;
> +		amdgpu_vm_invalidate_level(entry);
> +	}
> +}
> +
> +/*
>    * amdgpu_vm_update_directories - make sure that all directories are valid
>    *
>    * @adev: amdgpu_device pointer
> @@ -1116,7 +1142,13 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
>   int amdgpu_vm_update_directories(struct amdgpu_device *adev,
>   				 struct amdgpu_vm *vm)
>   {
> -	return amdgpu_vm_update_level(adev, vm, &vm->root, 0);
> +	int r;
> +
> +	r = amdgpu_vm_update_level(adev, vm, &vm->root, 0);
> +	if (r)
> +		amdgpu_vm_invalidate_level(&vm->root);
> +
> +	return r;
>   }
>   
>   /**

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

  parent reply	other threads:[~2017-05-16  2:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 11:57 [PATCH 1/3] drm/amdgpu: cleanup adjust_mc_addr handling v2 Christian König
     [not found] ` <1494849459-3221-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-15 11:57   ` [PATCH 2/3] drm/amdgpu: add some extra VM error handling Christian König
     [not found]     ` <1494849459-3221-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-16  2:39       ` zhoucm1 [this message]
2017-05-15 11:57   ` [PATCH 3/3] drm/amdgpu: fix another fundamental VM bug Christian König
     [not found]     ` <1494849459-3221-3-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-16  2:45       ` zhoucm1
     [not found]         ` <591A67BE.5010801-5C7GfCeVMHo@public.gmane.org>
2017-05-16  7:21           ` Zhang, Hawking
     [not found]             ` <CY1PR12MB0534A61F57A038733895842EFCE60-1s8aH8ViOEf7axfsnaG19wdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-16  7:49               ` Christian König
     [not found]                 ` <7ca07024-0898-980d-18df-38e15f133abb-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-16  8:38                   ` Zhang, Hawking
2017-05-16  4:58       ` Zhang, Jerry (Junwei)
     [not found]         ` <591A86ED.9030100-5C7GfCeVMHo@public.gmane.org>
2017-05-16  7:51           ` Christian König
     [not found]             ` <6162b11b-97f6-5764-cbc6-3576ef17e9f7-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-16  9:06               ` Zhang, Jerry (Junwei)
2017-05-16  2:37   ` [PATCH 1/3] drm/amdgpu: cleanup adjust_mc_addr handling v2 zhoucm1
2017-05-16  2:37   ` zhoucm1

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=591A665E.1020805@amd.com \
    --to=david1.zhou-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox