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

Commit dc9f6c35 authored by Arun Kumar Neelakantam's avatar Arun Kumar Neelakantam Committed by Jeff Hugo
Browse files

soc: qcom: bam_dmux: Add BAM DMUX no-cpu-affinity



BAM DMUX workqueue is bound to CPU0 to support the network stack
requirements to avoid the out of order packet issue.

In MSM8939 CPU0 is power CPU and bounding workqueue to CPU0 is causing
more power leak in system. Remove the CPU affinity to let the scheduler
to decide the CPU for BAM DMUX work queue to save the power and enable
the RPS feature in network stack to support out of order packet issue.

CRs-Fixed: 707518
Change-Id: Idc8ad06f75acc6da47d67c5381931ba83895386a
Signed-off-by: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 3bc1fc8b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ Optional properties:
-qcom,rx-ring-size: the size of the receive ring buffer pool, default is 32
-qcom,max-rx-mtu: the maximum receive MTU that can be negotiated, in bytes.
	Default is 2048.  Other possible values are 4096, 8192, and 16384.
-qcom,no-cpu-affinity: boolean value indicating that workqueue CPU affinity
	is not required.

Example:

@@ -20,4 +22,5 @@ Example:
		qcom,satellite-mode;
		qcom,rx-ring-size = <64>;
		qcom,max-rx-mtu = <8192>;
		qcom,no-cpu-affinity;
	};
+17 −5
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@ static bool dynamic_mtu_enabled;
static uint16_t ul_mtu = DEFAULT_BUFFER_SIZE;
static uint16_t dl_mtu = DEFAULT_BUFFER_SIZE;
static uint16_t buffer_size = DEFAULT_BUFFER_SIZE;
static bool no_cpu_affinity;

static struct bam_ch_info bam_ch[BAM_DMUX_NUM_CHANNELS];
static int bam_mux_initialized;
@@ -1308,6 +1309,9 @@ static void rx_switch_to_interrupt_mode(void)

fail:
	pr_err("%s: reverting to polling\n", __func__);
	if (no_cpu_affinity)
		queue_work(bam_mux_rx_workqueue, &rx_timer_work);
	else
		queue_work_on(0, bam_mux_rx_workqueue, &rx_timer_work);
}

@@ -1504,9 +1508,14 @@ static void bam_mux_rx_notify(struct sps_event_notify *notify)
			polling_mode = 1;
			/*
			 * run on core 0 so that netif_rx() in rmnet uses only
			 * one queue
			 * one queue if RPS enable use no_cpu_affinity
			 */
			queue_work_on(0, bam_mux_rx_workqueue, &rx_timer_work);
			if (no_cpu_affinity)
				queue_work(bam_mux_rx_workqueue,
							&rx_timer_work);
			else
				queue_work_on(0, bam_mux_rx_workqueue,
							&rx_timer_work);
		}
		break;
	default:
@@ -2629,15 +2638,18 @@ static int bam_dmux_probe(struct platform_device *pdev)

		set_dl_mtu(requested_dl_mtu);

		no_cpu_affinity = of_property_read_bool(pdev->dev.of_node,
						"qcom,no-cpu-affinity");
		BAM_DMUX_LOG(
			"%s: base:%p size:%x irq:%d satellite:%d num_buffs:%d dl_mtu:%x\n",
			"%s: base:%p size:%x irq:%d satellite:%d num_buffs:%d dl_mtu:%x cpu-affinity:%d\n",
						__func__,
						(void *)(uintptr_t)a2_phys_base,
						a2_phys_size,
						a2_bam_irq,
						satellite_mode,
						num_buffers,
						dl_mtu);
						dl_mtu,
						no_cpu_affinity);
	} else { /* fallback to default init data */
		a2_phys_base = A2_PHYS_BASE;
		a2_phys_size = A2_PHYS_SIZE;