Re: [PATCH v7 3/4] PM / DEVFREQ: add basic governors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 24, 2011 at 2:29 AM, Turquette, Mike <mturquette@xxxxxx> wrote:
> On Tue, Aug 23, 2011 at 12:54 AM, MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx> wrote:
>
> I think that user_set_freq == 0 is a valid request from a user.  A
> user might not know what the valid frequencies are for a device, but
> knows that he/she wants the lowest one.  Writing 0 to the sysfs value
> should give the floor of the available frequencies.
>

Users can know what is the minimum valid frequency with
devfreq_min_freq. However, writing 0 to the sysfs is a comfortable
method and I'll allow that input in the next revision along with the
patch of allowing governors to have their own sysfs entries with
example of userspace.

>> +       else
>> +               *freq = df->user_set_freq;
>> +
>> +       return 0;
>> +}
>> +
>> +struct devfreq_governor devfreq_userspace = {
>> +       .name = "userspace",
>> +       .get_target_freq = devfreq_userspace_func,
>> +};
>
> The set_user_frequency attribute should be moved out of devfreq.c
> (patch 4) and live here.  There is no purpose to that entry except for
> the userspace governor and it should not exist in sysfs unless this
> governor is in use.  To be clear, there should still be a read-only
> show_frequency or something in devfreq.c.
>
> This again touches on my long-standing complaints with this series'
> design.  set_user_frequency is an attribute that belongs to the
> governor, not to the core.  Such misplacement of attribute/entity
> ownership is common in this series, but I won't go down that rabbit
> hole again.  In the mean time at least this one instance of the
> problem for the userspace gov should be fixed up.
>
> Regards,
> Mike
>


I'll include a patch that shows an example of having a governor
specific sysfs entry at the next revision. It is enabled by
introducing a function to governors "struct devfreq
*get_devfreq(struct device *dev);" at /device/devfreq/governor.h
(local to governors) and adding .init and .exit callbacks at struct
devfreq_governor.


Cheers!

MyungJoo


-- 
MyungJoo Ham (함명주), Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm



[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux