Bug 112141

Summary: RAPL kernel driver should not create sysfs file if platform does not have support
Product: Drivers Reporter: Daniela Prodan (daniela.doras-prodan)
Component: Video(DRI - Intel)Assignee: intel-gfx-bugs (intel-gfx-bugs)
Status: RESOLVED WILL_NOT_FIX    
Severity: normal CC: aaron.lu, iabhiunix, intel-gfx-bugs
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.5.0-rc1 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg output
Components built

Description Daniela Prodan 2016-02-08 11:37:49 UTC
Created attachment 203111 [details]
dmesg output

On an Ironlake platform (Intel Core i5 CPU 650  @ 3.20GHz) , the  /sys/kernel/debug/dri/0/i915_energy_uJ file is created but it cannot be opened, since the platform does not have RAPL driver support. 

# sudo cat /sys/kernel/debug/dri/0/i915_energy_uJ
cat: /sys/kernel/debug/dri/0/i915_energy_uJ: No such device
Comment 1 Daniela Prodan 2016-02-08 11:38:50 UTC
Created attachment 203121 [details]
Components built
Comment 2 Jani Nikula 2016-02-19 14:51:57 UTC
Works as expected, then.

For sure we will keep creating the file for all platforms (and we have plenty of similar cases). It's more up to debate whether the file should be empty or access should return -ENODEV or similar. We seem to do a little bit of both, but the error is more obvious.
Comment 3 Jani Nikula 2016-02-19 14:52:27 UTC
Also, new bugs against i915 should be filed at the freedesktop.org bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel