Re: 5.2.1-RELEASE boot-hang with Cyclades pci card Cyclom-16YeP/RJ45

From: Bruce Evans <bde_at_zeta.org.au>
Date: Thu, 25 Mar 2004 22:34:08 +1100 (EST)
On Wed, 24 Mar 2004, Peter Olsson wrote:

> I have tried this now. I have a different server, a different cyclades
> PCI card and a different port card (with 8 ports). Same boot hang problem
> after adding the cy driver and COMPAT_ISA. Booting without acpi didn't
> help. After a while I got this in the hung boot, if it is interesting:
> spin lock (null) held by 0 for > 5 seconds
> panic: spin lock held too long
> cpuid = 0;
> Uptime: 1s
> Shutting down ACPI
> Automatic reboot in 15 seconds
>
> Then I commented out these two lines in my kernel file:
> options SMP
> device apic
> With the new kernel the server boots ok with the cyclades card
> connected, and I get contact with the router on port 1 in the port card.
> I didn't have to boot without acpi, just commenting out SMP and apic
> made it work.

Yikes.  I think I see the problem.  The lock is only initialized in
the isa probe.  This is harmless in the !SMP case, since the lock is
not used then, but it is harmful in the SMP case if there is a pci cy
card, at least if there is isn't also an isa cy card to get the isa
probe called.  The bug has only been there since rev.1.135 of cy.c,
so it was in 5.2 but not 5.1.

Untested quick fix:

%%%
Index: cy.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/cy.c,v
retrieving revision 1.140
diff -u -2 -r1.140 cy.c
--- cy.c	21 Feb 2004 21:10:50 -0000	1.140
+++ cy.c	25 Mar 2004 11:18:51 -0000
_at__at_ -429,10 +441,4 _at__at_
 	cy_addr	iobase;

-	while (sio_inited != 2)
-		if (atomic_cmpset_int(&sio_inited, 0, 1)) {
-			mtx_init(&sio_lock, driver_name, NULL, MTX_SPIN);
-			atomic_store_rel_int(&sio_inited, 2);
-		}
-
 	iobase = (cy_addr)dev->id_maddr;

%%%

> We can live without SMP and apic if they are only in the kernel for
> multiple CPU support. By the way, does Hyper Threading in the CPU
> require SMP/apic?

It needs SMP, but neither SMP nor Hyper Threading shouldn't need apic
in theory (they used to).

Bruce
Received on Thu Mar 25 2004 - 02:34:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:48 UTC