[rtems-libbsd commit] qman_api.c: Prevent false clearing of IRQ status

Sebastian Huber sebh at rtems.org
Mon Oct 23 07:27:51 UTC 2017


Module:    rtems-libbsd
Branch:    master
Commit:    7f1f4282dcae5fcf3ed2c18b5b5f82b95301ff13
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=7f1f4282dcae5fcf3ed2c18b5b5f82b95301ff13

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu May 18 14:19:09 2017 +0200

qman_api.c: Prevent false clearing of IRQ status

Adding (p->irq_sources & ~QM_PIRQ_CSCI) to the clear mask means for
example we clear the QM_PIRQ_EQCI unconditionally.  This is a problem in
case this interrupt happens after the read of the interrupt status and
before the interrupt status clear.

---

 linux/drivers/soc/fsl/qbman/qman.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/linux/drivers/soc/fsl/qbman/qman.c b/linux/drivers/soc/fsl/qbman/qman.c
index 20a445e..de3fc7b 100644
--- a/linux/drivers/soc/fsl/qbman/qman.c
+++ b/linux/drivers/soc/fsl/qbman/qman.c
@@ -1071,15 +1071,17 @@ static irqreturn_t portal_isr(int irq, void *ptr)
 {
 	struct qman_portal *p = ptr;
 
-	u32 clear = QM_DQAVAIL_MASK | p->irq_sources;
+	u32 clear = QM_DQAVAIL_MASK;
 	u32 is = qm_in(&p->p, QM_REG_ISR) & p->irq_sources;
 
 	if (unlikely(!is))
 		return IRQ_NONE;
 
 	/* DQRR-handling if it's interrupt-driven */
-	if (is & QM_PIRQ_DQRI)
+	if (is & QM_PIRQ_DQRI) {
+		clear |= QM_PIRQ_DQRI;
 		__poll_portal_fast(p, QMAN_POLL_LIMIT);
+	}
 	/* Handling of anything else that's interrupt-driven */
 	clear |= __poll_portal_slow(p, is);
 	qm_out(&p->p, QM_REG_ISR, clear);




More information about the vc mailing list