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

Commit b275af98 authored by Vamsi Krishna's avatar Vamsi Krishna
Browse files

usb: gadget: u_ether: Add module param to config cpu boost freq



commit:05112982 "usb: gadget: u_ether: add scatter/gather support"
hard codes boost the cpus to 1Ghz. This will not work for all
plaforms as they may not support this frequency. Add module param
to let different platoforms configure cpu boost frequency when usb
ethernet interface is active.

Change-Id: Ieb7e8016f201637bc050752738c35aba86b45228
Signed-off-by: default avatarVamsi Krishna <vskrishn@codeaurora.org>
parent d7be6a71
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -66,6 +66,11 @@ module_param(tx_stop_threshold, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(tx_stop_threshold,
MODULE_PARM_DESC(tx_stop_threshold,
	"Threashold to stop network queue");
	"Threashold to stop network queue");


static unsigned int min_cpu_freq;
module_param(min_cpu_freq, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(min_cpu_freq,
	"to set minimum cpu frquency to when ethernet ifc is active");

/* this refers to max number sgs per transfer
/* this refers to max number sgs per transfer
 * which includes headers/data packets
 * which includes headers/data packets
 */
 */
@@ -1497,16 +1502,16 @@ static int gether_cpufreq_notifier_cb(struct notifier_block *nfb,
	struct eth_dev	*dev = container_of(nfb, struct eth_dev,
	struct eth_dev	*dev = container_of(nfb, struct eth_dev,
					cpufreq_notifier);
					cpufreq_notifier);


	if (!min_cpu_freq)
		return NOTIFY_OK;

	switch (event) {
	switch (event) {
	case CPUFREQ_ADJUST:
	case CPUFREQ_ADJUST:
		pr_debug("%s: cpu:%u\n", __func__, cpu);
		pr_debug("%s: cpu:%u\n", __func__, cpu);


		if (dev->state == ETH_START)
		if (dev->state == ETH_START)
			cpufreq_verify_within_limits(policy,
			cpufreq_verify_within_limits(policy,
					1000000, UINT_MAX);
					min_cpu_freq, UINT_MAX);
		else
			cpufreq_verify_within_limits(policy,
					policy->min, UINT_MAX);


		break;
		break;
	}
	}