qcacmn: Fix ce ring timeout interrupt hw work arround

Interrupt was constantly firing because the low_threshold was
improperly configured.  The low threshold needs to be 1 less than
the number of buffers posted when the CE is fully posted.  The
srng backed CE's are setup with nentries - 2 buffers as the fully
posted amount, therefore the threshold needs to be nentries - 3.

Also fixes a bug where a reused variable is not cleared.  This
bug could result in the threshold being set to a garbages value.

Change-Id: Iac840bfd6677683bf2feb42d8bdbd050f42e895d
CRs-Fixed: 2090603
This commit is contained in:
Houston Hoffman
2017-08-07 14:26:35 -07:00
committed by snandini
parent 1fecd15636
commit 9b55b5fbb9
2 changed files with 32 additions and 5 deletions

View File

@@ -882,6 +882,7 @@ static inline void hal_srng_src_hw_init(struct hal_soc *hal,
}
SRNG_SRC_REG_WRITE(srng, CONSUMER_INT_SETUP_IX0, reg_val);
reg_val = 0;
if (srng->flags & HAL_SRNG_LOW_THRES_INTR_ENABLE) {
reg_val |= SRNG_SM(SRNG_SRC_FLD(CONSUMER_INT_SETUP_IX1,
LOW_THRESHOLD), srng->u.src_ring.low_threshold);