• Claudiu Manoil's avatar
    gianfar: Fix suspend/resume for wol magic packet · 614b4242
    Claudiu Manoil authored
    If we disable NAPI in the first place we can mask the device's
    interrupts (and halt it) without fearing that imask may be
    concurrently accessed from interrupt context, so there's
    no need to do local_irq_save() around gfar_halt_nodisable().
    lock_rx_qs()/unlock_tx_qs() are just obsoleted and potentially
    buggy routines.  The txlock is currently used in the driver only
    to manage TX congestion, it has nothing to do with halting the
    device.  With these changes, the TX processing is stopped before
    gfar_halt().
    
    Compact gfar_halt() is used instead of gfar_halt_nodisable(),
    as it disables Rx/TX DMA h/w blocks and the Rx/TX h/w queues.
    gfar_start() re-enables all these blocks on resume.  Enabling
    the magic-packet mode remains the same, note that the RX block
    is re-enabled just before entering sleep mode.
    
    Add IRQF_NO_SUSPEND flag for the error interrupt line, to signal
    that the interrupt line must remain active during sleep in order
    to wake the system by magic packet (MAG) reception interrupt.
    (On some systems the MAG interrupt did trigger w/o this flag
    as well, but on others it didn't.)
    
    Without these fixes, when suspended during fair Tx traffic the
    interface occasionally failed to be woken up by magic packet.
    Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    614b4242
gianfar.c 92.8 KB