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 09/22] drm/amdgpu: fix kmd reload bug on bare-metal
Date: Mon, 26 Feb 2018 11:08:02 +0100 [thread overview]
Message-ID: <a89aeb3e-1687-e7e6-bef4-9371ecb13a70@gmail.com> (raw)
In-Reply-To: <1519622300-8990-10-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
Am 26.02.2018 um 06:18 schrieb Monk Liu:
> issue:
> on bare-metal when doing kmd reload test, there are chance
> that kernel hit fatal error afer driver unloaded/reloaded
>
> fix:
> the cause is that those "idle work" not really stopped and
> if kmd was is unloaded too quick that were chance that
> "idle work" run after driver structures already released which
> introduces this issue.
In this case I think it would be much better to wait for the idle work
before trying to unload the driver.
>
> Change-Id: Idb0f7db771e7ca60dba925d1d0f48b1de08dc89e
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 4 +++-
> 3 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 54145ec..69fb5e50 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1419,7 +1419,8 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)
> }
> }
>
> - mod_delayed_work(system_wq, &adev->late_init_work,
> + if (!amdgpu_sriov_vf(adev))
> + mod_delayed_work(system_wq, &adev->late_init_work,
> msecs_to_jiffies(AMDGPU_RESUME_MS));
>
> amdgpu_device_fill_reset_magic(adev);
> @@ -2087,7 +2088,11 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
> adev->firmware.gpu_info_fw = NULL;
> }
> adev->accel_working = false;
> - cancel_delayed_work_sync(&adev->late_init_work);
> +
> + if (!amdgpu_sriov_vf(adev))
> + while (cancel_delayed_work_sync(&adev->late_init_work))
> + schedule(); /* to make sure late_init_work really stopped */
Never use schedule() like that.
Regards,
Christian.
> +
> /* free i2c buses */
> if (!amdgpu_device_has_dc_support(adev))
> amdgpu_i2c_fini(adev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index caba610..337db57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -299,7 +299,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)
> return 0;
>
> if (!amdgpu_sriov_vf(adev))
> - cancel_delayed_work_sync(&adev->uvd.idle_work);
> + while (cancel_delayed_work_sync(&adev->uvd.idle_work))
> + schedule(); /* to make sure idle work really stopped */
>
> for (i = 0; i < adev->uvd.max_handles; ++i)
> if (atomic_read(&adev->uvd.handles[i]))
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> index a829350..2874fda 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> @@ -243,7 +243,9 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev)
> return 0;
>
> if (!amdgpu_sriov_vf(adev))
> - cancel_delayed_work_sync(&adev->vce.idle_work);
> + while (cancel_delayed_work_sync(&adev->vce.idle_work))
> + schedule(); /* to make sure the idle_work really stopped */
> +
> /* TODO: suspending running encoding sessions isn't supported */
> return -EINVAL;
> }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-02-26 10:08 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 [this message]
[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
[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=a89aeb3e-1687-e7e6-bef4-9371ecb13a70@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