summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Christophe Pince <jean.christophe.pince@qorvo.com>2023-07-31 14:58:56 +0200
committerVictor Liu <victorliu@google.com>2023-08-01 22:03:48 +0000
commitf1ea8481c2ae57930777910e5b8deb9f46d01c18 (patch)
tree5d0290fd93d1f6f61887726e99c885ad34632f0e
parent452a0abf753d37752a8e0d9e8450ed629a18f704 (diff)
downloaduwb-android-gs-shusky-5.15-android14-d1.tar.gz
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.c5
-rw-r--r--hsspi.h1
-rw-r--r--qm35-spi.c4
-rw-r--r--qm35.h2
4 files changed, 11 insertions, 1 deletions
diff --git a/hsspi.c b/hsspi.c
index 3e361c3..1170ca1 100644
--- a/hsspi.c
+++ b/hsspi.c
@@ -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;
}
diff --git a/hsspi.h b/hsspi.h
index 9a2e65a..c57c849 100644
--- a/hsspi.h
+++ b/hsspi.h
@@ -174,6 +174,7 @@ struct hsspi {
struct gpio_desc *gpio_exton;
volatile bool xfer_ongoing;
+ volatile bool waiting_ss_rdy;
};
/**
diff --git a/qm35-spi.c b/qm35-spi.c
index 7a7960e..00bd360 100644
--- a/qm35-spi.c
+++ b/qm35-spi.c
@@ -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;
}
diff --git a/qm35.h b/qm35.h
index ea087fe..abbf505 100644
--- a/qm35.h
+++ b/qm35.h
@@ -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;