diff options
author | marius <marius@FreeBSD.org> | 2010-01-27 20:30:14 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2010-01-27 20:30:14 +0000 |
commit | e5e173f5c09da3def3ed6ac6c0da253a7625cb35 (patch) | |
tree | e70243aa872fee168095a7db750ef28948c8e799 /sys/sparc64/pci/fire.c | |
parent | f3b3ede9be1a20d78ac5f23b94dde56dd83faee2 (diff) | |
download | FreeBSD-src-e5e173f5c09da3def3ed6ac6c0da253a7625cb35.zip FreeBSD-src-e5e173f5c09da3def3ed6ac6c0da253a7625cb35.tar.gz |
- 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
Diffstat (limited to 'sys/sparc64/pci/fire.c')
-rw-r--r-- | sys/sparc64/pci/fire.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/sparc64/pci/fire.c b/sys/sparc64/pci/fire.c index f8a18c1..4a3b060 100644 --- a/sys/sparc64/pci/fire.c +++ b/sys/sparc64/pci/fire.c @@ -852,7 +852,7 @@ fire_intr_register(struct fire_softc *sc, u_int ino) 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, struct fire_msiqarg *fmqa) 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; /* |