Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/dev/ic Pull up following revision(s) (requested by sb...



details:   https://anonhg.NetBSD.org/src/rev/b69c535e2abd
branches:  netbsd-6
changeset: 773953:b69c535e2abd
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Mar 22 22:58:23 2012 +0000

description:
Pull up following revision(s) (requested by sborrill in ticket #136):
        sys/dev/ic/mfi.c: revision 1.37
>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 03f3f9c1b667 -r b69c535e2abd sys/dev/ic/mfi.c
--- a/sys/dev/ic/mfi.c  Thu Mar 22 22:56:54 2012 +0000
+++ b/sys/dev/ic/mfi.c  Thu Mar 22 22:58:23 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.36.8.1 2012/03/22 22:58:23 riz 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.36.8.1 2012/03/22 22:58:23 riz 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