Bug 58521

Summary: Radeon ATOM BIOS have wrong value in controller->ucType for RV635 chip
Product: Drivers Reporter: Guram Savinov (guram.savinov)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: NEW ---    
Severity: normal CC: alexdeucher, guram.savinov, szg00000, zajec5
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 3.5.0 Subsystem:
Regression: No Bisected commit-id:

Description Guram Savinov 2013-05-20 00:16:01 UTC
I have Asus M50Sa laptop with ATI Radeon Mobility HD3650(RV635 chip) graphics.
RV635 chip have internal thermal sensor, but for my graphics it's no hwmon entry in /sys/class/hwmon.

I found that in radeon_atombios.c it's checking for thermal sensor from ATOM BIOS structure:

##################################
static void radeon_atombios_add_pplib_thermal_controller(struct radeon_device *rdev,
                                                         ATOM_PPLIB_THERMALCONTROLLER *controller)
{
        struct radeon_i2c_bus_rec i2c_bus;

        /* add the i2c bus for thermal/fan chip */
        if (controller->ucType > 0) {
                if (controller->ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) {
                        DRM_INFO("Internal thermal controller %s fan control\n",
                                 (controller->ucFanParameters &
                                  ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with");
                        rdev->pm.int_thermal_type = THERMAL_TYPE_RV6XX;
                } else if (controller->ucType == ATOM_PP_THERMALCONTROLLER_RV770) {

...
###################################

But for my graphics controller->ucType have 0, that mean  ATOM_PP_THERMALCONTROLLER_NONE.
I try to set THERMAL_TYPE_RV6XX to controller->ucType, hwmon was added and I have thermal sensor for my RV635 chip, all works great.

May be it's Asus M50Sa ATOM BIOS bug, but why you check thermal sensor for RV635?
Is it possible to have RV635 chip without internal thermal sensor?

It'll be great to not check thermal sensor type for RV635 chip, because AMD say that it shipped with internal thermal sensor.
Comment 1 Alex Deucher 2013-05-20 13:02:30 UTC
A lot of laptop OEMs don't use the internal thermal sensor.  In most cases they use a platform specific thermal sensor since they often cover multiple components with the same thermal zone.  It's usually exposed via a platform specific acpi thermal zone or acpi temperature sensor.  It's not a bios bug; very few r6xx/r7xx laptops expose the internal thermal sensor.
Comment 2 Guram Savinov 2013-05-20 13:11:13 UTC
In this case it will be better to setup internal thermal sensor without checking AtomBIOS thermal sensor info value, isn't it?

It's no a lot chanses to have acpi sensors support in linux kernel.
I think if we know that chip have internal sensor, we should setup it.
Comment 3 Alex Deucher 2013-05-20 13:22:00 UTC
It might produce garbage results depending on the thermal solution from the OEM.
Comment 4 Guram Savinov 2013-05-20 13:32:03 UTC
Is it possible to implement force enabling internal sensor configuration by conf file?
Because OEM's disable thermal sensor info in AtomBIOS we haven't sensor for GPU.
Comment 5 Guram Savinov 2013-05-20 13:38:48 UTC
>>It might produce garbage results depending on the thermal solution from the
OEM.

OEM? I talk about ATI on-chip thermal sensor, it's not OEM, right?
Comment 6 Alex Deucher 2013-05-20 13:47:01 UTC
The OEM designs the thermal solution for the laptop.  If they choose not to use the internal thermal sensor, there is no guarantee that it's calibrated correctly for their specific system.
Comment 7 Guram Savinov 2013-05-20 13:52:21 UTC
Ok, but how about comment#4, is it possible?

By default sensor will be initialized as it implemented now, but it will be possible to override OEM configuration that disable internal sensor.
Comment 8 Alex Deucher 2013-05-20 13:59:06 UTC
I'd prefer not to.  These sort of options tend to be abused.  Users and possibly some distros will start forcing the option on, and then we'll get swamped with bug reports about garbage temperatures where the reporter will fail to note that they forced the option on.
Comment 9 Rafał Miłecki 2013-05-20 14:05:32 UTC
(In reply to comment #8)
> I'd prefer not to.  These sort of options tend to be abused.  Users and
> possibly some distros will start forcing the option on, and then we'll get
> swamped with bug reports about garbage temperatures where the reporter will
> fail to note that they forced the option on.

Sounds sane.

@Guram: what about ACPI? Did you investigate why Linux doesn't export thermal info from it?
Comment 10 Guram Savinov 2013-05-20 14:48:17 UTC
>>@Guram: what about ACPI? Did you investigate why Linux doesn't export thermal
info from it?

Maybe Asus M50Sa laptop have no hardware ACPI thermal sensors.
If it exist I think Asus include any monitor software tool with laptop CD's.

99% that ATI internal sensor only one way to get GPU themperature.