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

Commit 9f02702f authored by Bar Weiner's avatar Bar Weiner
Browse files

usb: bam: Update pipe_enabled_per_bam



Without this fix, pipe_enabled_per_bam is not updated
correctly when disconnecting IPA. This result in
USB Consumer resource stuck on EINPROGRESS.

Change-Id: I4262bf54a5cb7cfcabcf31083b9c8200ea0469a0
Signed-off-by: default avatarBar Weiner <bweiner@codeaurora.org>
parent 61a76028
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -933,6 +933,13 @@ static int usb_bam_disconnect_ipa_prod(
		}

		pipe_connect->enabled = false;
		spin_lock(&usb_bam_lock);
		if (ctx.pipes_enabled_per_bam[pipe_connect->bam_type] == 0)
			pr_err("%s: wrong pipes enabled counter for bam=%d\n",
				__func__, pipe_connect->bam_type);
		else
			ctx.pipes_enabled_per_bam[pipe_connect->bam_type] -= 1;
		spin_unlock(&usb_bam_lock);
	}
	info[cur_bam].prod_pipes_enabled_per_bam -= 1;

@@ -983,6 +990,13 @@ static int usb_bam_disconnect_ipa_cons(
		}

		pipe_connect->enabled = false;
		spin_lock(&usb_bam_lock);
		if (ctx.pipes_enabled_per_bam[pipe_connect->bam_type] == 0)
			pr_err("%s: wrong pipes enabled counter for bam=%d\n",
				__func__, pipe_connect->bam_type);
		else
			ctx.pipes_enabled_per_bam[pipe_connect->bam_type] -= 1;
		spin_unlock(&usb_bam_lock);
	}

	pipe_connect->ipa_clnt_hdl = -1;