diff --git a/src/drivers/intel/hda/hda-dma.c b/src/drivers/intel/hda/hda-dma.c index 7edb93279..8aa6461f7 100644 --- a/src/drivers/intel/hda/hda-dma.c +++ b/src/drivers/intel/hda/hda-dma.c @@ -818,12 +818,20 @@ static int hda_dma_set_config(struct dma_chan_data *channel, /* buffer size must be multiple of hda dma burst size */ if (buffer_bytes % HDA_DMA_BUFFER_ALIGNMENT) { - tr_err(&hdma_tr, "hda-dmac: %d chan %d - buffer not DMA aligned 0x%x", + tr_err(&hdma_tr, "hda-dmac: %d chan %d - buffer size not DMA aligned 0x%x", dma->plat_data.id, channel->index, buffer_bytes); ret = -EINVAL; goto out; } + /* buffer base address must be correctly aligned */ + if (buffer_addr % HDA_DMA_BUFFER_ADDRESS_ALIGNMENT) { + tr_err(&hdma_tr, "hda-dmac: %d chan %d - buffer address not DMA aligned 0x%x", + dma->plat_data.id, + channel->index, buffer_addr); + ret = -EINVAL; + goto out; + } hda_chan = dma_chan_get_data(channel); hda_chan->period_bytes = period_bytes; hda_chan->buffer_bytes = buffer_bytes;