qcacmn: init last_desc_cleared and it should always behind tp

Initialize the last_desc_cleared pointer to -1 not 0, and
also fix the check it should always behind tp.

Change-Id: I281e066d45a99ac99d4f3c4e0bcc3f65f14bb589
CRs-Fixed: 2987029
This commit is contained in:
Vevek Venkatesan
2021-07-08 00:31:58 +05:30
zatwierdzone przez Madan Koyyalamudi
rodzic 190ff6c23e
commit 1a98ac54d7
2 zmienionych plików z 24 dodań i 2 usunięć

Wyświetl plik

@@ -1935,8 +1935,7 @@ void *hal_srng_src_get_next_consumed(void *hal_soc,
uint32_t next_entry = (srng->last_desc_cleared + srng->entry_size) %
srng->ring_size;
if (next_entry != (srng->u.src_ring.cached_tp + srng->entry_size) %
srng->ring_size) {
if (next_entry != srng->u.src_ring.cached_tp) {
desc = &srng->ring_base_vaddr[next_entry];
srng->last_desc_cleared = next_entry;
}