[PATCH 10/13] use cpu_relax() in busy loop

From: Chris Wright
Date: Thu Sep 18 2003 - 18:43:46 EST


Replace busy loop nop with cpu_relax().

===== drivers/isdn/hardware/avm/avmcard.h 1.17 vs edited =====
--- 1.17/drivers/isdn/hardware/avm/avmcard.h Wed Sep 3 03:09:05 2003
+++ edited/drivers/isdn/hardware/avm/avmcard.h Thu Sep 18 11:17:09 2003
@@ -233,7 +233,8 @@
static inline unsigned char b1_get_byte(unsigned int base)
{
unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */
- while (!b1_rx_full(base) && time_before(jiffies, stop));
+ while (!b1_rx_full(base) && time_before(jiffies, stop))
+ cpu_relax();
if (b1_rx_full(base))
return inb(base + B1_READ);
printk(KERN_CRIT "b1lli(0x%x): rx not full after 1 second\n", base);
@@ -264,7 +265,8 @@
static inline int b1_save_put_byte(unsigned int base, unsigned char val)
{
unsigned long stop = jiffies + 2 * HZ;
- while (!b1_tx_empty(base) && time_before(jiffies,stop));
+ while (!b1_tx_empty(base) && time_before(jiffies,stop))
+ cpu_relax();
if (!b1_tx_empty(base)) return -1;
b1outp(base, B1_WRITE, val);
return 0;

-
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/