[qca-nss-drv] Fix cmd inferfance, idling issues, and fabric frequencies
Fix the user space commandline by setting loffset to 0. Will prevent kernel
from calling twice
Use averaging buffer to protect random spikes of when trying to idling
Use 133mhz instead of 5mhz for fabric
Change-Id: Idb13c913d002c8c3a4705b32bbecd98dc858cb18
Signed-off-by: Thomas Wu <wthomas@codeaurora.org>
diff --git a/nss_init.c b/nss_init.c
index a41f463..105b772 100755
--- a/nss_init.c
+++ b/nss_init.c
@@ -235,8 +235,9 @@
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
- if (!write) {
+ if (!*lenp || (*ppos && !write)) {
printk("Frequency Set to %d\n", nss_cmd_buf.current_freq);
+ *lenp = 0;
return ret;
}
@@ -286,7 +287,9 @@
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
- if (!write) {
+ if (!*lenp || (*ppos && !write)) {
+ printk("Autoscale Set to %d\n", nss_cmd_buf.auto_scale);
+ *lenp = 0;
return ret;
}
@@ -356,7 +359,12 @@
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+ if (write) {
+ return ret;
+ }
+
printk("Frequency Supported - ");
+
i = 0;
while (i < NSS_FREQ_MAX_SCALE) {
printk("%dMhz ", nss_runtime_samples.freq_scale[i].frequency/1000000);
@@ -364,6 +372,7 @@
}
printk("\n");
+ *lenp = 0;
return ret;
}
@@ -377,10 +386,13 @@
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
- if (!ret && !write) {
- printk("Current Inst Per Ms %x\n", nss_runtime_samples.average);
+ if (write) {
+ return ret;
}
+ printk("Current Inst Per Ms %x\n", nss_runtime_samples.average);
+
+ *lenp = 0;
return ret;
}
#endif