qcacmn: Add stats for register write failure
Sometimes the register write in windowed region are not going through, thereby retaining the previous value, which can be incorrect for a certain mode of operation for the driver. This kind of incorrect register values, due to a register write not succeeding, can lead to unwanted issues. Also the simple logging of any such occcurence can be over-written in the logs, thereby going unnoticed. Add a HAL level statistics to maintain the count of such failed register writes. Change-Id: Ib5e98705c23f0c916cb85f518576663710eb30e0 CRs-Fixed: 2611839
This commit is contained in:
@@ -94,6 +94,16 @@ hal_set_verbose_debug(bool flag)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_HAL_SOC_STATS
|
||||||
|
#define HAL_STATS_INC(_handle, _field, _delta) \
|
||||||
|
{ \
|
||||||
|
if (likely(_handle)) \
|
||||||
|
_handle->stats._field += _delta; \
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define HAL_STATS_INC(_handle, _field, _delta)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hal_reg_write_result_check() - check register writing result
|
* hal_reg_write_result_check() - check register writing result
|
||||||
* @hal_soc: HAL soc handle
|
* @hal_soc: HAL soc handle
|
||||||
@@ -117,6 +127,8 @@ static inline void hal_reg_write_result_check(struct hal_soc *hal_soc,
|
|||||||
"the expectation 0x%x, actual value 0x%x\n",
|
"the expectation 0x%x, actual value 0x%x\n",
|
||||||
exp_val,
|
exp_val,
|
||||||
value);
|
value);
|
||||||
|
HAL_STATS_INC(hal_soc, reg_write_fail, 1);
|
||||||
|
QDF_BUG(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -474,6 +474,16 @@ struct hal_hw_txrx_ops {
|
|||||||
uint8_t (*hal_rx_mpdu_start_tlv_tag_valid)(void *rx_tlv_hdr);
|
uint8_t (*hal_rx_mpdu_start_tlv_tag_valid)(void *rx_tlv_hdr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct hal_soc_stats - Hal layer stats
|
||||||
|
* @reg_write_fail: number of failed register writes
|
||||||
|
*
|
||||||
|
* This structure holds all the statistics at HAL layer.
|
||||||
|
*/
|
||||||
|
struct hal_soc_stats {
|
||||||
|
uint32_t reg_write_fail;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HAL context to be used to access SRNG APIs (currently used by data path
|
* HAL context to be used to access SRNG APIs (currently used by data path
|
||||||
* and transport (CE) modules)
|
* and transport (CE) modules)
|
||||||
@@ -523,6 +533,8 @@ struct hal_soc {
|
|||||||
|
|
||||||
/* Indicate srngs initialization */
|
/* Indicate srngs initialization */
|
||||||
bool init_phase;
|
bool init_phase;
|
||||||
|
/* Hal level stats */
|
||||||
|
struct hal_soc_stats stats;
|
||||||
};
|
};
|
||||||
|
|
||||||
void hal_qca6750_attach(struct hal_soc *hal_soc);
|
void hal_qca6750_attach(struct hal_soc *hal_soc);
|
||||||
|
Reference in New Issue
Block a user