From d6dd4af4acbc1057fb21719fe5b7249fec4512f7 Mon Sep 17 00:00:00 2001 From: Bruce M Simpson Date: Wed, 27 Oct 2004 19:02:23 +0000 Subject: Forcibly disable interrupts, if we find ourselves servicing one when the device is suspended or shutting down. This will need to be rethought slightly if we implement suspend/resume support within vr(4). This appears to fix the vr_shutdown() panic on SMP machines. My theory here is there's a race somewhere during vr_detach() with vr_intr() in the SMP case which was sometimes being triggered, although quite why this was happening is unclear (vr_stop() also explicitly disables interrupts by writing to the IMR register). MFC-to-RELENG_5* candidate. PR: kern/62889 Tested by: seb at struchtrup dot com MFC after: 10 days --- sys/dev/vr/if_vr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sys/dev/vr') diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index d509b136df72..6febeaf05d73 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -1233,8 +1233,15 @@ vr_intr(void *arg) VR_LOCK(sc); - if (sc->suspended) + if (sc->suspended) { + /* + * Forcibly disable interrupts. + * XXX: Mobile VIA based platforms may need + * interrupt re-enable on resume. + */ + CSR_WRITE_2(sc, VR_IMR, 0x0000); goto done_locked; + } #ifdef DEVICE_POLLING if (ifp->if_flags & IFF_POLLING) -- cgit v1.3