Re: [PATCH v3 2/2] radeon: use memcpy_to/fromio for UVD fw upload

2021-06-04 Thread Chen Li
On Fri, 04 Jun 2021 16:31:28 +0800, Christian König wrote: > > > > Am 04.06.21 um 10:28 schrieb Chen Li: > > On Fri, 04 Jun 2021 16:08:26 +0800, > > Christian König wrote: > >> > >> > >> Am 04.06.21 um 09:53 schrieb Chen Li: > >>&g

Re: [PATCH v3 2/2] radeon: use memcpy_to/fromio for UVD fw upload

2021-06-04 Thread Chen Li
On Fri, 04 Jun 2021 16:08:26 +0800, Christian König wrote: > > > > Am 04.06.21 um 09:53 schrieb Chen Li: > > I met a gpu addr bug recently and the kernel log > > tells me the pc is memcpy/memset and link register is > > radeon_uvd_resume. > > > > As

[PATCH v4 2/2] radeon: use memcpy_to/fromio for UVD fw upload

2021-06-04 Thread Chen Li
done it in: commit ba0b2275a678 ("drm/amdgpu: use memcpy_to/fromio for UVD fw upload"), that's why it has no this issue on the same gpu and platform. Signed-off-by: Chen Li Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon_uvd.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v4 1/2] radeon: fix coding issues reported from sparse

2021-06-04 Thread Chen Li
Also fix some coding issues reported from sparse. Signed-off-by: Chen Li Acked-by: Christian König --- drivers/gpu/drm/radeon/radeon_uvd.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm

[PATCH v3 0/2] use memcpy_to/fromio for UVD fw upload

2021-06-04 Thread Chen Li
changelog: v1->v2: split sparse and memcp/memset fix v2->v3: fix coding issue and misuse of le32_to_cpu Chen Li (2): radeon: fix coding issues reported from sparse radeon: use memcpy_to/fromio for UVD fw upload drivers/gpu/drm/radeon/radeon_uvd.

[PATCH v3 1/2] radeon: fix coding issues reported from sparse

2021-06-04 Thread Chen Li
Also fix some coding issues reported from sparse. Signed-off-by: Chen Li Acked-by: Christian König --- drivers/gpu/drm/radeon/radeon_uvd.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm

[PATCH v3 2/2] radeon: use memcpy_to/fromio for UVD fw upload

2021-06-04 Thread Chen Li
done it in: commit ba0b2275a678 ("drm/amdgpu: use memcpy_to/fromio for UVD fw upload"), that's why it has no this issue on the same gpu and platform. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/radeon_uvd.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/d

[PATCH v4 0/2] use memcpy_to/fromio for UVD fw upload

2021-06-04 Thread Chen Li
changelog: v1->v2: split sparse and memcp/memset fix v2->v3: fix coding issue and misuse of le32_to_cpu v3->v4: merge memcpy_toio's arguments to one line Chen Li (2): radeon: fix coding issues reported from sparse radeon: use memcpy_to/fromio for UVD fw upload driver

[PATCH v2 1/2] radeon: fix coding issues reported from sparse

2021-06-03 Thread Chen Li
Also fix some coding issue reported from sparse. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/radeon_uvd.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c index

[PATCH v2 2/2] radeon: use memcpy_to/fromio for UVD fw upload

2021-06-03 Thread Chen Li
done it in: commit ba0b2275a678 ("drm/amdgpu: use memcpy_to/fromio for UVD fw upload"), that's why it has no this issue on the same gpu and platform. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/radeon_uvd.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/d

[PATCH] radeon: use memcpy_to/fromio for UVD fw upload

2021-06-03 Thread Chen Li
done it in: commit ba0b2275a678 ("drm/amdgpu: use memcpy_to/fromio for UVD fw upload"), that's why it has no this issue on the same gpu and platform. Also fix some coding issues reported from sparse. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/radeon_

[PATCH V2] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Chen Li
chunks") Signed-off-by: Chen Li --- changelog: v1->v2: add Fixes: tag drivers/gpu/drm/radeon/radeon_cs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index fb736ef9f9aa..059431689c2d

Re: [PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Chen Li
On Wed, 17 Mar 2021 17:19:11 +0800, Chen Li wrote: > > On Wed, 17 Mar 2021 15:55:47 +0800, > Christian König wrote: > > > > Am 17.03.21 um 07:22 schrieb Chen Li: > > > kvmalloc_array + __GFP_ZERO is the same with kvcalloc. > > >

Re: [PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Chen Li
On Wed, 17 Mar 2021 15:55:47 +0800, Christian König wrote: > > Am 17.03.21 um 07:22 schrieb Chen Li: > > kvmalloc_array + __GFP_ZERO is the same with kvcalloc. > > > > As for p->chunks, it will be used in: > > ``` > > if (ib_chunk->kdata) > >

[PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Chen Li
here else, e.g., ``` Unable to handle kernel paging request at virtual address 0001 ... pc is at memcpy+0x84/0x250 ra is at radeon_cs_ioctl+0x368/0xb90 [radeon] ``` after allocating chunks with __GFP_KERNEL/kvcalloc, this bug is fixed. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/

[PATCH v3 3/3] drm/amdgpu: correct DRM_ERROR for kvmalloc_array

2021-03-02 Thread Chen Li
This may avoid debug confusion. Signed-off-by: Chen Li --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index d9ae2cb86bc7..b5c766998045 100644

[PATCH v3 2/3] drm/amdgpu: Use kvmalloc for CS chunks

2021-03-02 Thread Chen Li
The number of chunks/chunks_array may be passed in by userspace and can be large. Signed-off-by: Chen Li --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd

[PATCH v3 1/3] drm/radeon: Use kvmalloc for CS chunks

2021-03-02 Thread Chen Li
The number of chunks/chunks_array may be passed in by userspace and can be large. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/radeon_cs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c

[PATCH v3 0/3] Use kvmalloc_array for radeon and amdgpu CS chunks

2021-03-02 Thread Chen Li
When testing kernel with trinity, the kernel turned to tainted in that radeon CS require large memory and order is over MAX_ORDER. kvmalloc/kvmalloc_array should be used here in that it will fallback to vmalloc if necessary. Chen Li (3): drm/radeon: Use kvmalloc for CS chunks drm/amdgpu

Re: [PATCH v2 2/3] drm/amdgpu: Use kvmalloc for CS chunks【Suspected phishing email, please pay attention to password security】

2021-03-02 Thread Chen Li
On Wed, 03 Mar 2021 10:23:01 +0800, Alex Deucher wrote: > > On Tue, Mar 2, 2021 at 9:16 PM Chen Li wrote: > > > > > > The number of chunks/chunks_array may be passed in > > by userspace and can be large. > > > > We also need to kvfree these. Thanks fo

[PATCH v2 3/3] drm/amdgpu: correct DRM_ERROR for kvmalloc_array

2021-03-02 Thread Chen Li
This may avoid debug confusion. Signed-off-by: Chen Li --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index aefb7e68977d..a1df980864a6 100644

Re: [PATCH] drm/radeon: Use kvmalloc for CS chunks【Suspected phishing email, please pay attention to password security】

2021-03-02 Thread Chen Li
On Tue, 02 Mar 2021 22:13:11 +0800, Christian König wrote: > > Am 02.03.21 um 07:42 schrieb Chen Li: > > The number of chunks/chunks_array may be passed in > > by userspace and can be large. > > I'm wondering if we shouldn't rather restrict the number of chunks. I

[PATCH v2 0/3] Use kvmalloc_array for radeon and amdgpu CS chunks

2021-03-02 Thread Chen Li
When testing kernel with trinity, the kernel turned to tainted in that radeon CS require large memory and order is over MAX_ORDER. kvmalloc/kvmalloc_array should be used here in that it will fallback to vmalloc if necessary. Chen Li (3): drm/radeon: Use kvmalloc for CS chunks drm/amdgpu

[PATCH v2 1/3] drm/radeon: Use kvmalloc for CS chunks

2021-03-02 Thread Chen Li
The number of chunks/chunks_array may be passed in by userspace and can be large. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/radeon_cs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c

[PATCH v2 2/3] drm/amdgpu: Use kvmalloc for CS chunks

2021-03-02 Thread Chen Li
The number of chunks/chunks_array may be passed in by userspace and can be large. Signed-off-by: Chen Li --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/radeon: Use kvmalloc for CS chunks

2021-03-02 Thread Chen Li
/0x140 do_vfs_ioctl+0xe4/0x990 ksys_ioctl+0xdc/0x110 ksys_ioctl+0x78/0x110 sys_ioctl+0x2c/0x50 entSys+0xa0/0xc0 ``` Obviously, the required order in this case is larger than MAX_ORDER. So, just use kvmalloc instead. Signed-off-by: Chen Li --- drivers/gpu/drm/radeon/radeon_cs.c | 8 1