lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 4 Aug 2006 08:56:23 +0200
From:	Willy Tarreau <w@....eu>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Jukka Partanen <jspartanen@...il.com>, kkeil@...e.de,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2.4.32] Fix AVM C4 ISDN card init problems with newer CPUs

On Thu, Aug 03, 2006 at 06:56:15PM +0100, Alan Cox wrote:
> Ar Iau, 2006-08-03 am 19:53 +0300, ysgrifennodd Jukka Partanen:
> > AVM C4 ISDN NIC: Add three memory barriers, taken from 2.6.7,
> > (they are there in 2.6.17.7 too), to fix module initialization
> > problems appearing with at least some newer Celerons and
> > Pentium III.
> 
> Should be using cpu_relax() I think. Its a polled busy loop so you want
> other CPU threads to run if possible.

You mean like this ? Here's the patch for 2.6, I'll queue the same for 2.4
if it's alright.

> Alan

Regards,
Willy

>From 512d12bd7ce9c0a15dfd91a6f7c2970c92b3abdd Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@....eu>
Date: Fri, 4 Aug 2006 08:50:10 +0200
Subject: [PATCH] AVM C4 ISDN card : use cpu_relax() in busy loops

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@....eu>
---
 drivers/isdn/hardware/avm/c4.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
index f7253b2..aee278e 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>
@@ -150,6 +151,7 @@ static inline int wait_for_doorbell(avmc
 		if (!time_before(jiffies, stop))
 			return -1;
 		mb();
+		cpu_relax();
 	}
 	return 0;
 }
@@ -303,6 +305,7 @@ static void c4_reset(avmcard *card)
 			return;
 		c4outmeml(card->mbase+DOORBELL, DBELL_ADDR);
 		mb();
+		cpu_relax();
 	}
 
 	c4_poke(card, DC21285_ARMCSR_BASE + CHAN_1_CONTROL, 0);
@@ -327,6 +330,7 @@ static int c4_detect(avmcard *card)
 			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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ