From owner-freebsd-current@FreeBSD.ORG Sun Jul 11 15:43:57 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A08DF1065673; Sun, 11 Jul 2010 15:43:57 +0000 (UTC) (envelope-from rmgls@free.fr) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by mx1.freebsd.org (Postfix) with ESMTP id 113A18FC15; Sun, 11 Jul 2010 15:43:54 +0000 (UTC) Received: from free.fr (unknown [88.172.40.194]) by smtp3-g21.free.fr (Postfix) with ESMTP id 87D38818139; Sun, 11 Jul 2010 17:43:49 +0200 (CEST) To: Alexander Motin From: raoul Date: Sun, 11 Jul 2010 17:43:48 +0200 Sender: rmgls@free.fr Message-Id: <20100711154349.87D38818139@smtp3-g21.free.fr> Cc: Doug Barton , freebsd-current@freebsd.org Subject: Re: panic on dell laptop X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 11 Jul 2010 15:43:57 -0000 On Sun, 11 Jul 2010 13:28:34 +0300 Alexander Motin wrote: >> Doug Barton wrote: >> Try backing up to svn r209633 and see if you can boot. What you're >> describing is identical to a panic I had starting with the next >> revision, also on a Dell laptop. > Please try attached patch against HEAD. -- >Alexander Motin ----------------------------- >diff -ruNp isa.prev/atrtc.c isa/atrtc.c >--- isa.prev/atrtc.c 2010-07-11 11:43:18.000000000 +0300 >+++ isa/atrtc.c 2010-07-11 12:33:49.000000000 +0300 @@ -244,6 +244,7 @@ static int > atrtc_attach(device_t dev) > { > struct atrtc_softc *sc; >+ u_long s; > int i, diag; > sc = device_get_softc(dev); @ -260,7 +261,9 @@ atrtc_attach(device_t dev) > (resource_int_value(device_get_name(dev), device_get_unit(dev), > "clock", &i) != 0 || i != 0)) { > sc->intr_rid = 0; >- bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); >+ while (bus_get_resource(dev, SYS_RES_IRQ, sc->intr_rid, >+ &s, NULL) == 0 && s != 8) >+ sc->intr_rid++; > if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, > &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { > device_printf(dev,"Can't map interrupt.\n"); >diff -ruNp isa.prev/clock.c isa/clock.c >--- isa.prev/clock.c 2010-07-11 11:43:24.000000000 +0300 >+++ isa/clock.c 2010-07-11 13:25:45.000000000 +0300 @ -94,7 +94,8 @@ static int i8254_ticked; > > struct attimer_softc { > int intr_en; >- int intr_rid; >+ int port_rid, intr_rid; >+ struct resource *port_res; > struct resource *intr_res; > void *intr_handler; > struct timecounter tc; @@ -523,10 +524,14 @@ static int > attimer_attach(device_t dev) > { > struct attimer_softc *sc; >+ u_long s; > int i; > attimer_sc = sc = device_get_softc(dev); > bzero(sc, sizeof(struct attimer_softc)); >+ if (!(sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, >+ &sc->port_rid, IO_TIMER1, IO_TIMER1 + 3, 4, RF_ACTIVE))) >+ device_printf(dev,"Warning: Couldn't map I/O.\n"); > i8254_intsrc = intr_lookup_source(0); > if (i8254_intsrc != NULL) > i8254_pending = i8254_intsrc->is_pic->pic_source_pending; @@ -541,7 +546,9 @@ attimer_attach(device_t dev) > if (resource_int_value(device_get_name(dev), device_get_unit(dev), > "clock", &i) != 0 || i != 0) { > sc->intr_rid = 0; >- bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); >+ while (bus_get_resource(dev, SYS_RES_IRQ, sc->intr_rid, >+ &s, NULL) == 0 && s != 0) >+ sc->intr_rid++; > if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, > &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) { > device_printf(dev,"Can't map interrupt.\n"); Hi Alexander, your patch worked fine for me. Many Thanks Perhaps it would be a good thing to commit it? Bests Raoul rmgls@free.fr