Messages in this thread Patch in this message | | | Date | Fri, 19 Sep 2003 12:48:45 -0700 | From | Chris Wright <> | Subject | Re: [PATCH 4/13] use cpu_relax() in busy loop |
| |
* Arjan van de Ven (arjanv@redhat.com) wrote: > > mdelay ?
Yeah, good point. For these subsecond pauses mdelay() makes more sense. It'd be nice to get rid of long busy loops in general. Thanks for taking a look.
-chris
[PATCH 4/13] use mdelay() instead of busy loop
Replace busy loop with mdelay().
===== drivers/cdrom/sonycd535.c 1.39 vs edited ===== --- 1.39/drivers/cdrom/sonycd535.c Tue Sep 9 07:41:30 2003 +++ edited/drivers/cdrom/sonycd535.c Fri Sep 19 10:36:18 2003 @@ -129,6 +129,7 @@ #include <linux/mm.h> #include <linux/slab.h> #include <linux/init.h> +#include <linux/delay.h> #define REALLY_SLOW_IO #include <asm/system.h> @@ -1520,13 +1521,12 @@ /* A negative sony535_irq_used will attempt an autoirq. */ if (sony535_irq_used < 0) { - unsigned long irq_mask, delay; + unsigned long irq_mask; irq_mask = probe_irq_on(); enable_interrupts(); outb(0, read_status_reg); /* does a reset? */ - delay = jiffies + HZ/10; - while (time_before(jiffies, delay)) ; + mdelay(100); sony535_irq_used = probe_irq_off(irq_mask); disable_interrupts(); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |