From 3af5af948172a9a7f397b64e507a6304644e3028 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 2 Nov 2012 15:39:16 +0100 Subject: [PATCH] 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. In that case an interrupt storm would be triggered that lasts until any other valid interrupt comes along, is handled and both are acknowledged. This may help with #8454 on some cards that exhibit the spurious TWSI IRQs. --- .../kernel/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 6b76ab605b..13911c7144 100644 --- 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 @@ -47,6 +47,11 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev) if (status == 0 || status == 0xffffffff || (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || (status & sc->msk_intrmask) == 0) { + + /* Clear possibly spurious TWSI IRQ, see FreeBSD r234666. */ + if ((status & Y2_IS_TWSI_RDY) != 0) + CSR_WRITE_4(sc, B2_I2C_IRQ, 1); + CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); return 0; }