From owner-freebsd-current@FreeBSD.ORG Thu Mar 25 04:58:54 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E1F916A4CE for ; Thu, 25 Mar 2004 04:58:54 -0800 (PST) Received: from gate.leissner.se (gate.leissner.se [212.3.0.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E56943D2D for ; Thu, 25 Mar 2004 04:58:53 -0800 (PST) (envelope-from pol@leissner.se) Received: (from uucp@localhost) by gate.leissner.se (8.9.3-030919/8.9.3) id NAA28006; Thu, 25 Mar 2004 13:58:46 +0100 (CET) Received: from UNKNOWN(192.71.29.17), claiming to be "pol.leissner.se" via SMTP by gate.leissner.se, id smtpdC27989; Thu Mar 25 13:58:39 2004 Received: from pol.leissner.se (localhost.leissner.se [127.0.0.1]) by pol.leissner.se (8.12.10/8.12.10) with ESMTP id i2PCwduN074100; Thu, 25 Mar 2004 13:58:39 +0100 (CET) (envelope-from pol@leissner.se) Received: from localhost (pol@localhost)i2PCwcFx074097; Thu, 25 Mar 2004 13:58:38 +0100 (CET) (envelope-from pol@leissner.se) X-Authentication-Warning: pol.leissner.se: pol owned process doing -bs Date: Thu, 25 Mar 2004 13:58:38 +0100 (CET) From: Peter Olsson To: Bruce Evans In-Reply-To: <20040325220231.G36592@gamplex.bde.org> Message-ID: <20040325135434.B52637@pol.leissner.se> References: <20040315211204.U1455@pol.leissner.se> <20040316.090601.94400079.imp@bsdimp.com> <20040324153456.Y75255@pol.leissner.se> <20040325220231.G36592@gamplex.bde.org> X-NCC-RegID: se.leissner X-Organization: Leissner Data AB MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org Subject: Re: 5.2.1-RELEASE boot-hang with Cyclades pci card Cyclom-16YeP/RJ45 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 12:58:54 -0000 On Thu, 25 Mar 2004, Bruce Evans wrote: > 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: This fix solves the boot hang problem with SMP and apic in the kernel. Thanks! > %%% > 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 > @@ -429,10 +441,4 @@ > 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 > -- Peter Olsson pol@leissner.se CCIE #8963 +46 520 500511 Leissner Data AB +46 701 809511