All of lore.kernel.org
 help / color / mirror / Atom feed
* Weird interaction between thermal and cpufreq drivers
@ 2016-04-28 15:24 Mason
  2016-05-03 15:34 ` Mason
  0 siblings, 1 reply; 3+ messages in thread
From: Mason @ 2016-04-28 15:24 UTC (permalink / raw)
  To: linux-pm; +Cc: Viresh Kumar, Javi Merino, Eduardo Valentin, Sebastian Frias

Hello linux-pm,

I'm seeing a weird bug, where the thermal driver(*) returns bogus
temperatures once I lower the CPU frequency.

(*) drivers/thermal/tango_thermal.c

The setup: I'm using next-20160428
(Is it a good idea to test on linux-next?
Are there bugs lurking there that get sorted out later?)

I have a script which prints /sys/class/thermal/thermal_zone0/temp
every second.

When the CPU is running at nominal speed, these values seem correct.
("seem" because I don't have the HW to calibrate the thermometer.)

But once I lower the frequency of the CPU(*), the script starts
printing bogus values like 29000 (my driver's minimum) and very
high temps like 100000 or even 137000!

(*) echo 135000 > /sys/devices/system/cpu/cpufreq/scaling_max_freq
I'm using the performance governor, so everything should be manual,
if I understand correctly.

I looked at timing issues in my driver. I do have an obvious
usleep_range(10, 20); in my code. IIUC, this primitive will use
the underlying Cortex A9 twd block, which does introduce errors
on frequency changes, so I switched it to udelay(100); This one
should only use the platform tick counter, which ticks at a
constant speed. But I still have the issues.

Any idea what could be going wrong?

I guess I can test on v4.6-rc5

Regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-03 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28 15:24 Weird interaction between thermal and cpufreq drivers Mason
2016-05-03 15:34 ` Mason
2016-05-03 15:40   ` [PATCH] thermal: tango: initialize TEMPSI_CFG Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.