gianfar: Fix suspend/resume for wol magic packet
authorClaudiu Manoil <claudiu.manoil@freescale.com>
Fri, 31 Jul 2015 15:38:32 +0000 (18:38 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Jul 2015 22:41:49 +0000 (15:41 -0700)
commit614b42426cc3483e8d5bc68a158c2dd47dc831d0
treef27c5e32b6d61f7101ea09bb39486697801013e4
parent8486830549189b109bfd40e8d38c6dd8b8f476db
gianfar: Fix suspend/resume for wol magic packet

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: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.c
This page took 0.025731 seconds and 5 git commands to generate.