On 2021-03-30 15:24 +0200, Christian König wrote:
Am 30.03.21 um 15:23 schrieb Dan Horák:
On Tue, 30 Mar 2021 21:09:12 +0800 Xi Ruoyao xry111@mengyan1223.wang wrote:
On 2021-03-30 21:02 +0800, Xi Ruoyao wrote:
On 2021-03-30 14:55 +0200, Christian König wrote:
I rather see this as a kernel bug. Can you test if this code fragment fixes your issue:
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 64beb3399604..e1260b517e1b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -780,7 +780,7 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) } dev_info->virtual_address_alignment = max((int)PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE); dev_info->pte_fragment_size = (1 << adev->vm_manager.fragment_size) * AMDGPU_GPU_PAGE_SIZE; - dev_info->gart_page_size = AMDGPU_GPU_PAGE_SIZE; + dev_info->gart_page_size = dev_info->virtual_address_alignment; dev_info->cu_active_number = adev-
gfx.cu_info.number;
dev_info->cu_ao_mask = adev->gfx.cu_info.ao_cu_mask; dev_info->ce_ram_size = adev->gfx.ce_ram_size;
It works. I've seen it at https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... before (with a common sub-expression, though :).
Some comment: on an old version of Fedora ported by Loongson, Xorg just hangs without this commit. But on the system I built from source, I didn't see any issue before Linux 5.11. So I misbelieved that it was something already fixed.
Dan: you can try it on your PPC 64 with non-4K page as well.
yup, looks good here as well, ppc64le (Power9) system with 64KB pages
Mhm, as far as I can say this patch never made it to us.
I think maybe its author considers it a "workaround" like me, as there is already a "virtual_address_alignment" which seems correct.
Can you please send it to the mailing list with me on CC?
I've sent it, together with my patch for using ~PAGE_MASK in parameter validation.