usb_bam: Move check for pipe_enabled_per_bam from consumer disconnect
Current code assume that USB IPA BAM2BAM functionality would be used
in pair i.e having producer and consumer. For feature like DPL which
doesn't have bidirectional communication need with IPA, it would have
only USB BAM as consumer with IPA. Upon disconnection, the
pipes_enabled_per_bam counter is used as a reference counter, and IPA
resources will get cleaned up when it gets decremented to zero.
However, the check to do so happens in usb_bam_disconnect_ipa_cons()
which does not get called if an IPA consumer/USB producer pipe does
not exist for a function, and thus the check is bypassed. Hence move
this check to the end of usb_bam_disconnect_ipa() to ensure this
counter has been decremented the correct number of times before
checking it.
Change-Id: Iea2c2af7566ee790c7929e13505819cdf74b22ab
Signed-off-by:
Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment