All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] input/iforce-packets: insert set_current_state()
Date: Fri, 22 Oct 2004 23:28:38 +0000	[thread overview]
Message-ID: <20041022232838.GD18906@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

Any comments would be, as always, appreciated.

-Nish

Description: Inserts set_current_state() before schedule_timeout().
Without the insertion, schedule_timeout() will return immediately.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

--- 2.6.9-bk7-vanilla/drivers/input/joystick/iforce/iforce-packets.c	2004-10-22 10:41:36.000000000 -0700
+++ 2.6.9-bk7/drivers/input/joystick/iforce/iforce-packets.c	2004-10-22 14:53:18.000000000 -0700
@@ -269,8 +269,10 @@ int iforce_get_id_packet(struct iforce *
 			return -1;
 		}
 
-		while (timeout && iforce->ctrl->status == -EINPROGRESS)
+		while (timeout && iforce->ctrl->status == -EINPROGRESS) {
+			set_current_state(TASK_INTERRUPTIBLE);
 			timeout = schedule_timeout(timeout);
+		}
 
 		set_current_state(TASK_RUNNING);
 		remove_wait_queue(&iforce->wait, &wait);
@@ -293,8 +295,10 @@ int iforce_get_id_packet(struct iforce *
 		set_current_state(TASK_INTERRUPTIBLE);
 		add_wait_queue(&iforce->wait, &wait);
 
-		while (timeout && iforce->expect_packet)
+		while (timeout && iforce->expect_packet) {
+			set_current_state(TASK_INTERRUPTIBLE);
 			timeout = schedule_timeout(timeout);
+		}
 
 		set_current_state(TASK_RUNNING);
 		remove_wait_queue(&iforce->wait, &wait);

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2004-10-22 23:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-22 23:28 Nishanth Aravamudan [this message]
2004-10-22 23:33 ` [KJ] [PATCH] input/iforce-packets: insert set_current_state() Jon Masters
2004-10-22 23:41 ` Nishanth Aravamudan
2004-10-23  0:32 ` Jon Masters
2004-10-24 14:08 ` maximilian attems

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=20041022232838.GD18906@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=kernel-janitors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.