Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jan 2010 17:17:24 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r203295 - stable/8/sys/sparc64/pci
Message-ID:  <201001311717.o0VHHOWM087371@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun Jan 31 17:17:24 2010
New Revision: 203295
URL: http://svn.freebsd.org/changeset/base/203295

Log:
  MFC: r203094
  
  - Zero the MSI/MSI-X queue argument, otherwise mtx_init(9) can panic
    indicating an already initialized lock.
  - Check for an empty MSI/MSI-X queue entry before asserting that we have
    received a MSI/MSI-X message in order to not panic in case of stray MSI/
    MSI-X queue interrupts which may happen in case of using an interrupt
    handler rather than a filter.

Modified:
  stable/8/sys/sparc64/pci/fire.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sparc64/pci/fire.c
==============================================================================
--- stable/8/sys/sparc64/pci/fire.c	Sun Jan 31 16:04:23 2010	(r203294)
+++ stable/8/sys/sparc64/pci/fire.c	Sun Jan 31 17:17:24 2010	(r203295)
@@ -852,7 +852,7 @@ fire_intr_register(struct fire_softc *sc
 		return (ENXIO);
 	fica = malloc((ino >= FO_EQ_FIRST_INO && ino <= FO_EQ_LAST_INO) ?
 	    sizeof(struct fire_msiqarg) : sizeof(struct fire_icarg), M_DEVBUF,
-	    M_NOWAIT);
+	    M_NOWAIT | M_ZERO);
 	if (fica == NULL)
 		return (ENOMEM);
 	fica->fica_sc = sc;
@@ -1838,13 +1838,13 @@ fire_msiq_common(struct intr_vector *iv,
 	qrec = &fmqa->fmqa_base[head];
 	word0 = qrec->fomqr_word0;
 	for (;;) {
+		if (__predict_false((word0 & FO_MQR_WORD0_FMT_TYPE_MASK) == 0))
+			break;
 		KASSERT((word0 & FO_MQR_WORD0_FMT_TYPE_MSI64) != 0 ||
 		    (word0 & FO_MQR_WORD0_FMT_TYPE_MSI32) != 0,
 		    ("%s: received non-MSI/MSI-X message in event queue %d "
 		    "(word0 %#llx)", device_get_nameunit(dev), msiq,
 		    (unsigned long long)word0));
-		if (__predict_false((word0 & FO_MQR_WORD0_FMT_TYPE_MASK) == 0))
-			break;
 		msi = (word0 & FO_MQR_WORD0_DATA0_MASK) >>
 		    FO_MQR_WORD0_DATA0_SHFT;
 		/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001311717.o0VHHOWM087371>