Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2009 14:55:29 -0600
From:      Christian Peron <csjp@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r187714 - head/sys/dev/ppbus
Message-ID:  <20090126205529.GA44291@jnz.sqrt.ca>
In-Reply-To: <200901261412.n0QECDLO052207@svn.freebsd.org>
References:  <200901261412.n0QECDLO052207@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

John

I think I found another issue relating to these changes.  The patch I have
attached fixes a panic on bootup in lpt.

Any objections?

On Mon, Jan 26, 2009 at 02:12:13PM +0000, John Baldwin wrote:
> Author: jhb
> Date: Mon Jan 26 14:12:12 2009
> New Revision: 187714
> URL: http://svn.freebsd.org/changeset/base/187714
> 
> Log:
>   Add missing locking around setting the ppc interrupt handler IVAR.
>   
>   Reported by:	    many
> 
> Modified:
>   head/sys/dev/ppbus/ppbconf.c
> 
> Modified: head/sys/dev/ppbus/ppbconf.c
> ==============================================================================
> --- head/sys/dev/ppbus/ppbconf.c	Mon Jan 26 14:03:39 2009	(r187713)
> +++ head/sys/dev/ppbus/ppbconf.c	Mon Jan 26 14:12:12 2009	(r187714)
> @@ -393,8 +393,10 @@ ppbus_attach(device_t dev)
>  	ppb->ppc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
>  	    RF_SHAREABLE);
>  	if (ppb->ppc_irq_res != NULL) {
> +		mtx_lock(ppb->ppc_lock);
>  		error = BUS_WRITE_IVAR(device_get_parent(dev), dev,
>  		    PPC_IVAR_INTR_HANDLER, (uintptr_t)&ppbus_intr);
> +		mtx_unlock(ppb->ppc_lock);
>  		if (error) {
>  			device_printf(dev, "Unable to set interrupt handler\n");
>  			return (error);

--Kj7319i9nmIyA2yE
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="lpt.c.diff"

Index: lpt.c
===================================================================
--- lpt.c	(revision 187723)
+++ lpt.c	(working copy)
@@ -380,9 +380,8 @@
 	}
 
 	ppb_wctr(ppbus, LPC_NINIT);
-	ppb_unlock(ppbus);
 	lpt_release_ppbus(dev);
-
+	ppb_unlock(ppbus);
 	/* declare our interrupt handler */
 	sc->sc_intr_resource = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_SHAREABLE);

--Kj7319i9nmIyA2yE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090126205529.GA44291>