Re: I made a patch and would like feedback/testers(drivers/cdrom/aztcd.c)
From: Arjan van de Ven
Date: Sun Nov 20 2005 - 10:37:40 EST
> static void op_ok(void)
> {
> - aztTimeOutCount = 0;
> + aztTimeOut = jiffies + 2;
> do {
> aztIndatum = inb(DATA_PORT);
> - aztTimeOutCount++;
> - if (aztTimeOutCount >= AZT_TIMEOUT) {
> + if (time_after(jiffies, aztTimeOut)) {
> printk("aztcd: Error Wait OP_OK\n");
> break;
> }
> + schedule_timeout_interruptible(1);
this I think is not quite right; schedule_timeout_*() doesn't do
anything unless you set current->state to something. And at that point
you might as well start using msleep()!
but what you're doing is generally a good idea; busy waits as the
original code did is quite wrong...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/