Skip to content

Commit

Permalink
dmic: fix pause/release error leading to invalid dmic_active_fifos
Browse files Browse the repository at this point in the history
The 'in_active' parameter of dmic_stop() is used to control whether
the fifo should be released or not. In case of COMP_TRIGGER_PAUSE,
this should be false and the 'dmic_active_fifos' count should not
be modified.

Without this fix:

  PAUSED -> RELEASE -> dmic_start() -> no change on dmic_active_fifos

  ACTIVE -> PAUSE   -> dmic_stop()  -> dmic_active_fifos--

If a test case repeatedly pauses and releases, 'dmic_active_fifos'
will go out-of-sync.

Fix the issue that dmic_stop for PAUSE does not release the fifo
reference.

Fixes: 2273174 ("dmic: don't decrement active FIFO count below 0")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
  • Loading branch information
kv2019i authored and keyonjie committed Aug 9, 2021
1 parent a8dfbc5 commit f3ca63c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/drivers/intel/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ static int dmic_trigger(struct dai *dai, int cmd, int direction)
break;
case COMP_TRIGGER_PAUSE:
dmic->state = COMP_STATE_PAUSED;
dmic_stop(dai, true);
dmic_stop(dai, false);
break;
case COMP_TRIGGER_RESUME:
dmic_context_restore(dai);
Expand Down

0 comments on commit f3ca63c

Please sign in to comment.