qcacmn: Fix calculation of getting head/tail pointer

The current calculation of head/tail pointer for
srng gives an index in the array by skipping
entry_size dwords.
The head/tail pointers are preffered to be the
index values like in the srng registers, which
brings them in alignment with the other usage of
head/tail pointers.

Fix the calculation of head/tail pointers for srng
by avoiding the division by srng entry size.

CRs-Fixed: 2469332
Change-Id: If9a167f3fac3cb39ebe59618e9ad2224d9e54bcc
This commit is contained in:
Rakesh Pillai
2019-06-05 00:25:48 +05:30
committed by nshrivas
parent 7c72252ec8
commit 56320c1e4d
2 changed files with 8 additions and 12 deletions

View File

@@ -1530,15 +1530,11 @@ void hal_get_hw_hptp_generic(struct hal_soc *soc, void *hal_ring,
ring_config = HAL_SRNG_CONFIG(soc, ring_type);
if (!ring_config->lmac_ring) {
if (srng->ring_dir == HAL_SRNG_SRC_RING) {
*headp =
(SRNG_SRC_REG_READ(srng, HP)) / srng->entry_size;
*tailp =
(SRNG_SRC_REG_READ(srng, TP)) / srng->entry_size;
*headp = SRNG_SRC_REG_READ(srng, HP);
*tailp = SRNG_SRC_REG_READ(srng, TP);
} else {
*headp =
(SRNG_DST_REG_READ(srng, HP)) / srng->entry_size;
*tailp =
(SRNG_DST_REG_READ(srng, TP)) / srng->entry_size;
*headp = SRNG_DST_REG_READ(srng, HP);
*tailp = SRNG_DST_REG_READ(srng, TP);
}
}
}