Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c8a16ba authored by Ido Shayevitz's avatar Ido Shayevitz
Browse files

usb: usb bam: release spin lock before calling sps_device_reset



Change 'b215cdcc' "usb: usb_bam: add bam global inactivity and activity
notifications" has introduced a bug in which sps_device_reset is called
while spin lock is held, fix this by releasing the spin lock before
calling the sps_device reset.

Change-Id: Idef76ca9d18c2e43333f53cea96c5d8e76a1a563
Signed-off-by: default avatarIdo Shayevitz <idos@codeaurora.org>
parent 86155e46
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -693,8 +693,11 @@ int usb_bam_connect(u8 idx, u32 *bam_pipe_idx)
	spin_lock(&usb_bam_lock);
	/* Check if BAM requires RESET before connect and reset of first pipe */
	if ((pdata->reset_on_connect[pipe_connect->bam_type] == true) &&
	    (ctx.pipes_enabled_per_bam[pipe_connect->bam_type] == 0))
	    (ctx.pipes_enabled_per_bam[pipe_connect->bam_type] == 0)) {
		spin_unlock(&usb_bam_lock);
		sps_device_reset(ctx.h_bam[pipe_connect->bam_type]);
		spin_lock(&usb_bam_lock);
	}
	spin_unlock(&usb_bam_lock);

	ret = connect_pipe(idx, bam_pipe_idx);