AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Jingwen Chen <Jingwen.Chen2@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work
Date: Mon, 18 Jan 2021 09:48:57 +0100	[thread overview]
Message-ID: <b2c99226-0698-5ca6-11e8-e4bbf2674cd0@gmail.com> (raw)
In-Reply-To: <20210118024714.2730735-1-Jingwen.Chen2@amd.com>

Am 18.01.21 um 03:47 schrieb Jingwen Chen:
> When using cancel_delayed_work_sync, there's no need
> to flush_delayed_work first. This sequence can lead to
> a redundant loop of work executing.

Well the difference is that cancel_delayed_work_sync() cancels the work 
when it is not running yet and waits for the work to finish if it is 
already running.

flush_delayed_work() always waits for the work to finish.

You need to remove the cancel_delayed_work_sync not the flush if you 
want to keep the functionality the same.

Regards,
Christian.

>
> Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index 3e212862cf5d..c649944e49da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -569,7 +569,6 @@ void amdgpu_virt_fini_data_exchange(struct amdgpu_device *adev)
>   {
>   	if (adev->virt.vf2pf_update_interval_ms != 0) {
>   		DRM_INFO("clean up the vf2pf work item\n");
> -		flush_delayed_work(&adev->virt.vf2pf_work);
>   		cancel_delayed_work_sync(&adev->virt.vf2pf_work);
>   		adev->virt.vf2pf_update_interval_ms = 0;
>   	}

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

      parent reply	other threads:[~2021-01-18  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18  2:47 [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work Jingwen Chen
2021-01-18  8:42 ` Liu, Monk
2021-01-18  8:48 ` 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=b2c99226-0698-5ca6-11e8-e4bbf2674cd0@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Jingwen.Chen2@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /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