Closed valpackett closed 5 years ago
static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
Can you add some prints in amdgpu_set_pp_od_clk_voltage() to print the parameter array in question like this:
uint32_t xx; for (xx = 0; xx != parameter_size; xx++) printf("parameter %d = %d\n", (int)xx, (int)parameter[xx]);
Right after the while (temp_str[0]) loop ?
tmp_str = 'm 3 1090 1000
'
[ifedit] tmp_str = 'm 3 1090 1000
'
[isspace] tmp_str = '1090 1000
'
parameter 0 = 1090
parameter 1 = 1000
whoops, the second field actually gets chopped off by
while (isspace(*++tmp_str));
OH right if isspace
from ctype.h
is used, it would expand to
((*++tmp_str) == ' ' || ((*++tmp_str) >= '\t' && (*++tmp_str) <= '\r'))
I wonder if we should fix this upstream!
Yes, that works, thanks!
https://svnweb.freebsd.org/changeset/base/345499 Will land in 11- and 12- soon.
The
pp_od_clk_voltage
sysctl is described here (see also e.g. WattmanGTK code). Setting a P-state works like this on Linux:However, something in the parsing goes wrong on our end when trying to set the corresponding sysctl to that string: (I added extra debug output with values)
It's seeing 2 fields instead of 3, using the value of the 3rd field as 2nd…
So currently, an extra blank field is required:
Maybe our
strsep
doesn't do the same thing as the Linux one or something…