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

Commit 9eb6c5f1 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa4: Decrement number of packet in queue only if count was not zero"

parents 251b6b48 03b7faad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1152,7 +1152,7 @@ static ssize_t ipa3_read_odlstats(struct file *file, char __user *ubuf,
			ipa3_odl_ctx->stats.odl_rx_pkt,
			ipa3_odl_ctx->stats.odl_tx_diag_pkt,
			ipa3_odl_ctx->stats.odl_drop_pkt,
			ipa3_odl_ctx->stats.numer_in_queue);
			atomic_read(&ipa3_odl_ctx->stats.numer_in_queue));

	cnt += nbytes;

+9 −6
Original line number Diff line number Diff line
@@ -215,7 +215,8 @@ static void delete_first_node(void)
			kfree(msg->buff);
			kfree(msg);
			ipa3_odl_ctx->stats.odl_drop_pkt++;
			IPA_STATS_DEC_CNT(ipa3_odl_ctx->stats.numer_in_queue);
			if (atomic_read(&ipa3_odl_ctx->stats.numer_in_queue))
				atomic_dec(&ipa3_odl_ctx->stats.numer_in_queue);
		}
	} else {
		IPADBG("List Empty\n");
@@ -244,10 +245,11 @@ int ipa3_send_adpl_msg(unsigned long skb_data)
	msg->buff = data;
	msg->len = skb->len;
	mutex_lock(&ipa3_odl_ctx->adpl_msg_lock);
	if (ipa3_odl_ctx->stats.numer_in_queue >= MAX_QUEUE_TO_ODL)
	if (atomic_read(&ipa3_odl_ctx->stats.numer_in_queue) >=
						MAX_QUEUE_TO_ODL)
		delete_first_node();
	list_add_tail(&msg->link, &ipa3_odl_ctx->adpl_msg_list);
	IPA_STATS_INC_CNT(ipa3_odl_ctx->stats.numer_in_queue);
	atomic_inc(&ipa3_odl_ctx->stats.numer_in_queue);
	mutex_unlock(&ipa3_odl_ctx->adpl_msg_lock);
	IPA_STATS_INC_CNT(ipa3_odl_ctx->stats.odl_rx_pkt);

@@ -342,7 +344,7 @@ int ipa3_odl_pipe_open(void)
	IPADBG("Setup endpoint config success\n");

	ipa3_odl_ctx->stats.odl_drop_pkt = 0;
	ipa3_odl_ctx->stats.numer_in_queue = 0;
	atomic_set(&ipa3_odl_ctx->stats.numer_in_queue, 0);
	ipa3_odl_ctx->stats.odl_rx_pkt = 0;
	ipa3_odl_ctx->stats.odl_tx_diag_pkt = 0;
	/*
@@ -422,7 +424,7 @@ void ipa3_odl_pipe_cleanup(bool is_ssr)
	 */
	ipa3_odl_ctx->odl_ctl_msg_wq_flag = true;
	ipa3_odl_ctx->stats.odl_drop_pkt = 0;
	ipa3_odl_ctx->stats.numer_in_queue = 0;
	atomic_set(&ipa3_odl_ctx->stats.numer_in_queue, 0);
	ipa3_odl_ctx->stats.odl_rx_pkt = 0;
	ipa3_odl_ctx->stats.odl_tx_diag_pkt = 0;
	IPADBG("Wake up odl ctl\n");
@@ -465,7 +467,8 @@ static ssize_t ipa_adpl_read(struct file *filp, char __user *buf, size_t count,
			msg = list_first_entry(&ipa3_odl_ctx->adpl_msg_list,
					struct ipa3_push_msg_odl, link);
			list_del(&msg->link);
			IPA_STATS_DEC_CNT(ipa3_odl_ctx->stats.numer_in_queue);
			if (atomic_read(&ipa3_odl_ctx->stats.numer_in_queue))
				atomic_dec(&ipa3_odl_ctx->stats.numer_in_queue);
		}

		mutex_unlock(&ipa3_odl_ctx->adpl_msg_lock);
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ struct ipa3_odlstats {
	u32 odl_rx_pkt;
	u32 odl_tx_diag_pkt;
	u32 odl_drop_pkt;
	u32 numer_in_queue;
	atomic_t numer_in_queue;
};

struct odl_state_bit_mask {