diff options
author | Jean-Christophe Pince <jean.christophe.pince@qorvo.com> | 2023-07-31 14:58:56 +0200 |
---|---|---|
committer | Victor Liu <victorliu@google.com> | 2023-08-01 22:03:48 +0000 |
commit | f1ea8481c2ae57930777910e5b8deb9f46d01c18 (patch) | |
tree | 5d0290fd93d1f6f61887726e99c885ad34632f0e | |
parent | 452a0abf753d37752a8e0d9e8450ed629a18f704 (diff) | |
download | uwb-android-gs-shusky-5.15-android14-d1.tar.gz |
Fix hsspi retention sleep race conditionandroid-14.0.0_r0.8main-16k-gs-shusky-5.15android-gs-shusky-5.15-android14-d1
When the QM goes to retention sleep and the host wants to send
a HSSPI message, there is a wait condition that will lead the host
to wait SS_READY_TIMEOUT_MS before actually sending the message.
This leads to extra timeouts on the host side.
Bug: 291788159
Change-Id: Iad9f01a1758d5b5661f170ce456fbc73ae9a235c
Signed-off-by: Jean-Christophe Pince <jean.christophe.pince@qorvo.com>
-rw-r--r-- | hsspi.c | 5 | ||||
-rw-r--r-- | hsspi.h | 1 | ||||
-rw-r--r-- | qm35-spi.c | 4 | ||||
-rw-r--r-- | qm35.h | 2 |
4 files changed, 11 insertions, 1 deletions
@@ -139,6 +139,8 @@ static int hsspi_wait_ss_ready(struct hsspi *hsspi) { int ret; + hsspi->waiting_ss_rdy = true; + if (!test_bit(HSSPI_FLAGS_SS_BUSY, hsspi->flags)) { /* The ss_ready went low, so the fw is not busy anymore, * if the ss_ready is high, we can proceed, else, @@ -178,6 +180,8 @@ static int hsspi_wait_ss_ready(struct hsspi *hsspi) */ if (!gpiod_get_value(hsspi->gpio_ss_rdy)) return -EAGAIN; + + hsspi->waiting_ss_rdy = false; return 0; } @@ -266,6 +270,7 @@ static int spi_xfer(struct hsspi *hsspi, const void *tx, void *rx, hsspi->soc->flags); } + hsspi->waiting_ss_rdy = false; return ret; } @@ -174,6 +174,7 @@ struct hsspi { struct gpio_desc *gpio_exton; volatile bool xfer_ongoing; + volatile bool waiting_ss_rdy; }; /** @@ -392,6 +392,10 @@ static irqreturn_t qm35_exton_handler(int irq, void *data) struct qm35_ctx *qm35_hdl = data; hsspi_clear_spi_slave_ready(&qm35_hdl->hsspi); + + if (qm35_hdl->hsspi.waiting_ss_rdy) + qm35_wakeup(&qm35_hdl->hsspi); + return IRQ_HANDLED; } @@ -24,7 +24,7 @@ #define QM_BOOT_MS 450 #define QM_BEFORE_RESET_MS 450 -#define DRV_VERSION "6.3.1-rc2" +#define DRV_VERSION "6.3.2-rc1" struct regulator; |