Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Hangs with 100baseTX, RedHat 7.1, kernel 2.4.x and AlphaPC 164
@ 2001-10-04 15:12 Mads Peter Bach
  2001-10-04 15:28 ` Jay Estabrook
  2001-10-04 17:09 ` Michal Jaegermann
  0 siblings, 2 replies; 13+ messages in thread
From: Mads Peter Bach @ 2001-10-04 15:12 UTC (permalink / raw)
  To: RedHat Alphalinux List

Hello,

I've been trying to a net install of RedHat 7.1 on a machine with a Digital
AlphaPC 164 (not SX/LX) motherboard, but failed miserably, due to machine
hangs.

Last week, I finally installed from a CDROM instead, which went smoothly. It
turns out, that the reason the net install didn't work, was that any heavy
100baseTX ethernet activity, using normal size packets hung the machine.
I've tried multiple ethernet interfaces, both RealTek RTL-8139 based, and
DC21040 based, in 32 and 64 bit slots. When I finally dug up an old 10baseTX
ISA card, the problems went away.

The strange thing is, that the cards work fine, if I use a 2.2 kernel
(tested with 2.2.19). Others have posted that they needed to enable
CONFIG_PCI_QUIRKS, but that doesn't seem to be necessary for me (I've
haven't tested with heavy trafic more than 15 minutes, though).

I've tested the default 2.4 kernels, that come with RedHat 7.1, Linus'
Kernel 2.4.0 and 2.4.10, and all of them hang. I can still press the halt
button, and return to the SRM console, if that could be of any help in
discovering the cause of this.

I've seen other people, with what seems to the same problem post to the
list, without seeing any solutions posted, but hope that this detailed
description of the problem will spark an idea in someone :-)

Best regards

Mads Bach




^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Hangs with 100baseTX, RedHat 7.1, kernel 2.4.x and AlphaPC 164
@ 2001-10-05 13:17 Jemiolo, John
  0 siblings, 0 replies; 13+ messages in thread
From: Jemiolo, John @ 2001-10-05 13:17 UTC (permalink / raw)
  To: axp-list

The emergency time-out worked just fine :^)   I installed your patch in
place of the fix Jay performed last week on my xp1000..

That plus the ac4 patch, seems to make 2.4.10  stable (for me), as I
have been unable to hang it anymore.. 

Thanks
JJ 

-----Original Message-----
From: Ivan Kokshaysky [mailto:ink@jurassic.park.msu.ru]
Sent: Friday, October 05, 2001 6:32 AM
To: axp-list@redhat.com
Subject: Re: Hangs with 100baseTX, RedHat 7.1, kernel 2.4.x and AlphaPC
164


On Thu, Oct 04, 2001 at 06:26:10PM -0400, Jay Estabrook wrote:
> I think maybe Ivan has some patches that do a better job in that area,
> and I know he's going to submit them soon. Maybe he'll post them here
> for some additional testing... :-) :-)

Sure, especially because my latest patch doesn't work on a pc164,
as Richard reported. :-(
So I would return to my previous thought - compare the measured
frequency
with one reported in the hwrpb and return failure if we see twofold or
higher
difference. Also emergency timeout added, as you suggested.

Ivan.

--- 2.4.10/arch/alpha/kernel/time.c	Fri Oct  5 13:43:01 2001
+++ linux/arch/alpha/kernel/time.c	Fri Oct  5 13:53:20 2001
@@ -170,28 +170,28 @@ common_init_rtc(void)
 }
 
 /*
- * Calibrate CPU clock using legacy 8254 timer/counter. Stolen from
- * arch/i386/time.c.
+ * Calibrate CPU clock using legacy 8254 programmable interval timer.
+ * Based on arch/i386/time.c.
  */
 
-#define CALIBRATE_LATCH	(52 * LATCH)
-#define CALIBRATE_TIME	(52 * 1000020 / HZ)
+#define CALIBRATE_LATCH	0xffff
+#define TIMEOUT_COUNT	0x100000
 
 static unsigned long __init
-calibrate_cc_with_pic(void)
+calibrate_cc_with_pit(void)
 {
-	int cc;
-	unsigned long count = 0;
+	int cc, count = 0;
+	unsigned long freq, hwrpbfreq = hwrpb->cycle_freq;
 
 	/* Set the Gate high, disable speaker */
 	outb((inb(0x61) & ~0x02) | 0x01, 0x61);
 
 	/*
-	 * Now let's take care of CTC channel 2
+	 * Now let's take care of PIT channel 2
 	 *
-	 * Set the Gate high, program CTC channel 2 for mode 0,
+	 * Set the Gate high, program PIT channel 2 for mode 0,
 	 * (interrupt on terminal count mode), binary count,
-	 * load 5 * LATCH count, (LSB and MSB) to begin countdown.
+	 * load CALIBRATE_LATCH count (LSB and MSB) to begin countdown.
 	 */
 	outb(0xb0, 0x43);		/* binary, mode 0, LSB/MSB, Ch 2
*/
 	outb(CALIBRATE_LATCH & 0xff, 0x42);	/* LSB of count */
@@ -200,29 +200,23 @@ calibrate_cc_with_pic(void)
 	cc = rpcc();
 	do {
 		count++;
-	} while ((inb(0x61) & 0x20) == 0);
+	} while (!(inb(0x61) & 0x20) && count < TIMEOUT_COUNT);
 	cc = rpcc() - cc;
 
-	/* Error: ECTCNEVERSET */
-	if (count <= 1)
-		goto bad_ctc;
-
-	/* Error: ECPUTOOFAST */
-	if (count >> 32)
-		goto bad_ctc;
-
-	/* Error: ECPUTOOSLOW */
-	if (cc <= CALIBRATE_TIME)
-		goto bad_ctc;
+	/* Error: EPITNEVERSET or ECPUTOOFAST */
+	if (count <= 1 || count == TIMEOUT_COUNT)
+		goto bad_pit;
+
+	freq = ((long)cc * CLOCK_TICK_RATE) / (CALIBRATE_LATCH + 1);
+
+	/* CPU cycle frequency reported in the hwrpb is often bogus.
+	   However, even in the worst case the difference shouldn't
+	   exceed 30-40%, so we can still use hwrpb value to validate
+	   the frequency we've found with PIT. */
+	if ((max(freq, hwrpbfreq) + 1) / (min(freq, hwrpbfreq) + 1) < 2)
+		return freq;
 
-	return ((long)cc * 1000000) / CALIBRATE_TIME;
-
-	/*
-	 * The CTC wasn't reliable: we got a hit on the very first read,
-	 * or the CPU was so fast/slow that the quotient wouldn't fit in
-	 * 32 bits..
-	 */
- bad_ctc:
+ bad_pit:
 	return 0;
 }
 
@@ -249,7 +243,7 @@ time_init(void)
 
 	/* Calibrate CPU clock -- attempt #1.  */
 	if (!est_cycle_freq)
-		est_cycle_freq = calibrate_cc_with_pic();
+		est_cycle_freq = calibrate_cc_with_pit();
 
 	cc1 = rpcc_after_update_in_progress();
 



_______________________________________________
Axp-list mailing list
Axp-list@redhat.com
https://listman.redhat.com/mailman/listinfo/axp-list




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-10-08 14:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-04 15:12 Hangs with 100baseTX, RedHat 7.1, kernel 2.4.x and AlphaPC 164 Mads Peter Bach
2001-10-04 15:28 ` Jay Estabrook
2001-10-04 19:21   ` Mads Peter Bach
2001-10-04 22:26     ` Jay Estabrook
2001-10-04 23:02       ` Mads Peter Bach
2001-10-05 10:31       ` Ivan Kokshaysky
2001-10-07  7:48         ` Richard Henderson
2001-10-07 17:29           ` Jay Estabrook
2001-10-08  7:28             ` Richard Henderson
2001-10-08 14:39               ` Ivan Kokshaysky
2001-10-04 17:09 ` Michal Jaegermann
2001-10-04 18:30   ` Jay Estabrook
  -- strict thread matches above, loose matches on Subject: below --
2001-10-05 13:17 Jemiolo, John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox