Skip to content

Commit e096ca7

Browse files
plbossartkeyonjie
authored andcommitted
drivers: Intel: hda-dma: only check DGCS_BUSY with delayed stop
When an older kernel is used, we use the immediate stop. On some platforms, we see an -EBUSY error that prevents the trigger stop from working. This patch adds a check to be 'bug-compatible' with previous releases and older kernels. An additional fix would be to insert a poll timeout to make sure the BUSY bit is cleared. BugLink: #4919 Fixes: 7e54f45 ('drivers: Intel: hda-dma: ensure DMA channel is idle after stop') Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> (cherry picked from commit 9e4b18d)
1 parent c81c7bf commit e096ca7

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ static int hda_dma_release(struct dma_chan_data *channel)
646646

647647
static int hda_dma_stop_common(struct dma_chan_data *channel)
648648
{
649+
struct dai_data *dd = channel->dev_data;
649650
struct hda_chan_data *hda_chan;
650651
uint32_t flags, dgcs;
651652

@@ -669,12 +670,14 @@ static int hda_dma_stop_common(struct dma_chan_data *channel)
669670
}
670671

671672
/* check if channel is idle. No need to wait after clearing the GEN bit */
672-
dgcs = dma_chan_reg_read(channel, DGCS);
673-
if (dgcs & DGCS_GBUSY) {
674-
tr_err(&hdma_tr, "hda-dmac: %d channel %d not idle after stop",
675-
channel->dma->plat_data.id, channel->index);
676-
irq_local_enable(flags);
677-
return -EBUSY;
673+
if (dd && dd->delayed_dma_stop) {
674+
dgcs = dma_chan_reg_read(channel, DGCS);
675+
if (dgcs & DGCS_GBUSY) {
676+
tr_err(&hdma_tr, "hda-dmac: %d channel %d not idle after stop",
677+
channel->dma->plat_data.id, channel->index);
678+
irq_local_enable(flags);
679+
return -EBUSY;
680+
}
678681
}
679682
channel->status = COMP_STATE_PREPARE;
680683
hda_chan = dma_chan_get_data(channel);

0 commit comments

Comments
 (0)