APM driver patch summary

APM driver patch summary

Post by Borsenkow Andre » Sun, 06 Jan 2002 05:00:18



Sorry for the delay, I was off before New Year and then could not test
it ...


Quote:> Hi,
> I merged 2., 3. and 4. (attached) with some modifications.

> 1. There is now a module parameter apm-idle-threshold which allows to override
>    the compiled in idle percentage threshold above which BIOS idle calls are
>    done.

> 2. I modified Andrej's mechanism to detect a defunct BIOS (stating 'does stop
>    CPU' when it actually doesn't) to take into account that there's other
>    interrupts than the timer interrupt that could reactivate the cpu.
>    As there's 16 hardware interrupts on x86 (apm is arch specific anyway) I do
>    use a leaky bucket counter for a maximum of 16 idle rounds until jiffies is
>    increased. When the counter reaches zero it stays at this value and the
>    system idle routine is called. If BIOS idle is a noop then the counter
>    reaches zero fast, thus effectively halting the cpu.

I do not think you need it. Either interrupt waked up somebody and set
need_resched and we exit loop or nobody is ready to run and we can sleep
again. Why complicate things any more than needed?

Quote:> Andrej, could you please test the patch if it works for your laptop?

It does not work and I am very surprised it works for somebody (well,
there are conditios when it will work). By default pm_idle is always
NULL so we *never* actually call kernel function that really stops CPU.
Main idle task is cpu_idle that does

if (pm_idle)
   pm_idle()
or
   default_idle

and CPU is halted in default_idle. So your patch just enters busy loop
calling BIOS APM Idle over and over again just like it was before.

Attached patch makes apm_cpu_idle do the same and call either old
pm_idle (a.k.a. sys_idle) or default_idle. I removed your interrupt
handling - it does not actually affect the problem but it still is not
needed IMHO. t1, t2 are changed from int into long because jiffies is
long - not sure if it is really needed.

cheers and sorry for delay

-andrej

  apm.diff
1K Download
 
 
 

1. APM driver patch summary

I believe the cli() and sti() to be correct - you shouldn't call
pm_send_all with IRQs off as it was previously.  pm_send_all is a
function that can sleep (check the down(&pm_devs_lock) call).

--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. multiple networks on same hub ?

3. PATCH: apm.c - detection of brokern APM Idle call implementation

4. Bison and GCC

5. PATCH: apm.c - runtime parameter for APM Idle call

6. 28.8kbps no better than 14.4kbps?

7. Patch LMS/Philips CD205/225/202 (driver is available as a kernel patch)

8. Printing via a smart switch

9. New APM BIOS patches

10. APM patch for sysvinit (poweroff)

11. Patch 113490-1 5.9 Audio Driver Patch (bigadmin teaser)

12. APM patch for idle_period handling

13. PATCH: make APM machine independant using mach headers