usb: usb_bam: protect USB BAM connect/disconnect flow

The USB BAM driver was designed to control both the HSUSB
BAM core and the HSIC BAM core. Since of code reuse,
some of the logic is reused for both HSUSB BAM scenarios
and for HSIC BAM scenarios.

This change fixes a case in which connect/disconnect scenario
for the HSIC BAM breaks the connection state of the HSUSB BAM.

This bug is simply caused because there is no protection on
some variables that reflect the HSUSB connection state.
Fix this by protect those variables to be changed only when
connecting or disconnecting the HSUSB BAM pipes.

CRs-fixed: 499521

Change-Id: I2ad9f2eade8ede57d8597bd098c0baed50534fdc
Signed-off-by: Lena Salman <esalman@codeaurora.org>
1 file changed