All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry(Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	alexander.deucher-5C7GfCeVMHo@public.gmane.org,
	christian.koenig-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: Fix amdgpu_vm_alloc_pts failed
Date: Tue, 23 Oct 2018 13:29:36 +0800	[thread overview]
Message-ID: <e90e3b54-b647-6c79-e644-7aee86369e17@amd.com> (raw)
In-Reply-To: <7b50f2a1-791e-8eab-6777-e7fff572565c-5C7GfCeVMHo@public.gmane.org>

On 10/23/2018 01:12 PM, Zhang, Jerry(Junwei) wrote:
> On 10/23/2018 11:29 AM, Rex Zhu wrote:
>> when the VA address located in the last PD entries,
>> the alloc_pts will faile.
>>
>> Use the right PD mask instand of hardcode, suggested
>> by jerry.zhang.
>>
>> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
>
> Thanks to verify that.
> Feel free to add
> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
>
> Also like to get to know some background about these two functions 
> from Christian.
> Perhaps we may make it more simple, e.g. merging them together.

If we really needs them all, we may simplify that like:
```
amdgpu_vm_entries_mask(struct amdgpu_device *adev, unsigned int level)
{
     return amdgpu_vm_num_entries(adev, level) - 1;
}
```

Jerry
>
> Regards,
> Jerry
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index 054633b..3939013 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -202,8 +202,11 @@ static unsigned amdgpu_vm_num_entries(struct 
>> amdgpu_device *adev,
>>   static uint32_t amdgpu_vm_entries_mask(struct amdgpu_device *adev,
>>                          unsigned int level)
>>   {
>> +    unsigned shift = amdgpu_vm_level_shift(adev,
>> +                           adev->vm_manager.root_level);
>> +
>>       if (level <= adev->vm_manager.root_level)
>> -        return 0xffffffff;
>> +        return (round_up(adev->vm_manager.max_pfn, 1 << shift) >> 
>> shift) - 1;
>>       else if (level != AMDGPU_VM_PTB)
>>           return 0x1ff;
>>       else
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

  parent reply	other threads:[~2018-10-23  5:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  3:29 [PATCH] drm/amdgpu: Fix amdgpu_vm_alloc_pts failed Rex Zhu
     [not found] ` <1540265370-23923-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-10-23  5:12   ` Zhang, Jerry(Junwei)
     [not found]     ` <7b50f2a1-791e-8eab-6777-e7fff572565c-5C7GfCeVMHo@public.gmane.org>
2018-10-23  5:29       ` Zhang, Jerry(Junwei) [this message]
2018-10-23  5:42       ` Zhu, Rex
     [not found]         ` <BYAPR12MB2775C0F7BCA52B2969C9D16EFBF50-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-10-23  9:01           ` Christian König
     [not found]             ` <62aee584-d4b1-dd9b-234e-8ca7d7a23a29-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-10-23  9:08               ` Zhu, Rex
  -- strict thread matches above, loose matches on Subject: below --
2018-10-22 16:09 Rex Zhu
     [not found] ` <1540224561-4728-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-10-22 17:42   ` Deucher, Alexander
2018-10-23  2:02   ` Zhang, Jerry(Junwei)
     [not found]     ` <7eb4b4ef-c72a-9a58-2c99-0bfbe6109f69-5C7GfCeVMHo@public.gmane.org>
2018-10-23  3:31       ` Zhu, Rex

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=e90e3b54-b647-6c79-e644-7aee86369e17@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=Rex.Zhu-5C7GfCeVMHo@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@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.