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

Commit 68b94771 authored by Weiyi Chen's avatar Weiyi Chen Committed by jabashque
Browse files

dfc: not caching grant for removed bearers



If a grant indication for a bearer has "removed" flag set, caching
the bearer could lead to data stall for the next data call because
modem will not send grant for this bearer during powersave.

Do not cache grant for the removed or disabled bearers. Also make sure
a bearer is flow enabled when it is associated with a tx queue.

Change-Id: I7eca597e3cc7d5a0bfe523201c454fb45e66a3a0
Signed-off-by: default avatarWeiyi Chen <quic_weiyic@quicinc.com>
parent 09c7a587
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <net/pkt_sched.h>
@@ -989,7 +990,9 @@ static int dfc_update_fc_map(struct net_device *dev, struct qos_info *qos,
	u32 adjusted_grant;

	itm = qmi_rmnet_get_bearer_map(qos, fc_info->bearer_id);
	if (!itm)

	/* cache the bearer assuming it is a new bearer */
	if (unlikely(!itm && !is_query && fc_info->num_bytes))
		itm = qmi_rmnet_get_bearer_noref(qos, fc_info->bearer_id);

	if (itm) {
+8 −4
Original line number Diff line number Diff line
@@ -387,12 +387,16 @@ static void __qmi_rmnet_update_mq(struct net_device *dev,
				bearer->mq_idx = itm->mq_idx;
		}

		qmi_rmnet_flow_control(dev, itm->mq_idx,
				       bearer->grant_size > 0 ? 1 : 0);
		/* Always enable flow for the newly associated bearer */
		if (!bearer->grant_size) {
			bearer->grant_size = DEFAULT_GRANT;
			bearer->grant_thresh =
				qmi_rmnet_grant_per(DEFAULT_GRANT);
		}
		qmi_rmnet_flow_control(dev, itm->mq_idx, 1);

		if (dfc_mode == DFC_MODE_SA)
			qmi_rmnet_flow_control(dev, bearer->ack_mq_idx,
					bearer->grant_size > 0 ? 1 : 0);
			qmi_rmnet_flow_control(dev, bearer->ack_mq_idx, 1);
	}
}