[Debian-eeepc-devel] [PATCH] eeepc-laptop: disable cpu speed control on EeePC 701

Alan Jenkins alan-jenkins at tuffmail.co.uk
Fri Dec 11 09:08:48 UTC 2009


Corentin Chary wrote:
> On Thu, Dec 10, 2009 at 11:30 PM, Alan Jenkins
> <alan-jenkins at tuffmail.co.uk> wrote:
>>
>> +static ssize_t store_cpufv_disabled(struct device *dev,
>> +                          struct device_attribute *attr,
>> +                          const char *buf, size_t count)
>> +{
>> +       struct eeepc_laptop *eeepc = dev_get_drvdata(dev);
>> +       int rv, value;
>> +
>> +       rv = parse_arg(buf, count, &value);
>> +       if (rv < 0)
>> +               return rv;
>> +
>> +       switch (value) {
>> +       case 0:
>> +               if (eeepc->cpufv_disabled)
>> +                       pr_warning("cpufv enabled (not officially supported
>> "
>> +                               "on this model)\n");
>> +               eeepc->cpufv_disabled = false;
>> +               return rv;
>> +       case 1:
>> +               return -EPERM;
>>     
>
> Why -EPERM if value 1 ? Can't we just do cpufv->disabled = true; return rv; ?
>   

On its own, that would mean

echo 1 > cpufv_disabled
echo 0 > cpufv_disabled

would always log the "not officially supported" warning, even on 
supported models.

I didn't think it was worth the extra code to distinguish between 
"disabled by kernel blacklist" and "disabled by user".  If you enable it 
and then change your mind, you get to reboot :).

Thanks
Alan



More information about the Debian-eeepc-devel mailing list