Port-powerpc archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
panic mutex
Hi! all,
I encounter a (compiler?) bug?
My bebox panics on mutex_enter() in joyattach().
mtxm_owner (or mtxp_a) is initialized in mutex_init(). However, it
becomes dirty when seting the address to sc->sc_lock.
Index: joy_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/joy_isa.c,v
retrieving revision 1.13
diff -u -r1.13 joy_isa.c
--- joy_isa.c 23 Nov 2011 23:07:32 -0000 1.13
+++ joy_isa.c 5 Dec 2011 14:57:28 -0000
@@ -117,7 +117,10 @@
}
mutex_init(&isc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
+printf("%s: mutex=%d, 0x%x, 0x%x, 0x%x\n", __func__, sizeof(isc->sc_lock),
isc->sc_lock.u.p.mtxp_a, isc->sc_lock.u.p.mtxp_b[0],
isc->sc_lock.u.p.mtxp_b[1]);
sc->sc_lock = &isc->sc_lock;
+printf("%s: Re: sc mutex=%p, 0x%x, 0x%x, 0x%x\n", __func__, sc->sc_lock,
sc->sc_lock->u.p.mtxp_a, sc->sc_lock->u.p.mtxp_b[0],
sc->sc_lock->u.p.mtxp_b[1]);
+printf("%s: Re: isc mutex=%p, 0x%x, 0x%x, 0x%x\n", __func__, &isc->sc_lock,
isc->sc_lock.u.p.mtxp_a, isc->sc_lock.u.p.mtxp_b[0],
isc->sc_lock.u.p.mtxp_b[1]);
joyattach(sc);
}
joy_isa_attach: mutex=12, 0x0, 0x0, 0x0
joy_isa_attach: Re: sc mutex=0xd97c2d14, 0xd97c2d14, 0x0, 0x0
joy_isa_attach: Re: isc mutex=0xd97c2d14, 0xd97c2d14, 0x0, 0x0
arch/powerpc/include/mutex.h ---
struct kmutex {
union {
#ifdef __MUTEX_PRIVATE
struct {
volatile uintptr_t mtxm_owner;
ipl_cookie_t mtxm_ipl;
__cpu_simple_lock_t mtxm_lock;
} m;
#endif
struct {
uintptr_t mtxp_a;
uint32_t mtxp_b[2];
} p;
} u;
};
---------------------------------
Can I resolve this problem?
Thanks,
--
kiyohara
Home |
Main Index |
Thread Index |
Old Index