Skip to content

hw_if: hal: Add watchdog interrupt stats #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hw_if/hal/inc/hal_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ struct nrf_wifi_hal_dev_ctx {
unsigned long last_wakeup_now_deasserted_time_ms;
/** RPU sleep opp time */
unsigned long last_rpu_sleep_opp_time_ms;
/** Number of watchdog timer interrupts received */
int wdt_irq_received;
/** Number of watchdog timer interrupts ignored */
int wdt_irq_ignored;
#endif /* NRF_WIFI_RPU_RECOVERY */
#if defined(NRF_WIFI_LOW_POWER) || defined(__DOXYGEN__)
/** RPU power state */
Expand Down
4 changes: 4 additions & 0 deletions hw_if/hal/src/hal_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ static enum nrf_wifi_status hal_rpu_process_wdog(struct nrf_wifi_hal_dev_ctx *ha
* PS_ACTIVE state for more than the timeout period
*/
if (!is_rpu_recovery_needed(hal_dev_ctx)) {
hal_dev_ctx->wdt_irq_ignored++;
#ifdef NRF_WIFI_RPU_RECOVERY_DEBUG
nrf_wifi_osal_log_info("Ignore watchdog interrupt, RPU recovery not needed");
#else
Expand Down Expand Up @@ -577,6 +578,9 @@ enum nrf_wifi_status hal_rpu_irq_process(struct nrf_wifi_hal_dev_ctx *hal_dev_ct
num_events = hal_rpu_event_get_all(hal_dev_ctx);

if (hal_rpu_irq_wdog_chk(hal_dev_ctx)) {
#ifdef NRF_WIFI_RPU_RECOVERY
hal_dev_ctx->wdt_irq_received++;
#endif /* NRF_WIFI_RPU_RECOVERY */
nrf_wifi_osal_log_dbg("Received watchdog interrupt");

status = hal_rpu_process_wdog(hal_dev_ctx, do_rpu_recovery);
Expand Down