summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ipa/gsi.c12
-rw-r--r--drivers/net/ipa/gsi.h12
-rw-r--r--drivers/net/ipa/ipa_main.c5
3 files changed, 28 insertions, 1 deletions
diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index c555ccd778bb..a2fcdb1abdb9 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -981,6 +981,18 @@ int gsi_channel_resume(struct gsi *gsi, u32 channel_id)
return __gsi_channel_start(channel, true);
}
+/* Prevent all GSI interrupts while suspended */
+void gsi_suspend(struct gsi *gsi)
+{
+ disable_irq(gsi->irq);
+}
+
+/* Allow all GSI interrupts again when resuming */
+void gsi_resume(struct gsi *gsi)
+{
+ enable_irq(gsi->irq);
+}
+
/**
* gsi_channel_tx_queued() - Report queued TX transfers for a channel
* @channel: Channel for which to report
diff --git a/drivers/net/ipa/gsi.h b/drivers/net/ipa/gsi.h
index 97163b58b4eb..88b80dc3db79 100644
--- a/drivers/net/ipa/gsi.h
+++ b/drivers/net/ipa/gsi.h
@@ -233,6 +233,18 @@ int gsi_channel_stop(struct gsi *gsi, u32 channel_id);
void gsi_channel_reset(struct gsi *gsi, u32 channel_id, bool doorbell);
/**
+ * gsi_suspend() - Prepare the GSI subsystem for suspend
+ * @gsi: GSI pointer
+ */
+void gsi_suspend(struct gsi *gsi);
+
+/**
+ * gsi_resume() - Resume the GSI subsystem following suspend
+ * @gsi: GSI pointer
+ */
+void gsi_resume(struct gsi *gsi);
+
+/**
* gsi_channel_suspend() - Suspend a GSI channel
* @gsi: GSI pointer
* @channel_id: Channel to suspend
diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
index 2e728d4914c8..ae51109dea01 100644
--- a/drivers/net/ipa/ipa_main.c
+++ b/drivers/net/ipa/ipa_main.c
@@ -892,6 +892,7 @@ static int ipa_suspend(struct device *dev)
if (ipa->setup_complete) {
__clear_bit(IPA_FLAG_RESUMED, ipa->flags);
ipa_endpoint_suspend(ipa);
+ gsi_suspend(&ipa->gsi);
}
ipa_clock_put(ipa);
@@ -919,8 +920,10 @@ static int ipa_resume(struct device *dev)
ipa_clock_get(ipa);
/* Endpoints aren't usable until setup is complete */
- if (ipa->setup_complete)
+ if (ipa->setup_complete) {
+ gsi_resume(&ipa->gsi);
ipa_endpoint_resume(ipa);
+ }
return 0;
}