summaryrefslogtreecommitdiffstats
path: root/drivers/net/ipa/ipa_uc.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-07-26 22:11:36 +0200
committerDavid S. Miller <davem@davemloft.net>2021-07-27 00:09:18 +0200
commite2f154e6b601fb25344ae244834de19881edb289 (patch)
tree10f435320328f6a5058a8612eb437cf9634efc2d /drivers/net/ipa/ipa_uc.h
parentnet: ipa: set up the microcontroller earlier (diff)
downloadlinux-e2f154e6b601fb25344ae244834de19881edb289.tar.xz
linux-e2f154e6b601fb25344ae244834de19881edb289.zip
net: ipa: introduce ipa_uc_clock()
The first time it's booted, the modem loads and starts the IPA-resident microcontroller. Once the microcontroller has completed its initialization, it notifies the AP it's "ready" by sending an INIT_COMPLETED response message. Until it receives that microcontroller message, the AP must ensure the IPA core clock remains operational. Currently, a "proxy" clock reference is taken in ipa_uc_config(), dropping it again once the message is received. However there could be a long delay between when ipa_config() completes and when modem actually starts. And because the microcontroller gets loaded by the modem, there's no need to get the modem "proxy clock" until the first time it starts. Create a new function ipa_uc_clock() which takes the "proxy" clock reference for the microcontroller. Call it when we get remoteproc SSR notification that the modem is about to start. Keep an additional flag to record whether this proxy clock reference needs to be dropped at shutdown time, and issue a warning if we get the microcontroller message either before the clock reference is taken, or after it has already been dropped. Drop the nearby use of "hh" length modifiers, which are no longer encouraged in the kernel. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_uc.h')
-rw-r--r--drivers/net/ipa/ipa_uc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ipa/ipa_uc.h b/drivers/net/ipa/ipa_uc.h
index cb0a224022f5..14e4e1115aa7 100644
--- a/drivers/net/ipa/ipa_uc.h
+++ b/drivers/net/ipa/ipa_uc.h
@@ -21,6 +21,20 @@ void ipa_uc_config(struct ipa *ipa);
void ipa_uc_deconfig(struct ipa *ipa);
/**
+ * ipa_uc_clock() - Take a proxy clock reference for the microcontroller
+ * @ipa: IPA pointer
+ *
+ * The first time the modem boots, it loads firmware for and starts the
+ * IPA-resident microcontroller. The microcontroller signals that it
+ * has completed its initialization by sending an INIT_COMPLETED response
+ * message to the AP. The AP must ensure the IPA core clock is operating
+ * until it receives this message, and to do so we take a "proxy" clock
+ * reference on its behalf here. Once we receive the INIT_COMPLETED
+ * message (in ipa_uc_response_hdlr()) we drop this clock reference.
+ */
+void ipa_uc_clock(struct ipa *ipa);
+
+/**
* ipa_uc_panic_notifier()
* @ipa: IPA pointer
*