Bug 253667 - Add support for the Processor interface when HAL is not used
Summary: Add support for the Processor interface when HAL is not used
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: libsolid (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Rafael Fernández López
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2010-10-09 15:40 UTC by Kevin Ottens
Modified: 2012-04-04 20:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Ottens 2010-10-09 15:40:30 UTC
Investigate possibilities for a processor backend, or how to do it for the UDev backend.
Comment 1 Rafael Fernández López 2010-11-10 02:12:54 UTC
Added by revision 1194856, but yet to implement:

- maxSpeed
- canChangeFrequency
- instructionSets

The number of processor is fetched from the URI itself, I guess this is fine, but just in case...
Comment 2 Alex Merry 2010-11-16 17:35:36 UTC
canChangeFrequency is obtained by HAL from /proc/acpi/processor/CPU{number}/info, by looking at the "throttling control" field.

maxSpeed is not set by HAL on Linux (only on FreeBSD).
Comment 3 Kevin Ottens 2010-11-22 19:55:42 UTC
The content of /sys/devices/LNXSYSTM:00/LNXCPU:XX/sysdev/cpufreq/ (so the sysdev/cpufreq folder from the pristine udev path) is much more reliable for me. For instance /proc is plain lies on my laptop for some reasons.

And using this one I get the max speed info easily as well.
Comment 4 Alex Merry 2010-11-22 21:28:06 UTC
Hmm... I have to modprobe acpi_cpufreq to get that folder to appear.

I think maybe we should use sysfs (cpufreq) if we can, and fall back to /proc if that fails.
Comment 5 Kevin Ottens 2010-11-23 07:56:52 UTC
Honestly I'd assume cpufreq to be there, these days it's supposed to be by default and moreover for the frequency and throttling it's likely not going to happen anyway if cpufreq isn't loaded (AFAIK).
Comment 6 Alex Merry 2010-11-23 14:49:44 UTC
(See Review Request for details).

After some more research into the distinction between throttling and frequency scaling, I decided that HAL was doing it wrong (or, at least, the HAL Solid backend was reporting misleading information).  My latest patch uses cpufreq exclusively for canChangeFrequency(), and cpufreq for preference (with a fallback to /proc/cpuinfo) for maxSpeed().

It still gets vendor and model info through /proc/cpuinfo, as that is not reported through sysfs.
Comment 7 Lukáš Tinkl 2012-04-04 20:37:16 UTC
This is fixed with the existing udev backend