From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [Kernel-janitors] Re: sis-agp: replace schedule_timeout() with
Date: Tue, 20 Jul 2004 23:15:57 +0000 [thread overview]
Message-ID: <20040720231557.GB1957@us.ibm.com> (raw)
In-Reply-To: <20040720223919.GA2447@masina>
[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]
On Wed, Jul 21, 2004 at 12:39:19AM +0200, Domen Puncer wrote:
> On 20/07/04 21:01 +0000, Nishanth Aravamudan wrote:
> ...
> > --- linux-vanilla/drivers/char/agp/sis-agp.c 2004-06-16 05:18:56.000000000 +0000
> ...
> > - set_current_state(TASK_UNINTERRUPTIBLE);
> > - schedule_timeout (1+(HZ*10)/1000);
> > + msleep(HZ); /* sleep 1s */
>
> Umm... what?
> I mean... HZ jiffies is one second, but HZ miliseconds is not necessary 1 s.
> And that delay looks wierd, what was the point of HZ*10/1000 in the first
> place? Why not HZ/100?
Thanks again Domen! I totally missed this one - I'm trying to check my
patches as I submit them to the list, but I must not have been paying
close enough attention. You are right, it should be msleep(10). Please
find the corrected patch below. I am not positive as to why the conversion
was originally done the way it was, but I think it prevents rounding
erros. If HZ is very small, then the 1+ guarantees *some* timeout. As to
why they didn't finish their math, well the compiler should take care of
the immediate values (I think) but also, it is a readability thing.
Again, working with msecs directly is clearer. msleep(10) it is.
-Nish
--- linux-vanilla/drivers/char/agp/sis-agp.c 2004-06-16 05:18:56.000000000 +0000
+++ linux-dev/drivers/char/agp/sis-agp.c 2004-07-15 23:11:23.000000000 +0000
@@ -5,6 +5,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
+#include <linux/delay.h>
#include <linux/agp_backend.h>
#include "agp.h"
@@ -102,8 +103,7 @@ static void sis_delayed_enable(u32 mode)
*/
if (device->device == agp_bridge->dev->device) {
printk(KERN_INFO PFX "SiS delay workaround: giving bridge time to recover.\n");
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout (1+(HZ*10)/1000);
+ msleep(10); /* sleep 10ms */
}
}
}
[-- 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
prev parent reply other threads:[~2004-07-20 23:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-20 22:39 [Kernel-janitors] Re: sis-agp: replace schedule_timeout() with Domen Puncer
2004-07-20 23:15 ` Nishanth Aravamudan [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=20040720231557.GB1957@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.