Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic From OpenBSD. Fixes a deadlock during autoconf.



details:   https://anonhg.NetBSD.org/src/rev/34b8ff234f35
branches:  trunk
changeset: 778291:34b8ff234f35
user:      sborrill <sborrill%NetBSD.org@localhost>
date:      Wed Mar 21 13:19:11 2012 +0000

description:
>From OpenBSD. Fixes a deadlock during autoconf.

scrub more fields in the ccb when returning them to the free list after
theyve been used, in particular the mfi header flags which has a bit
that specifies if a command should be completed via the interrupt path.

if we use a ccb during boot we set that bit, but it isnt necessarily
cleared by things that use it later on. this means a ccb we expected to
complete via an interrupt never actually generates an interrupt or appears
in the reply queue. this obviously stalls the io.

diffstat:

 sys/dev/ic/mfi.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r 973de22f6f87 -r 34b8ff234f35 sys/dev/ic/mfi.c
--- a/sys/dev/ic/mfi.c  Wed Mar 21 10:14:19 2012 +0000
+++ b/sys/dev/ic/mfi.c  Wed Mar 21 13:19:11 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi.c,v 1.36 2011/06/20 22:02:55 pgoyette Exp $ */
+/* $NetBSD: mfi.c,v 1.37 2012/03/21 13:19:11 sborrill Exp $ */
 /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom <marco%peereboom.us@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.36 2011/06/20 22:02:55 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.37 2012/03/21 13:19:11 sborrill Exp $");
 
 #include "bio.h"
 
@@ -180,11 +180,13 @@
 mfi_put_ccb(struct mfi_ccb *ccb)
 {
        struct mfi_softc        *sc = ccb->ccb_sc;
+       struct mfi_frame_header *hdr = &ccb->ccb_frame->mfr_header;
        int                     s;
 
        DNPRINTF(MFI_D_CCB, "%s: mfi_put_ccb: %p\n", DEVNAME(sc), ccb);
 
-       s = splbio();
+       hdr->mfh_cmd_status = 0x0;
+       hdr->mfh_flags = 0x0;
        ccb->ccb_state = MFI_CCB_FREE;
        ccb->ccb_xs = NULL;
        ccb->ccb_flags = 0;
@@ -195,6 +197,8 @@
        ccb->ccb_sgl = NULL;
        ccb->ccb_data = NULL;
        ccb->ccb_len = 0;
+
+       s = splbio();
        TAILQ_INSERT_TAIL(&sc->sc_ccb_freeq, ccb, ccb_link);
        splx(s);
 }



Home | Main Index | Thread Index | Old Index