All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wilc1000: changes for SPI communication stall issue found with Iperf
@ 2020-12-08 10:38 Ajay.Kathat
  2020-12-10 18:48 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Ajay.Kathat @ 2020-12-08 10:38 UTC (permalink / raw)
  To: linux-wireless, kvalo; +Cc: Claudiu.Beznea, Sripad.Balwadgi, Ajay.Kathat

From: Ajay Singh <ajay.kathat@microchip.com>

Added retry mechanism to ensure VMM enable bit is set during the
block transfer of data between host and WILC FW.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/net/wireless/microchip/wilc1000/spi.c | 23 +++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c
index a18dac0aa6b6..be732929322c 100644
--- a/drivers/net/wireless/microchip/wilc1000/spi.c
+++ b/drivers/net/wireless/microchip/wilc1000/spi.c
@@ -35,6 +35,7 @@ static const struct wilc_hif_func wilc_hif_spi;
 #define CMD_SINGLE_READ				0xca
 #define CMD_RESET				0xcf
 
+#define SPI_ENABLE_VMM_RETRY_LIMIT		2
 #define DATA_PKT_SZ_256				256
 #define DATA_PKT_SZ_512				512
 #define DATA_PKT_SZ_1K				1024
@@ -856,8 +857,26 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
 
 static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
 {
-	return spi_internal_write(wilc, WILC_SPI_INT_CLEAR - WILC_SPI_REG_BASE,
-				  val);
+	int ret;
+	int retry = SPI_ENABLE_VMM_RETRY_LIMIT;
+	u32 check;
+
+	while (retry) {
+		ret = spi_internal_write(wilc,
+					 WILC_SPI_INT_CLEAR - WILC_SPI_REG_BASE,
+					 val);
+		if (ret)
+			break;
+
+		ret = spi_internal_read(wilc,
+					WILC_SPI_INT_CLEAR - WILC_SPI_REG_BASE,
+					&check);
+		if (ret || ((check & EN_VMM) == (val & EN_VMM)))
+			break;
+
+		retry--;
+	}
+	return ret;
 }
 
 static int wilc_spi_sync_ext(struct wilc *wilc, int nint)
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wilc1000: changes for SPI communication stall issue found with Iperf
  2020-12-08 10:38 [PATCH] wilc1000: changes for SPI communication stall issue found with Iperf Ajay.Kathat
@ 2020-12-10 18:48 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-12-10 18:48 UTC (permalink / raw)
  To: Ajay.Kathat; +Cc: linux-wireless, Claudiu.Beznea, Sripad.Balwadgi, Ajay.Kathat

<Ajay.Kathat@microchip.com> wrote:

> From: Ajay Singh <ajay.kathat@microchip.com>
> 
> Added retry mechanism to ensure VMM enable bit is set during the
> block transfer of data between host and WILC FW.
> 
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>

Patch applied to wireless-drivers-next.git, thanks.

382726d134e3 wilc1000: changes for SPI communication stall issue found with Iperf

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201208103739.28597-1-ajay.kathat@microchip.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-10 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 10:38 [PATCH] wilc1000: changes for SPI communication stall issue found with Iperf Ajay.Kathat
2020-12-10 18:48 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.