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);
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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to