usb: gadget: mbim: Fix BUG in spin_lock usage in mbim_read

mbim_read (thread context) and fmbim_cmd_complete (interrupt
context) share some data structures that are currently
protected using spin_lock API. This is a BUG as this spin_lock
doesn't disable local interrupts, hence, there is still a
possibility that IRQ may be fired after acquiring spin_lock.
On SMP this may result in deadlock if spin_lock is acquired
again from ISR, but on uniprocessor this more or less in this
usecase becomes NO-OP.

Change-Id: I204b3a9d825bb45787bb42017fa7f5e7b84bcfe9
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Merge "usb: gadget: mbim: Fix BUG in spin_lock usage in mbim_read"
usb_bam: wait for UL USB producer pipe to be empty on disconnect

If peer BAM tries to reset its BAM with some pending data
in USB producer BAM then it may cause BAM ERROR_IRQ. Hence, wait
for FIFO to be drained by consumer BAM before disconnecting PIPE.
10msec timeout has been added while waiting which can happen if
peer BAM is stuck and not responding.

CRs-fixed: 702372
Change-Id: I1e67c3674def1d7451ee37a864bdf605d485df04
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Merge "usb_bam: wait for UL USB producer pipe to be empty on disconnect"