* [PATCH] drm/amdgpu: drop WARN_ON in amdgpu_gart_bind/unbind
@ 2022-01-21 8:47 Guchun Chen
2022-01-21 9:49 ` Christian König
0 siblings, 1 reply; 2+ messages in thread
From: Guchun Chen @ 2022-01-21 8:47 UTC (permalink / raw)
To: amd-gfx, alexander.deucher, christian.koenig, xinhui.pan; +Cc: Guchun Chen
NULL pointer check has guarded it already.
calltrace:
amdgpu_ttm_gart_bind+0x49/0xa0 [amdgpu]
amdgpu_ttm_alloc_gart+0x13f/0x180 [amdgpu]
amdgpu_bo_create_reserved+0x139/0x2c0 [amdgpu]
? amdgpu_ttm_debugfs_init+0x120/0x120 [amdgpu]
amdgpu_bo_create_kernel+0x17/0x80 [amdgpu]
amdgpu_ttm_init+0x542/0x5e0 [amdgpu]
Fixes: f0239505d6c4("drm/amdgpu: remove gart.ready flag")
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
index 53cc844346f0..91d8207336c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
@@ -161,7 +161,7 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset,
uint64_t flags = 0;
int idx;
- if (WARN_ON(!adev->gart.ptr))
+ if (!adev->gart.ptr)
return;
if (!drm_dev_enter(adev_to_drm(adev), &idx))
@@ -241,7 +241,7 @@ void amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
int pages, dma_addr_t *dma_addr,
uint64_t flags)
{
- if (WARN_ON(!adev->gart.ptr))
+ if (!adev->gart.ptr)
return;
amdgpu_gart_map(adev, offset, pages, dma_addr, flags, adev->gart.ptr);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amdgpu: drop WARN_ON in amdgpu_gart_bind/unbind
2022-01-21 8:47 [PATCH] drm/amdgpu: drop WARN_ON in amdgpu_gart_bind/unbind Guchun Chen
@ 2022-01-21 9:49 ` Christian König
0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2022-01-21 9:49 UTC (permalink / raw)
To: Guchun Chen, amd-gfx, alexander.deucher, xinhui.pan
Am 21.01.22 um 09:47 schrieb Guchun Chen:
> NULL pointer check has guarded it already.
>
> calltrace:
> amdgpu_ttm_gart_bind+0x49/0xa0 [amdgpu]
> amdgpu_ttm_alloc_gart+0x13f/0x180 [amdgpu]
> amdgpu_bo_create_reserved+0x139/0x2c0 [amdgpu]
> ? amdgpu_ttm_debugfs_init+0x120/0x120 [amdgpu]
> amdgpu_bo_create_kernel+0x17/0x80 [amdgpu]
> amdgpu_ttm_init+0x542/0x5e0 [amdgpu]
>
> Fixes: f0239505d6c4("drm/amdgpu: remove gart.ready flag")
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
> index 53cc844346f0..91d8207336c1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c
> @@ -161,7 +161,7 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset,
> uint64_t flags = 0;
> int idx;
>
> - if (WARN_ON(!adev->gart.ptr))
> + if (!adev->gart.ptr)
> return;
>
> if (!drm_dev_enter(adev_to_drm(adev), &idx))
> @@ -241,7 +241,7 @@ void amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
> int pages, dma_addr_t *dma_addr,
> uint64_t flags)
> {
> - if (WARN_ON(!adev->gart.ptr))
> + if (!adev->gart.ptr)
> return;
>
> amdgpu_gart_map(adev, offset, pages, dma_addr, flags, adev->gart.ptr);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-21 9:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 8:47 [PATCH] drm/amdgpu: drop WARN_ON in amdgpu_gart_bind/unbind Guchun Chen
2022-01-21 9:49 ` Christian König
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.