patches: refresh c6.1 v3 (drop wake GPIO on enter_lp_mode timeout)
This commit is contained in:
+44
-7
@@ -1,4 +1,4 @@
|
||||
From 44c520fdc0c196f44d7825ef60fa7932d2a60882 Mon Sep 17 00:00:00 2001
|
||||
From c57c77e446d9a552b537175453b838d0400ff41d Mon Sep 17 00:00:00 2001
|
||||
From: Markus Fritsche <fritsche.markus@gmail.com>
|
||||
Date: Tue, 28 Apr 2026 15:05:27 +0200
|
||||
Subject: [PATCH] bes2600: gate PM indication completion on pending request and
|
||||
@@ -67,12 +67,12 @@ recovery path (timeout + spontaneous indication) gains correctness.
|
||||
|
||||
Signed-off-by: Markus Fritsche <fritsche.markus@gmail.com>
|
||||
---
|
||||
bes2600/bes_pwr.c | 66 ++++++++++++++++++++++++++++++++++++++++++-----
|
||||
bes2600/bes_pwr.h | 15 +++++++++++
|
||||
2 files changed, 74 insertions(+), 7 deletions(-)
|
||||
bes2600/bes_pwr.c | 94 ++++++++++++++++++++++++++++++++++++++++++-----
|
||||
bes2600/bes_pwr.h | 15 ++++++++
|
||||
2 files changed, 100 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/bes2600/bes_pwr.c b/bes2600/bes_pwr.c
|
||||
index 474b6f1..820449c 100644
|
||||
index 474b6f1..9b4a4de 100644
|
||||
--- a/bes2600/bes_pwr.c
|
||||
+++ b/bes2600/bes_pwr.c
|
||||
@@ -524,7 +524,17 @@ static int bes2600_pwr_enter_lp_mode(struct bes2600_common *hw_priv)
|
||||
@@ -131,7 +131,44 @@ index 474b6f1..820449c 100644
|
||||
}
|
||||
} else {
|
||||
bes_devel("skip enter lp mode\n");
|
||||
@@ -833,6 +865,7 @@ void bes2600_pwr_init(struct bes2600_common *hw_priv)
|
||||
@@ -554,10 +586,34 @@ static int bes2600_pwr_enter_lp_mode(struct bes2600_common *hw_priv)
|
||||
* in an inconsistent state that cascades into SDIO TX errors on
|
||||
* the BES2600.
|
||||
*/
|
||||
- if (timeouts == 0)
|
||||
+ if (timeouts == 0) {
|
||||
bes2600_pwr_device_enter_lp_mode(hw_priv);
|
||||
- else
|
||||
+ } else {
|
||||
+ /*
|
||||
+ * device_enter_lp_mode() was skipped (one or more VIFs
|
||||
+ * timed out waiting for the firmware indication) so its
|
||||
+ * gpio_sleep(MCU) - which drops the wake-flag bit and, if
|
||||
+ * no other subsystem holds the wake, drives the GPIO low -
|
||||
+ * never ran. Without it the bit stays asserted, and the
|
||||
+ * next bes2600_pwr_device_exit_lp_mode() calls
|
||||
+ * gpio_wake(MCU) into a "bit already set" no-op: the GPIO
|
||||
+ * never re-edges, sbus_active() exhausts its 200x2ms
|
||||
+ * MCU_WAKEUP_READY budget against an unwoken chip, and
|
||||
+ * the first TX after idle stalls for several seconds.
|
||||
+ *
|
||||
+ * Drop the MCU wake-flag bit explicitly here so the next
|
||||
+ * wake injects a real GPIO edge. gpio_allow_mcu_sleep
|
||||
+ * preserves multi-subsystem semantics: it only drives the
|
||||
+ * GPIO low when no other subsystem still holds wake; if
|
||||
+ * BT or another holder is keeping the chip awake, the
|
||||
+ * GPIO stays high and the bit clear here is purely
|
||||
+ * bookkeeping (so the next gpio_wake doesn't no-op).
|
||||
+ */
|
||||
+ if (hw_priv->sbus_ops->gpio_sleep)
|
||||
+ hw_priv->sbus_ops->gpio_sleep(hw_priv->sbus_priv,
|
||||
+ GPIO_WAKE_FLAG_MCU);
|
||||
ret = -ETIMEDOUT;
|
||||
+ }
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -833,6 +889,7 @@ void bes2600_pwr_init(struct bes2600_common *hw_priv)
|
||||
hw_priv->bes_power.power_up_task = NULL;
|
||||
mutex_init(&hw_priv->bes_power.pwr_mutex);
|
||||
atomic_set(&hw_priv->bes_power.dev_state, 0);
|
||||
@@ -139,7 +176,7 @@ index 474b6f1..820449c 100644
|
||||
init_completion(&hw_priv->bes_power.pm_enter_cmpl);
|
||||
sema_init(&hw_priv->bes_power.sync_lock, 1);
|
||||
device_set_wakeup_capable(hw_priv->pdev, true);
|
||||
@@ -1213,9 +1246,28 @@ int bes2600_pwr_clear_busy_event(struct bes2600_common *hw_priv, u32 event)
|
||||
@@ -1213,9 +1270,28 @@ int bes2600_pwr_clear_busy_event(struct bes2600_common *hw_priv, u32 event)
|
||||
|
||||
void bes2600_pwr_notify_ps_changed(struct bes2600_common *hw_priv, u8 psmode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user