Ticket #8454: 0002-Workaround-possible-spurious-interrupts-in-marvell-y.patch

File 0002-Workaround-possible-spurious-interrupts-in-marvell-y.patch, 1.5 KB (added by mmlr, 11 years ago)
  • src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/glue.c

    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)  
    4747    if (status == 0 || status == 0xffffffff ||
    4848        (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 ||
    4949        (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
    5055        CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
    5156        return 0;
    5257    }