From 6c783c98e18a71834aa5ccb66ecd5556083a0e75 Mon Sep 17 00:00:00 2001
From: Michael Lotz <mmlr@mlotz.ch>
Date: Fri, 2 Nov 2012 15:39:16 +0100
Subject: [PATCH 2/2] Workaround possible spurious interrupts in marvell
yukon.
This comes from a similar patch in FreeBSD r234666 but does the check
and acknowledge in the case where we don't have any other interrupts.
Since the interrupt isn't used it is never unmasked and therefore the
check against the interrupt mask will always fail if the TWSI IRQ is
the only interrupt that happened hence possibly causing interrupt
storms until any other valid interrupt comes along, is handled and both
are acknowledged.
---
.../drivers/network/marvell_yukon/dev/msk/glue.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/glue.c b/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/glue.c
index 6b76ab6..13911c7 100644
a
|
b
|
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
47 | 47 | if (status == 0 || status == 0xffffffff || |
48 | 48 | (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || |
49 | 49 | (status & sc->msk_intrmask) == 0) { |
| 50 | |
| 51 | /* Clear possibly spurious TWSI IRQ, see FreeBSD r234666. */ |
| 52 | if ((status & Y2_IS_TWSI_RDY) != 0) |
| 53 | CSR_WRITE_4(sc, B2_I2C_IRQ, 1); |
| 54 | |
50 | 55 | CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); |
51 | 56 | return 0; |
52 | 57 | } |