On 09/24/08 18:59, Bill Holler wrote:
> On 09/24/08 18:45, Li, Aubrey wrote:
>   
>> Bill.Holler wrote:
>>
>>   
>>     
>>> A callback will work great.  The callback interface is in
>>> uts/common/sys/callb.h.  We can add a callback class such as
>>> #define    CB_CL_CPU_DEEP_IDLE      16
>>>
>>> cpudrv can register a CB_CL_CPU_DEEP_IDLE callback
>>> in its init function.
>>> /dev/pm can invoke callb_execute_class() CB_CL_CPU_DEEP_IDLE from its
>>> ioctl case.
>>>
>>> The cpudrv callback can do whatever it needs to do to enable/
>>> disable C-States.  The cpudrv callback can call the hpet
>>> interface to enable/disable the cstate_timer.
>>>
>>>
>>>                  power.conf
>>>                     |
>>>                     v
>>>                  pmconfig
>>>                     |
>>>                     v
>>>           pm driver's pm_ioctl
>>> callb_execute_class(CB_CL_CPU_DEEP_IDLE)
>>>                     |
>>>                     v
>>>           cpudrv callback function
>>>                   |   ^
>>>                   v   |
>>>      hpet.cstate_timer_[enable|disable]
>>>
>>>
>>>
>>> I believe there will be only 1 callback into cpudrv, not
>>> 1 callback per driver instance?
>>>
>>>     
>>>       
>> I think so for hpet timer enable/disable. But since idle function is
>> per-cpu now, I think we still need idle_cpu_no_deep_c to check
>> if we need to enter deep cstate on-the-fly.
>>
>> Thanks,
>> -Aubrey
>>   
>>     
>
> Can the callback change the per-cpu idle function pointers?
>
> Bill

We need a kernel variable to disable Deep C-States on
buggy hardware.  Perhaps we can use idle_cpu_no_deep_c
to always disable Deep C-States, and use a new cpudrv
variable to enable/disable cstates in the idle loop?

Bill

Reply via email to