kpb: block KPB prepare() if reset is not done

This patch checks if reset request has been
completed before KPB can be prepared again.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This commit is contained in:
Marcin Rajwa 2019-07-25 22:25:55 +02:00 committed by Janusz Jankowski
parent f27cd973f1
commit 7c4764cfa4
1 changed files with 7 additions and 0 deletions

View File

@ -337,6 +337,13 @@ static int kpb_prepare(struct comp_dev *dev)
trace_kpb("kpb_prepare()"); trace_kpb("kpb_prepare()");
if (kpb->state == KPB_STATE_RESETTING ||
kpb->state == KPB_STATE_RESET_FINISHING) {
trace_kpb_error("kpb_prepare() error: can not prepare KPB "
"due to ongoing reset.");
return -EBUSY;
}
ret = comp_set_state(dev, COMP_TRIGGER_PREPARE); ret = comp_set_state(dev, COMP_TRIGGER_PREPARE);
if (ret < 0) if (ret < 0)
return ret; return ret;