qcacmn: Flush srng tp and hp only for flush event

Currently after runtime resume all SW2TCL data and reo cmd
srng rings hp and tp value are flushed. In case of IPA
offload case SW2TCL3 righ hp value will be updated by IPA
and not by host. In case of runtime pm enable host is
setting the value to zero as part of runtime resume which
results in incorrect hp value of SW2TCL3. As part of this
change set flush event for rings which are accessed by host
during link down state and after runtime resume flush the
rings for which flush event is set.

Change-Id: I5c9afa708277cf3a6e6d5ef99447bc21f88cfdcf
CRs-Fixed: 2514621
This commit is contained in:
Sravan Kumar Kairam
2019-09-16 14:22:55 +05:30
committed by nshrivas
parent 816b503c44
commit 78b01a1e1b
6 changed files with 93 additions and 4 deletions

View File

@@ -21,6 +21,7 @@
#include "qdf_types.h"
#include "qdf_util.h"
#include "qdf_atomic.h"
#include "hal_internal.h"
#define MAX_UNWINDOWED_ADDRESS 0x80000
#ifdef QCA_WIFI_QCA6390
@@ -1582,4 +1583,74 @@ hal_ring_desc_t hal_rxdma_desc_to_hal_ring_desc(hal_rxdma_desc_t ring_desc)
{
return (hal_ring_desc_t)ring_desc;
}
/**
* hal_srng_set_event() - Set hal_srng event
* @hal_ring_hdl: Source ring pointer
* @event: SRNG ring event
*
* Return: None
*/
static inline void hal_srng_set_event(hal_ring_handle_t hal_ring_hdl, int event)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
qdf_atomic_set_bit(event, &srng->srng_event);
}
/**
* hal_srng_clear_event() - Clear hal_srng event
* @hal_ring_hdl: Source ring pointer
* @event: SRNG ring event
*
* Return: None
*/
static inline
void hal_srng_clear_event(hal_ring_handle_t hal_ring_hdl, int event)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
qdf_atomic_clear_bit(event, &srng->srng_event);
}
/**
* hal_srng_get_clear_event() - Clear srng event and return old value
* @hal_ring_hdl: Source ring pointer
* @event: SRNG ring event
*
* Return: Return old event value
*/
static inline
int hal_srng_get_clear_event(hal_ring_handle_t hal_ring_hdl, int event)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
return qdf_atomic_test_and_clear_bit(event, &srng->srng_event);
}
/**
* hal_srng_set_flush_last_ts() - Record last flush time stamp
* @hal_ring_hdl: Source ring pointer
*
* Return: None
*/
static inline void hal_srng_set_flush_last_ts(hal_ring_handle_t hal_ring_hdl)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
srng->last_flush_ts = qdf_get_log_timestamp();
}
/**
* hal_srng_inc_flush_cnt() - Increment flush counter
* @hal_ring_hdl: Source ring pointer
*
* Return: None
*/
static inline void hal_srng_inc_flush_cnt(hal_ring_handle_t hal_ring_hdl)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
srng->flush_count++;
}
#endif /* _HAL_APIH_ */