On 09/24/08 19:33, Li, Aubrey wrote: > 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? >> >> > > It does if you want to use xcall. > > Thanks, > -Aubrey >
Should cstate_timer_disable() wakeup all CPUs currently in idle using the HPET timer? That might make the wakeup changeover code simpler because it will not have to worry about lost wakeups when it changes from IPI to MWAIT type wakeup. Regards, Bill
