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

Commit 9154d354 authored by Jeff Hugo's avatar Jeff Hugo
Browse files

soc: qcom: bam_dmux: Catch invalid remote open operations



Receiving a remote open command for a channel that is already in the remote
open state is invalid and typically signifies a significant issue in the
remote side which should be immediately caught and debugged.

Change-Id: Ic5a42d7d52da36ab0498604d0350136fd9245ab0
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 3511ae2a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -632,6 +632,16 @@ static inline void handle_bam_mux_cmd_open(struct bam_mux_hdr *rx_hdr)
		set_ul_mtu(0, false);
	}
	spin_lock_irqsave(&bam_ch[rx_hdr->ch_id].lock, flags);
	if (bam_ch_is_remote_open(rx_hdr->ch_id)) {
		/*
		 * Receiving an open command for a channel that is already open
		 * is an invalid operation and likely signifies a significant
		 * issue within the A2 which should be caught immediately
		 * before it snowballs and the root cause is lost.
		 */
		panic("A2 sent invalid duplicate open for channel %d\n",
								rx_hdr->ch_id);
	}
	bam_ch[rx_hdr->ch_id].status |= BAM_CH_REMOTE_OPEN;
	bam_ch[rx_hdr->ch_id].num_tx_pkts = 0;
	spin_unlock_irqrestore(&bam_ch[rx_hdr->ch_id].lock, flags);