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

Commit 9d75b51a authored by Park Ju Hyung's avatar Park Ju Hyung Committed by Michael Bestas
Browse files

qcacld-3.0: Nuke rx_wakelock code entirely.

qcom_rx_wakelock is one of the major culprit to increased power consumption.

Although its total wakelock time is quite low, it's catched very frequently
and prevents the system from entering suspend repeatedly.

Original intention of this wakelock is to prevent dropping unicast or
local ARP packet, but I'm having a hard time understanding why are those
packets critical to regular Android users.

qcacld's packet filter will still allow notifications to flow in.

Stop allowing this to be configurable on this kernel.
Nuke this entirely to reduce resource usage.

Change-Id: I8ae655b871e58dc1c9a880c831cc6a5e2d118594
parent 826a5758
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -1101,30 +1101,6 @@
	CFG_INI_BOOL("enable_multicast_replay_filter", \
	true, "Enable filtering of replayed multicast packets")

/*
 * <ini>
 * rx_wakelock_timeout - Amount of time to hold wakelock for RX unicast packets
 * @Min: 0
 * @Max: 100
 * @Default: 50
 *
 * This ini item configures the amount of time, in milliseconds, that the driver
 * should prevent system power collapse after receiving an RX unicast packet.
 * A conigured value of 0 disables the RX Wakelock feature completely.
 *
 * Related: None.
 *
 * Supported Feature: RX Wakelock
 *
 * Usage: Internal/External
 *
 * </ini>
 */
#define CFG_DP_RX_WAKELOCK_TIMEOUT \
	CFG_INI_UINT("rx_wakelock_timeout", \
	0, 100, 50, CFG_VALUE_OR_DEFAULT, \
	"Amount of time to hold wakelock for RX unicast packets")

/*
 * <ini>
 * num_dp_rx_threads - Control to set the number of dp rx threads
@@ -1442,7 +1418,6 @@
	CFG(CFG_DP_CE_SERVICE_MAX_YIELD_TIME) \
	CFG(CFG_DP_ENABLE_TCP_PARAM_UPDATE) \
	CFG(CFG_DP_FILTER_MULTICAST_REPLAY) \
	CFG(CFG_DP_RX_WAKELOCK_TIMEOUT) \
	CFG(CFG_DP_NUM_DP_RX_THREADS) \
	CFG(CFG_DP_HTC_WMI_CREDIT_CNT) \
	CFG_DP_ENABLE_FASTPATH_ALL \
+0 −1
Original line number Diff line number Diff line
@@ -199,7 +199,6 @@ struct hdd_config {
	uint32_t rx_thread_affinity_mask;
	uint8_t cpu_map_list[CFG_DP_RPS_RX_QUEUE_CPU_MAP_LIST_LEN];
	bool multicast_replay_filter;
	uint32_t rx_wakelock_timeout;
	uint8_t num_dp_rx_threads;
#ifdef CONFIG_DP_TRACE
	bool enable_dp_trace;
+0 −1
Original line number Diff line number Diff line
@@ -1877,7 +1877,6 @@ struct hdd_context {
	/** P2P Device MAC Address for the adapter  */
	struct qdf_mac_addr p2p_device_address;

	qdf_wake_lock_t rx_wake_lock;
	qdf_wake_lock_t sap_wake_lock;

	/* Flag keeps track of wiphy suspend/resume */
+0 −31
Original line number Diff line number Diff line
@@ -8734,32 +8734,6 @@ static int hdd_init_netlink_services(struct hdd_context *hdd_ctx)
	return ret;
}

/**
 * hdd_rx_wake_lock_destroy() - Destroy RX wakelock
 * @hdd_ctx:	HDD context.
 *
 * Destroy RX wakelock.
 *
 * Return: None.
 */
static void hdd_rx_wake_lock_destroy(struct hdd_context *hdd_ctx)
{
	qdf_wake_lock_destroy(&hdd_ctx->rx_wake_lock);
}

/**
 * hdd_rx_wake_lock_create() - Create RX wakelock
 * @hdd_ctx:	HDD context.
 *
 * Create RX wakelock.
 *
 * Return: None.
 */
static void hdd_rx_wake_lock_create(struct hdd_context *hdd_ctx)
{
	qdf_wake_lock_create(&hdd_ctx->rx_wake_lock, "qcom_rx_wakelock");
}

/**
 * hdd_context_deinit() - Deinitialize HDD context
 * @hdd_ctx:    HDD context.
@@ -8778,8 +8752,6 @@ static int hdd_context_deinit(struct hdd_context *hdd_ctx)

	hdd_sap_context_destroy(hdd_ctx);

	hdd_rx_wake_lock_destroy(hdd_ctx);

	hdd_scan_context_destroy(hdd_ctx);

	qdf_list_destroy(&hdd_ctx->hdd_adapters);
@@ -11387,8 +11359,6 @@ static int hdd_context_init(struct hdd_context *hdd_ctx)
	if (ret)
		goto list_destroy;

	hdd_rx_wake_lock_create(hdd_ctx);

	ret = hdd_sap_context_init(hdd_ctx);
	if (ret)
		goto scan_destroy;
@@ -11412,7 +11382,6 @@ static int hdd_context_init(struct hdd_context *hdd_ctx)

scan_destroy:
	hdd_scan_context_destroy(hdd_ctx);
	hdd_rx_wake_lock_destroy(hdd_ctx);
list_destroy:
	qdf_list_destroy(&hdd_ctx->hdd_adapters);

+0 −13
Original line number Diff line number Diff line
@@ -1125,19 +1125,6 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *adapter_context, qdf_nbuf_t rx_buf)

		skb->protocol = eth_type_trans(skb, skb->dev);

		/* hold configurable wakelock for unicast traffic */
		if (!hdd_is_current_high_throughput(hdd_ctx) &&
		    hdd_ctx->config->rx_wakelock_timeout &&
		    skb->pkt_type != PACKET_BROADCAST &&
		    skb->pkt_type != PACKET_MULTICAST) {
			cds_host_diag_log_work(&hdd_ctx->rx_wake_lock,
						   hdd_ctx->config->rx_wakelock_timeout,
						   WIFI_POWER_EVENT_WAKELOCK_HOLD_RX);
			qdf_wake_lock_timeout_acquire(&hdd_ctx->rx_wake_lock,
							  hdd_ctx->config->
								  rx_wakelock_timeout);
		}

		/* Remove SKB from internal tracking table before submitting
		 * it to stack
		 */
Loading