mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm: nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout()
@ 2010-07-26  8:23 Kulikov Vasiliy
  2010-07-30 11:31 ` Francisco Jerez
  0 siblings, 1 reply; 2+ messages in thread
From: Kulikov Vasiliy @ 2010-07-26  8:23 UTC (permalink / raw)
  To: kernel-janitors
  Cc: David Airlie, Ben Skeggs, Francisco Jerez, Dave Airlie,
	dri-devel, linux-kernel

set_current_state() is called only once before the first iteration.
After return from schedule_timeout() current state is TASK_RUNNING. If
we are going to wait again, set_current_state() must be called.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_fence.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 813d853..b7777ae 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -186,7 +186,6 @@ nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
 	unsigned long timeout = jiffies + (3 * DRM_HZ);
 	int ret = 0;
 
-	__set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
 
 	while (1) {
 		if (nouveau_fence_signalled(sync_obj, sync_arg))
@@ -197,6 +196,8 @@ nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
 			break;
 		}
 
+		__set_current_state(intr ? TASK_INTERRUPTIBLE
+			: TASK_UNINTERRUPTIBLE);
 		if (lazy)
 			schedule_timeout(1);
 
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm: nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout()
  2010-07-26  8:23 [PATCH] drm: nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout() Kulikov Vasiliy
@ 2010-07-30 11:31 ` Francisco Jerez
  0 siblings, 0 replies; 2+ messages in thread
From: Francisco Jerez @ 2010-07-30 11:31 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors, David Airlie, Ben Skeggs, Dave Airlie,
	dri-devel, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1301 bytes --]

Kulikov Vasiliy <segooon@gmail.com> writes:

> set_current_state() is called only once before the first iteration.
> After return from schedule_timeout() current state is TASK_RUNNING. If
> we are going to wait again, set_current_state() must be called.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_fence.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
Thanks, I've pushed this patch to the Nouveau kernel tree.

> diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
> index 813d853..b7777ae 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_fence.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
> @@ -186,7 +186,6 @@ nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
>  	unsigned long timeout = jiffies + (3 * DRM_HZ);
>  	int ret = 0;
>  
> -	__set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
>  
>  	while (1) {
>  		if (nouveau_fence_signalled(sync_obj, sync_arg))
> @@ -197,6 +196,8 @@ nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
>  			break;
>  		}
>  
> +		__set_current_state(intr ? TASK_INTERRUPTIBLE
> +			: TASK_UNINTERRUPTIBLE);
>  		if (lazy)
>  			schedule_timeout(1);

[-- Attachment #2: Type: application/pgp-signature, Size: 229 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-30 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-26  8:23 [PATCH] drm: nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout() Kulikov Vasiliy
2010-07-30 11:31 ` Francisco Jerez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome