summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil DI FOLCO <neil.difolco@qorvo.com>2023-02-10 15:29:10 +0100
committerNeil DI FOLCO <neil.difolco@qorvo.com>2023-02-10 18:04:51 +0100
commit1c5cd5b984fa3e2ff42faf75823d7544b9ac88a3 (patch)
tree8fa680e3c54be6843de242caa7f845245bd0f846
parent59662009ebec4d82043603ded082bcf13036cbe1 (diff)
downloaduwb-1c5cd5b984fa3e2ff42faf75823d7544b9ac88a3.tar.gz
qm35: do not release wakeup during SPI transfer
Bug: 268591347 Change-Id: I2b0575cec98995de2ed7a1470096206bb2697b97 Signed-off-by: Neil DI FOLCO <neil.difolco@qorvo.com>
-rw-r--r--hsspi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/hsspi.c b/hsspi.c
index ad0d6ea..3c5ce15 100644
--- a/hsspi.c
+++ b/hsspi.c
@@ -219,11 +219,10 @@ static int spi_xfer(struct hsspi *hsspi, const void *tx, void *rx,
hsspi->soc->ul = 0;
hsspi->soc->length = 0;
+ hsspi->wakeup_enter(hsspi);
do {
- hsspi->wakeup_enter(hsspi);
ret = hsspi_wait_ss_ready(hsspi);
if (ret < 0) {
- hsspi->wakeup_release(hsspi);
continue;
}
@@ -238,7 +237,6 @@ static int spi_xfer(struct hsspi *hsspi, const void *tx, void *rx,
HSSPI_MANUAL_CS_SETUP_US);
#endif
ret = spi_sync_transfer(hsspi->spi, xfers, length ? 2 : 1);
- hsspi->wakeup_release(hsspi);
trace_hsspi_spi_xfer(&hsspi->spi->dev, hsspi->host, hsspi->soc,
ret);
@@ -251,9 +249,6 @@ static int spi_xfer(struct hsspi *hsspi, const void *tx, void *rx,
if (!(hsspi->soc->flags & STC_SOC_RDY) ||
(hsspi->soc->flags == 0xff)) {
- dev_err(&hsspi->spi->dev,
- "FW not ready (flags %#02x)\n",
- hsspi->soc->flags);
ret = -EAGAIN;
continue;
}
@@ -262,6 +257,13 @@ static int spi_xfer(struct hsspi *hsspi, const void *tx, void *rx,
break;
} while ((ret == -EAGAIN) && (--retry > 0));
+ hsspi->wakeup_release(hsspi);
+
+ if (!(hsspi->soc->flags & STC_SOC_RDY) || (hsspi->soc->flags == 0xff)) {
+ dev_err(&hsspi->spi->dev, "FW not ready (flags %#02x)\n",
+ hsspi->soc->flags);
+ }
+
return ret;
}