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?
Regards,
Bill
On 09/24/08 16:18, Napanda Pemmaiah wrote:
> On 09/24/08 15:25, Bill Holler wrote:
>
>> This looks like what we need to do to support the cpu_deep_idle
>> keyword in power.conf(4).
>>
>> pmconfig(1M) is in /ws/onnv-gate/usr/src/cmd/power.
>> We can add a conftab[] entry in parse.c for "cpu_deep_idle" like:
>> "cpu_deep_idle", cpu_deep_idle, &pm_status,
>> NULL, 2, 0, 1,
>>
>> A cpu_deep_idle handler can be added in handlers.c similar to cpupm.
>> The handler invokes ioctl() on pm_fd with
>> PM_START_CPU_DEEP_IDLE or PM_STOP_CPU_DEEP_IDLE.
>>
>> This will enter the pm device's pm_ioctl() function which can have
>> cases added for PM_START_CPU_DEEP_IDLE and
>> PM_STOP_CPU_DEEP_IDLE.
>>
>> Ideally we want these pm_ioctl cases to perform something like
>> a layered ioctl to the cpudrv driver?
>>
>>
>> power.conf
>> |
>> v
>> pmconfig
>> |
>> v
>> pm driver's pm_ioctl
>> |
>> v
>> cpudrv ioctl ?
>>
>>
>>
> This sounds reasonable. The other way might be through callbacks. As you
> would have noticed currently there is no ioctl facility in cpudrv. We
> are working on it, so
> that the cpudrv supports ioctls. It can be used for both layered ioctls
> and user ioctls.
>
> Anup
>
>
>> Does anyone have another idea how to enter the cpudrv in this case?
>>
>> Regards,
>> Bill
>>
>> _______________________________________________
>> tesla-dev mailing list
>> tesla-dev at opensolaris.org
>> http://mail.opensolaris.org/mailman/listinfo/tesla-dev
>>
>>
>
>
>