Skip to content

Commit

Permalink
drivers: wifi: Add a workaround for read failures
Browse files Browse the repository at this point in the history
In some scenarios like reading WDOG status, it was observed that
multiple retries are needed for the (Q)SPI read to be successful, so,
add a retry support.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 committed Sep 6, 2024
1 parent 1b99111 commit e20eae4
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions nrf_wifi/hw_if/hal/src/hal_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,35 @@ static bool hal_rpu_irq_wdog_chk(struct nrf_wifi_hal_dev_ctx *hal_dev_ctx)
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
unsigned int val = 0;
bool ret = false;
unsigned int i, max_read_retries = 10;

status = hal_rpu_reg_read(hal_dev_ctx,
&val,
RPU_REG_MIPS_MCU_UCCP_INT_STATUS);
for (i = 0; i < max_read_retries; i++) {
status = hal_rpu_reg_read(hal_dev_ctx,
&val,
RPU_REG_MIPS_MCU_UCCP_INT_STATUS);

if (status != NRF_WIFI_STATUS_SUCCESS) {
if (status != NRF_WIFI_STATUS_SUCCESS) {
nrf_wifi_osal_log_err(hal_dev_ctx->hpriv->opriv,
"%s: Reading from interrupt status register failed\n",
__func__);
goto out;
}

if (val != 0xAAAAAAAA) {
break;
} else {
nrf_wifi_osal_log_err(hal_dev_ctx->hpriv->opriv,
"%s: Reading from interrupt status register failed 0x%x \n",
__func__,
val);
}
}

if (i == max_read_retries) {
nrf_wifi_osal_log_err(hal_dev_ctx->hpriv->opriv,
"%s: Reading from interrupt status register failed",
__func__);
"%s: Reading from interrupt status register failed 0x%x \n",
__func__,
val);
goto out;
}

Expand Down

0 comments on commit e20eae4

Please sign in to comment.