From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [Kernel-janitors] [PATCH] macintosh/mediabay: replace
Date: Fri, 23 Jul 2004 21:48:54 +0000 [thread overview]
Message-ID: <20040723214854.GO2675@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2075 bytes --]
I would appreciate any comments from the janitors list.
Thanks,
Nish
Applys-to: 2.6.7
Description: Use msleep() instead of schedule_timeout() to guarantee the
task delays the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- linux-vanilla/drivers/macintosh/mediabay.c 2004-06-16 05:19:02.000000000 +0000
+++ linux-dev/drivers/macintosh/mediabay.c 2004-07-12 18:46:56.000000000 +0000
@@ -686,15 +685,13 @@ static int __devinit media_bay_attach(st
/* Force an immediate detect */
set_mb_power(bay, 0);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(MS_TO_HZ(MB_POWER_DELAY));
+ msleep(MB_POWER_DELAY);
bay->content_id = MB_NO;
bay->last_value = bay->ops->content(bay);
bay->value_count = MS_TO_HZ(MB_STABLE_DELAY);
bay->state = mb_empty;
do {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
+ msleep(MB_POLL_DELAY);
media_bay_step(i);
} while((bay->state != mb_empty) &&
(bay->state != mb_up));
@@ -719,8 +716,7 @@ static int __pmac media_bay_suspend(stru
bay->sleeping = 1;
set_mb_power(bay, 0);
up(&bay->lock);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
+ msleep(MB_POLL_DELAY);
mdev->ofdev.dev.power_state = state;
}
return 0;
@@ -740,8 +736,7 @@ static int __pmac media_bay_resume(struc
/* Force MB power to 0 */
down(&bay->lock);
set_mb_power(bay, 0);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(MS_TO_HZ(MB_POWER_DELAY));
+ msleep(MB_POWER_DELAY);
if (bay->ops->content(bay) != bay->content_id) {
printk("mediabay%d: content changed during sleep...\n", bay->index);
up(&bay->lock);
@@ -755,8 +750,7 @@ static int __pmac media_bay_resume(struc
bay->cd_retry = 0;
#endif
do {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
+ msleep(MB_POLL_DELAY);
media_bay_step(bay->index);
} while((bay->state != mb_empty) &&
(bay->state != mb_up));
[-- 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
next reply other threads:[~2004-07-23 21:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-23 21:48 Nishanth Aravamudan [this message]
2004-07-28 17:49 ` [Kernel-janitors] [PATCH] macintosh/mediabay: replace MS_TO_HZ() Nishanth Aravamudan
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=20040723214854.GO2675@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.