Skip to content

Commit d7a6b50

Browse files
author
Marcin Maka
committed
dma: hda: Free size computation fixed
Wrong result may impact pause/release command handlers running unaligned with work queue tick. Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
1 parent e101263 commit d7a6b50

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/drivers/intel/cavs/hda-dma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ static inline uint32_t hda_dma_get_data_size(struct dma *dma, uint32_t chan)
162162
const uint32_t rp = host_dma_reg_read(dma, chan, DGBRP);
163163
const uint32_t wp = host_dma_reg_read(dma, chan, DGBWP);
164164

165-
uint32_t ds;
165+
int32_t ds;
166166

167167
if (!(cs & DGCS_BNE))
168168
return 0; /* buffer is empty */
169-
ds = wp - rp;
169+
ds = (int32_t)wp - (int32_t)rp;
170170
if (ds <= 0)
171171
ds += bs;
172172

0 commit comments

Comments
 (0)