Skip to content

net: ipa: fix a suspend hang

Alex Elder lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: ipa: introduce atomic channel STOPPING flagdrivers/net/ipa/gsi.c drivers/net/ipa/gsi.h+16 -10 replies
2/2net: ipa: re-enable NAPI before enabling interruptdrivers/net/ipa/gsi.c+4 -42 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/2] net: ipa: fix a suspend hang

The IPA driver's PM suspend callback stops all channels, and its resume callback restarts them again. Part of stopping a channel is disabling NAPI and disabling its I/O completion interrupt.

When stopping a channel, the IPA driver currently disables NAPI before disabling the interrupt. It also re-enables interrupts before re-enabling NAPI. The interrupt handler can therefore be called while NAPI is disabled.

If the interrupt signaling a transfer completion occurs while NAPI is disabled, NAPI polling will not be scheduled to process that completion. That processing will be delayed, occuring only when a subsequent interrupt schedules NAPI polling when NAPI is enabled again.

The second patch in this series reorders the NAPI and interrupt control calls. The completion interrupt is disabled before NAPI when stopping a channel, and re-enabled after NAPI when starting. This way polling to handle the completion of a transfer can begin immediately when handling its interrupt. And if a completion occurs while the interrupt is disabled, the handler will trigger polling when interrupts are enabled again.

The first patch adds a flag that prevents the poll function from re-enabling the interrupt when stopping.

Without this fix in place we would occasionally see a hang while stopping channels during suspend.

-Alex

Alex Elder (2):
net: ipa: introduce atomic channel STOPPING flag
net: ipa: re-enable NAPI before enabling interrupt

 drivers/net/ipa/gsi.c | 15 ++++++++++++---
 drivers/net/ipa/gsi.h |  6 ++++++
 2 files changed, 18 insertions(+), 3 deletions(-)
Signature · 1 line
2.20.1