From owner-svn-src-all@FreeBSD.ORG Wed Jan 27 20:30:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D53F51065670; Wed, 27 Jan 2010 20:30:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4DA18FC17; Wed, 27 Jan 2010 20:30:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0RKUE2Z020671; Wed, 27 Jan 2010 20:30:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0RKUEJZ020669; Wed, 27 Jan 2010 20:30:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001272030.o0RKUEJZ020669@svn.freebsd.org> From: Marius Strobl Date: Wed, 27 Jan 2010 20:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203094 - head/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2010 20:30:14 -0000 Author: marius Date: Wed Jan 27 20:30:14 2010 New Revision: 203094 URL: http://svn.freebsd.org/changeset/base/203094 Log: - 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. MFC after: 3 days Modified: head/sys/sparc64/pci/fire.c Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Wed Jan 27 20:25:46 2010 (r203093) +++ head/sys/sparc64/pci/fire.c Wed Jan 27 20:30:14 2010 (r203094) @@ -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; /*