AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
To: Pratik Vishwakarma
	<Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Harry.Wentland-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH 3/3] drm/amd/amdgpu: Fix NULL pointer OOPS during S3
Date: Wed, 6 Jun 2018 11:49:53 +0200	[thread overview]
Message-ID: <2cad474b-792b-89be-ceef-cdcc5fbab066@amd.com> (raw)
In-Reply-To: <1528277142-20316-4-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>

NAK as well. mem->mm_node can't be NULL on a correctly allocated BO.

You are running into a BO corruption here and trying to work around by 
mitigating the effect and not fixing the root problem.

Regards,
Christian.

Am 06.06.2018 um 11:25 schrieb Pratik Vishwakarma:
> Fixes NULL pointer dereference in amdgpu_ttm_copy_mem_to_mem
>
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
> IP: amdgpu_ttm_copy_mem_to_mem+0x85/0x40c
> Workqueue: events_unbound async_run_entry_fn
> Call Trace:
> ? _raw_spin_unlock+0xe/0x20
> ? ttm_check_swapping+0x4e/0x72
> ? ttm_mem_global_reserve.constprop.4+0xb1/0xc0
> amdgpu_move_blit+0x80/0xe2
> amdgpu_bo_move+0x114/0x155
> ttm_bo_handle_move_mem+0x1f7/0x34a
> ? ttm_bo_mem_space+0x162/0x38e
> ? dev_vprintk_emit+0x10a/0x1f2
> ttm_bo_evict+0x13e/0x2e9
> ? do_wait_for_common+0x151/0x187
> ttm_mem_evict_first+0x136/0x181
> ttm_bo_force_list_clean+0x78/0x10f
> amdgpu_device_suspend+0x167/0x210
> pci_pm_suspend+0x12a/0x1a5
> ? pci_dev_driver+0x36/0x36
> dpm_run_callback+0x59/0xbf
> __device_suspend+0x215/0x33f
> async_suspend+0x1f/0x5c
> async_run_entry_fn+0x3d/0xd2
> process_one_work+0x1b0/0x314
> worker_thread+0x1cb/0x2c1
> ? create_worker+0x1da/0x1da
> kthread+0x156/0x15e
> ? kthread_flush_work+0xea/0xea
> ret_from_fork+0x22/0x40
>
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 57d4da6..f9de429 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -414,12 +414,16 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
>   		return -EINVAL;
>   	}
>   
> +	if (!src->mem->mm_node)
> +		return -EINVAL;
>   	src_mm = amdgpu_find_mm_node(src->mem, &src->offset);
>   	src_node_start = amdgpu_mm_node_addr(src->bo, src_mm, src->mem) +
>   					     src->offset;
>   	src_node_size = (src_mm->size << PAGE_SHIFT) - src->offset;
>   	src_page_offset = src_node_start & (PAGE_SIZE - 1);
>   
> +	if (!dst->mem->mm_node)
> +		return -EINVAL;
>   	dst_mm = amdgpu_find_mm_node(dst->mem, &dst->offset);
>   	dst_node_start = amdgpu_mm_node_addr(dst->bo, dst_mm, dst->mem) +
>   					     dst->offset;

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

      parent reply	other threads:[~2018-06-06  9:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06  9:25 [PATCH 0/3] Fix S3 entry crashes Pratik Vishwakarma
     [not found] ` <1528277142-20316-1-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
2018-06-06  9:25   ` [PATCH 1/3] drm/amd/display: remove cursor hack for S3 Pratik Vishwakarma
2018-06-06  9:25   ` [PATCH 2/3] drm/amd/amdgpu: Fix crash in amdgpu_bo_reserve Pratik Vishwakarma
     [not found]     ` <1528277142-20316-3-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
2018-06-06  9:47       ` Christian König
     [not found]         ` <0cf36801-aee8-c6bf-9e42-d57197821dd9-5C7GfCeVMHo@public.gmane.org>
2018-06-08  5:53           ` Vishwakarma, Pratik
2018-06-06  9:25   ` [PATCH 3/3] drm/amd/amdgpu: Fix NULL pointer OOPS during S3 Pratik Vishwakarma
     [not found]     ` <1528277142-20316-4-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
2018-06-06  9:49       ` Christian König [this message]

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=2cad474b-792b-89be-ceef-cdcc5fbab066@amd.com \
    --to=christian.koenig-5c7gfcevmho@public.gmane.org \
    --cc=Harry.Wentland-5C7GfCeVMHo@public.gmane.org \
    --cc=Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org \
    --cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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