All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: davem@davemloft.net, kuba@kernel.org
Cc: evgreen@chromium.org, subashab@codeaurora.org,
	cpratapa@codeaurora.org, bjorn.andersson@linaro.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v2 0/7] net: ipa: wake up system on RX available
Date: Fri, 11 Sep 2020 19:45:25 -0500	[thread overview]
Message-ID: <20200912004532.1386-1-elder@linaro.org> (raw)

This series arranges for the IPA driver to wake up a suspended
system if the IPA hardware has a packet to deliver to the AP.
Version 2 replaces the first patch from version 1 with three
patches, in response to David Miller's feedback.

Specifically:
  - The first patch now replaces an atomic_t field with a
    refcount_t.  The affected field is not the one David
    commented on, but this fix is consistent with what he
    asked for.
  - The second patch replaces the atomic_t field David *did*
    comment on with a single bit in a new bitmap field;
    ultimately what's needed there is a Boolean flag anyway.
  - The third patch is renamed, but basically does the same
    thing the first patch did in version 1.  It now operates
    on a bit in a bitmap rather than on an atomic variable.

Currently, the GSI interrupt is set up to be a waking interrupt.
But the GSI interrupt won't actually fire for a stopped channel (or
a channel that underlies a suspended endpoint).  The fix involves
having the IPA rather than GSI interrupt wake up the AP.

The IPA hardware clock is managed by both the modem and the AP.
Even if the AP is in a fully-suspended state, the modem can clock
the IPA hardware, and can send a packet through IPA that is destined
for an endpoint on the AP.

When the IPA hardware finds a packet's destination is stopped or
suspended, it sends an *IPA interrupt* to the destination "execution
environment" (EE--in this case, the AP).  The desired behavior is
for the EE (even if suspended) to be able to handle the incoming
packet.

To do this, we arrange for the IPA interrupt to be a wakeup
interrupt.  And if the system is suspended when that interrupt
fires, we trigger a system resume operation.  While resuming the
system, the IPA driver starts all its channels (or for SDM845,
takes its endpoints out of suspend mode).

Whenever an RX channel is started, if it has a packet ready to be
consumed, the GSI interrupt will fire.  At this point the inbound
packet that caused this wakeup activity will be received.

The first three patches in the series were described above.  The
next three arrange for the IPA interrupt wake up the system.
Finally, with this design, we no longer want the GSI interrupt to
wake a suspended system, so that is removed by the last patch.

					-Alex


Alex Elder (7):
  net: ipa: use refcount_t for IPA clock reference count
  net: ipa: replace ipa->suspend_ref with a flag bit
  net: ipa: verify reference flag values
  net: ipa: manage endpoints separate from clock
  net: ipa: use device_init_wakeup()
  net: ipa: enable wakeup on IPA interrupt
  net: ipa: do not enable GSI interrupt for wakeup

 drivers/net/ipa/gsi.c           | 17 ++------
 drivers/net/ipa/gsi.h           |  1 -
 drivers/net/ipa/ipa.h           | 16 +++++--
 drivers/net/ipa/ipa_clock.c     | 28 +++++-------
 drivers/net/ipa/ipa_interrupt.c | 14 ++++++
 drivers/net/ipa/ipa_main.c      | 76 +++++++++++++++++++--------------
 6 files changed, 84 insertions(+), 68 deletions(-)

-- 
2.20.1


             reply	other threads:[~2020-09-12  0:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12  0:45 Alex Elder [this message]
2020-09-12  0:45 ` [PATCH net-next v2 1/7] net: ipa: use refcount_t for IPA clock reference count Alex Elder
2020-09-12  0:45 ` [PATCH net-next v2 2/7] net: ipa: replace ipa->suspend_ref with a flag bit Alex Elder
2020-09-12  0:45 ` [PATCH net-next v2 3/7] net: ipa: verify reference flag values Alex Elder
2020-09-13  2:25   ` Bjorn Andersson
2020-09-13 13:36     ` Alex Elder
2020-09-12  0:45 ` [PATCH net-next v2 4/7] net: ipa: manage endpoints separate from clock Alex Elder
2020-09-13  2:30   ` Bjorn Andersson
2020-09-12  0:45 ` [PATCH net-next v2 5/7] net: ipa: use device_init_wakeup() Alex Elder
2020-09-13  2:27   ` Bjorn Andersson
2020-09-12  0:45 ` [PATCH net-next v2 6/7] net: ipa: enable wakeup on IPA interrupt Alex Elder
2020-09-13  2:47   ` Bjorn Andersson
2020-09-12  0:45 ` [PATCH net-next v2 7/7] net: ipa: do not enable GSI interrupt for wakeup Alex Elder
2020-09-13  2:50   ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200912004532.1386-1-elder@linaro.org \
    --to=elder@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=cpratapa@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=evgreen@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.