usb: usb_bam: start usb low power mode only when otg state machine in lpm
For bam2bam scenarios, the usb bam driver starts low power mode (lpm)
after bus suspend or cable disconnect and after the handshake with
the ipa peer bam is completed.
So far, only msm otg state machine was responsible for setting the core
into lpm. The problem is that in some race conditions, for example when
disconnection of the pipes in usb bam happened sooner than the
disconnection in the msm otg state machine, the lpm was started too soon
by the usb bam, therefore caused a crash for accessing lpm HW by the
msm otg.
This change make sure that the usb bam will not start lpm unless the
msm otg state machine has been tried to do so. In that case the usb bam
will save this state as 'pending' lpm, and will start the lpm later in
case the handshake with the ipa has not finished yet.
CRs-Fixed: 509452
Change-Id: I2f2697589e2e45d91b57d31bec6aebd6d2b8110f
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
3 files changed