[PATCH] AVM C4 ISDN card : use cpu_relax() in busy loops

From: Willy Tarreau
Date: Fri Aug 04 2006 - 16:11:23 EST


As suggested by Alan, use cpu_relax() in 3 busy loops : "It's a
polled busy loop so you want other CPU threads to run if possible".

Signed-off-by: Willy Tarreau <w@xxxxxx>
---
drivers/isdn/hardware/avm/c4.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
index f7253b2..8149dce 100644
--- a/drivers/isdn/hardware/avm/c4.c
+++ b/drivers/isdn/hardware/avm/c4.c
@@ -22,6 +22,7 @@ #include <linux/capi.h>
#include <linux/kernelcapi.h>
#include <linux/init.h>
#include <asm/io.h>
+#include <asm/processor.h>
#include <asm/uaccess.h>
#include <linux/netdevice.h>
#include <linux/isdn/capicmd.h>
@@ -149,7 +150,7 @@ static inline int wait_for_doorbell(avmc
while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) {
if (!time_before(jiffies, stop))
return -1;
- mb();
+ cpu_relax();
}
return 0;
}
@@ -302,7 +303,7 @@ static void c4_reset(avmcard *card)
if (!time_before(jiffies, stop))
return;
c4outmeml(card->mbase+DOORBELL, DBELL_ADDR);
- mb();
+ cpu_relax();
}

c4_poke(card, DC21285_ARMCSR_BASE + CHAN_1_CONTROL, 0);
@@ -326,7 +327,7 @@ static int c4_detect(avmcard *card)
if (!time_before(jiffies, stop))
return 2;
c4outmeml(card->mbase+DOORBELL, DBELL_ADDR);
- mb();
+ cpu_relax();
}

c4_poke(card, DC21285_ARMCSR_BASE + CHAN_1_CONTROL, 0);
--
1.4.1

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