AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 16/22] drm/amdgpu: cleanup SA inti and fini
Date: Mon, 26 Feb 2018 11:12:36 +0100	[thread overview]
Message-ID: <51af9fc4-7827-9f40-da2b-0fd8753bc321@gmail.com> (raw)
In-Reply-To: <1519622300-8990-17-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>

Am 26.02.2018 um 06:18 schrieb Monk Liu:
> should use bo_create_kernel instead of split to two
> function that create and pin the SA bo
>
> issue:
> before this patch, there are DMAR read error in host
> side when running SRIOV test, the DMAR address dropped
> in the range of SA bo.
>
> fix:
> after this cleanups of SA init and fini, above DMAR
> eror gone.

Well the change looks like a valid cleanup to me, but the explanation 
why that should be a problem doesn't looks like it makes sense.

Please explain further what this should fix?

Regards,
Christian.

>
> Change-Id: I3f299a3342bd7263776bff69e4b31b0d3816749a
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c |  6 ----
>   drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 61 +++-------------------------------
>   2 files changed, 4 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> index 7f2c314..4709d13 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> @@ -279,11 +279,6 @@ int amdgpu_ib_pool_init(struct amdgpu_device *adev)
>   		return r;
>   	}
>   
> -	r = amdgpu_sa_bo_manager_start(adev, &adev->ring_tmp_bo);
> -	if (r) {
> -		return r;
> -	}
> -
>   	adev->ib_pool_ready = true;
>   	if (amdgpu_debugfs_sa_init(adev)) {
>   		dev_err(adev->dev, "failed to register debugfs file for SA\n");
> @@ -303,7 +298,6 @@ void amdgpu_ib_pool_fini(struct amdgpu_device *adev)
>   {
>   	if (adev->ib_pool_ready) {
>   		amdgpu_sa_bo_manager_suspend(adev, &adev->ring_tmp_bo);
> -		amdgpu_sa_bo_manager_fini(adev, &adev->ring_tmp_bo);
>   		adev->ib_pool_ready = false;
>   	}
>   }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
> index 5ca75a4..695c639 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c
> @@ -63,80 +63,27 @@ int amdgpu_sa_bo_manager_init(struct amdgpu_device *adev,
>   	for (i = 0; i < AMDGPU_SA_NUM_FENCE_LISTS; ++i)
>   		INIT_LIST_HEAD(&sa_manager->flist[i]);
>   
> -	r = amdgpu_bo_create(adev, size, align, true, domain,
> -			     0, NULL, NULL, &sa_manager->bo);
> +	r = amdgpu_bo_create_kernel(adev, size, align, domain, &sa_manager->bo,
> +				&sa_manager->gpu_addr, &sa_manager->cpu_ptr);
>   	if (r) {
>   		dev_err(adev->dev, "(%d) failed to allocate bo for manager\n", r);
>   		return r;
>   	}
>   
> -	return r;
> -}
> -
> -void amdgpu_sa_bo_manager_fini(struct amdgpu_device *adev,
> -			       struct amdgpu_sa_manager *sa_manager)
> -{
> -	struct amdgpu_sa_bo *sa_bo, *tmp;
> -
> -	if (!list_empty(&sa_manager->olist)) {
> -		sa_manager->hole = &sa_manager->olist,
> -		amdgpu_sa_bo_try_free(sa_manager);
> -		if (!list_empty(&sa_manager->olist)) {
> -			dev_err(adev->dev, "sa_manager is not empty, clearing anyway\n");
> -		}
> -	}
> -	list_for_each_entry_safe(sa_bo, tmp, &sa_manager->olist, olist) {
> -		amdgpu_sa_bo_remove_locked(sa_bo);
> -	}
> -	amdgpu_bo_unref(&sa_manager->bo);
> -	sa_manager->size = 0;
> -}
> -
> -int amdgpu_sa_bo_manager_start(struct amdgpu_device *adev,
> -			       struct amdgpu_sa_manager *sa_manager)
> -{
> -	int r;
> -
> -	if (sa_manager->bo == NULL) {
> -		dev_err(adev->dev, "no bo for sa manager\n");
> -		return -EINVAL;
> -	}
> -
> -	/* map the buffer */
> -	r = amdgpu_bo_reserve(sa_manager->bo, false);
> -	if (r) {
> -		dev_err(adev->dev, "(%d) failed to reserve manager bo\n", r);
> -		return r;
> -	}
> -	r = amdgpu_bo_pin(sa_manager->bo, sa_manager->domain, &sa_manager->gpu_addr);
> -	if (r) {
> -		amdgpu_bo_unreserve(sa_manager->bo);
> -		dev_err(adev->dev, "(%d) failed to pin manager bo\n", r);
> -		return r;
> -	}
> -	r = amdgpu_bo_kmap(sa_manager->bo, &sa_manager->cpu_ptr);
>   	memset(sa_manager->cpu_ptr, 0, sa_manager->size);
> -	amdgpu_bo_unreserve(sa_manager->bo);
>   	return r;
>   }
>   
>   int amdgpu_sa_bo_manager_suspend(struct amdgpu_device *adev,
>   				 struct amdgpu_sa_manager *sa_manager)
>   {
> -	int r;
> -
>   	if (sa_manager->bo == NULL) {
>   		dev_err(adev->dev, "no bo for sa manager\n");
>   		return -EINVAL;
>   	}
>   
> -	r = amdgpu_bo_reserve(sa_manager->bo, true);
> -	if (!r) {
> -		amdgpu_bo_kunmap(sa_manager->bo);
> -		amdgpu_bo_unpin(sa_manager->bo);
> -		amdgpu_bo_unreserve(sa_manager->bo);
> -	}
> -	return r;
> +	amdgpu_bo_free_kernel(&sa_manager->bo, &sa_manager->gpu_addr, &sa_manager->cpu_ptr);
> +	return 0;
>   }
>   
>   static void amdgpu_sa_bo_remove_locked(struct amdgpu_sa_bo *sa_bo)

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

  parent reply	other threads:[~2018-02-26 10:12 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  5:17 [PATCH 00/22] *** bug fixing serials *** Monk Liu
     [not found] ` <1519622300-8990-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26  5:17   ` [PATCH 01/22] drm/amdgpu: fix&cleanups for wb_clear Monk Liu
     [not found]     ` <1519622300-8990-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:18       ` Alex Deucher
2018-02-26  5:18   ` [PATCH 02/22] drm/amdgpu: remove duplicated job_free_resources Monk Liu
     [not found]     ` <1519622300-8990-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26  9:51       ` Christian König
2018-02-26  5:18   ` [PATCH 03/22] drm/amdgpu: skip ECC for SRIOV in gmc late_init Monk Liu
     [not found]     ` <1519622300-8990-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:19       ` Alex Deucher
2018-02-26  5:18   ` [PATCH 04/22] drm/amdgpu: only flush hotplug work without DC Monk Liu
     [not found]     ` <1519622300-8990-5-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:19       ` Alex Deucher
2018-02-26  5:18   ` [PATCH 05/22] drm/amdgpu: cond_exec only for schedule with a job Monk Liu
     [not found]     ` <1519622300-8990-6-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26  9:53       ` Christian König
2018-02-26  5:18   ` [PATCH 06/22] drm/amdgpu: don't use MM idle_work for SRIOV Monk Liu
     [not found]     ` <1519622300-8990-7-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26  9:57       ` Christian König
2018-02-26  5:18   ` [PATCH 07/22] drm/amdgpu: fix fence_emit NULL pointer ref risk Monk Liu
     [not found]     ` <1519622300-8990-8-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26  9:58       ` Christian König
2018-02-26  5:18   ` [PATCH 08/22] drm/amdgpu: cleanups VCE/UVD ib test part Monk Liu
     [not found]     ` <1519622300-8990-9-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 10:06       ` Christian König
2018-02-26  5:18   ` [PATCH 09/22] drm/amdgpu: fix kmd reload bug on bare-metal Monk Liu
     [not found]     ` <1519622300-8990-10-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 10:08       ` Christian König
     [not found]         ` <a89aeb3e-1687-e7e6-bef4-9371ecb13a70-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-27  4:45           ` Liu, Monk
     [not found]             ` <BLUPR12MB044911AD4E7442812B7D589084C00-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-27  8:42               ` Christian König
     [not found]                 ` <1b9d2cbf-1ba5-1be6-11ef-4723e08e9699-5C7GfCeVMHo@public.gmane.org>
2018-02-27  9:09                   ` Liu, Monk
     [not found]                     ` <BLUPR12MB0449EE0E7CD1DAE5C60290C684C00-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-27  9:52                       ` Christian König
     [not found]                         ` <07b98381-cbea-7352-7cf3-d69020da6395-5C7GfCeVMHo@public.gmane.org>
2018-02-27 10:19                           ` Liu, Monk
     [not found]                             ` <BLUPR12MB0449F97B88BE9D312DD5479784C00-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-27 10:29                               ` Christian König
2018-02-26  5:18   ` [PATCH 10/22] drm/amdgpu: no need to count emitted for SRIOV Monk Liu
     [not found]     ` <1519622300-8990-11-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 10:09       ` Christian König
     [not found]         ` <994af188-1283-44ea-f868-73f4002a7cb3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-27  5:26           ` Liu, Monk
     [not found]             ` <BLUPR12MB04493445BAD30EA2B4F14A8184C00-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-27  8:47               ` Christian König
2018-02-26  5:18   ` [PATCH 11/22] drm/amdgpu: Remove the memory leak after unload amdgpu driver Monk Liu
     [not found]     ` <1519622300-8990-12-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:27       ` Alex Deucher
     [not found]         ` <CADnq5_M9z3T0ihL9cDVbgEjaKp0AM=Utvs_J-=q7szT2NXtvrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-27  5:27           ` Liu, Monk
     [not found]             ` <BLUPR12MB0449DF1E4689A22636F01AB484C00-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-27  5:53               ` Liu, Monk
2018-02-27  5:52       ` Liu, Monk
2018-02-26  5:18   ` [PATCH 12/22] drm/amdgpu: send rel event first after init failed Monk Liu
     [not found]     ` <1519622300-8990-13-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:24       ` Alex Deucher
2018-02-26  5:18   ` [PATCH 13/22] drm/amdgpu: fix vce_ring test memleak Monk Liu
     [not found]     ` <1519622300-8990-14-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 10:10       ` Christian König
2018-02-26  5:18   ` [PATCH 14/22] drm/amdgpu: change gfx9 ib test to use WB Monk Liu
     [not found]     ` <1519622300-8990-15-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:30       ` Alex Deucher
2018-02-26  5:18   ` [PATCH 15/22] drm/amdgpu: move WB_FREE to correct place Monk Liu
     [not found]     ` <1519622300-8990-16-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:36       ` Alex Deucher
2018-02-26  5:18   ` [PATCH 16/22] drm/amdgpu: cleanup SA inti and fini Monk Liu
     [not found]     ` <1519622300-8990-17-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 10:12       ` Christian König [this message]
     [not found]         ` <51af9fc4-7827-9f40-da2b-0fd8753bc321-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-26 10:41           ` Liu, Monk
     [not found]             ` <SN1PR12MB04625A0F831F186440F4A81684C10-z7L1TMIYDg7VaWpRXmIMygdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-26 10:48               ` Liu, Monk
     [not found]                 ` <SN1PR12MB04620B6D208218E5EB23824284C10-z7L1TMIYDg7VaWpRXmIMygdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-26 11:29                   ` Christian König
2018-02-26  5:18   ` [PATCH 17/22] drm/amdgpu: disable GFX ring and disable PQ wptr in hw_fini Monk Liu
     [not found]     ` <1519622300-8990-18-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:39       ` Alex Deucher
     [not found]         ` <CADnq5_M1BkpZzNURswAh1fTpm1rZbspkZ4qq+g2pbdVjWyR2eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-27  5:31           ` Liu, Monk
     [not found]             ` <BLUPR12MB044966DA7194FE030265D15D84C00-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-27 14:28               ` Deucher, Alexander
2018-02-26  5:18   ` [PATCH 18/22] drm/amdgpu: Correct sdma_v4 get_wptr Monk Liu
     [not found]     ` <1519622300-8990-19-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 10:22       ` Christian König
     [not found]         ` <b9826bed-1b38-cbee-536a-1bd9d50dca6b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-27  5:35           ` Liu, Monk
2018-02-26  5:18   ` [PATCH 19/22] drm/amdgpu: adjust timeout for ib_ring_tests Monk Liu
     [not found]     ` <1519622300-8990-20-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 15:55       ` Alex Deucher
2018-02-26  5:18   ` [PATCH 20/22] drm/amdgpu: increase gart size to 512MB Monk Liu
     [not found]     ` <1519622300-8990-21-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-26 17:45       ` Alex Deucher

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=51af9fc4-7827-9f40-da2b-0fd8753bc321@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Monk.Liu-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox