svn commit: r187576 - in head/sys/dev: ppbus ppc

John Baldwin jhb at freebsd.org
Thu Jan 22 07:41:55 PST 2009


On Thursday 22 January 2009 1:48:43 am Jeff Roberson wrote:
> On Wed, 21 Jan 2009, John Baldwin wrote:
> 
> > Author: jhb
> > Date: Wed Jan 21 23:10:06 2009
> > New Revision: 187576
> > URL: http://svn.freebsd.org/changeset/base/187576
> >
> > Log:
> >  Add locking to ppc and ppbus and mark the whole lot MPSAFE:
> 
> Looks like there might be some kinks still:
> 
> ppc0: <Parallel port> port 0x378-0x37f,0x778-0x77f irq 7 drq 3 on acpi0
> ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
> ppc0: FIFO with 16/16/9 bytes threshold
> ppc0: [ITHREAD]
> ppbus0: <Parallel port bus> on ppc0
> panic: mutex ppc0 not owned at ../../../dev/ppc/ppc.c:1983
> cpuid = 0
> KDB: enter: panic
> [thread pid 0 tid 100000 ]
> Stopped at      kdb_enter+0x3d: movq    $0,0x652ea8(%rip)
> _mtx_assert() at _mtx_assert+0xdc
> ppc_write_ivar() at ppc_write_ivar+0x6e
> ppbus_attach() at ppbus_attach+0x14b

Grrr, I had booted this a while ago.  This should fix that particular 
assertion:

--- //depot/user/jhb/acpipci/dev/ppbus/ppbconf.c#20
+++ /home/jhb/work/p4/acpipci/dev/ppbus/ppbconf.c
@@ -393,8 +393,10 @@
 	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);

-- 
John Baldwin


More information about the svn-src-all mailing list