linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: ipa: fix a suspend hang
@ 2021-01-07 21:43 Alex Elder
  2021-01-07 21:43 ` [PATCH net 1/2] net: ipa: introduce atomic channel STOPPING flag Alex Elder
  2021-01-07 21:43 ` [PATCH net 2/2] net: ipa: re-enable NAPI before enabling interrupt Alex Elder
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Elder @ 2021-01-07 21:43 UTC (permalink / raw)
  To: davem, kuba
  Cc: evgreen, bjorn.andersson, cpratapa, subashab, netdev, linux-kernel

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(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-08 20:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 21:43 [PATCH net 0/2] net: ipa: fix a suspend hang Alex Elder
2021-01-07 21:43 ` [PATCH net 1/2] net: ipa: introduce atomic channel STOPPING flag Alex Elder
2021-01-07 21:43 ` [PATCH net 2/2] net: ipa: re-enable NAPI before enabling interrupt Alex Elder
2021-01-08  2:38   ` Jakub Kicinski
2021-01-08 20:16     ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).