Subject: Re: sysmon_power bug?
To: Jachym Holecek <freza@dspfpga.com>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 06/07/2006 14:39:30
On Jun 7, 2006, at 1:44 PM, Jachym Holecek wrote:

> Hello,
>
> at a glance, it seems that sys/dev/sysmon/sysmon_power.c will silently
> keep rewriting event #0 when events are pushed on the queue, and never
> use other elements of the queue. Is the diff below OK to commit?

Cute.  Please check it in, and send pullups to the relevant branches.

>
> 	-- Jachym
>
> Index: sysmon_power.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/sysmon/sysmon_power.c,v
> retrieving revision 1.11
> diff -u -r1.11 sysmon_power.c
> --- sysmon_power.c	11 Dec 2005 12:23:56 -0000	1.11
> +++ sysmon_power.c	7 Jun 2006 20:29:31 -0000
> @@ -77,7 +77,7 @@
>
>  #define	PEVQ_F_WAITING		0x01	/* daemon waiting for event */
>
> -#define	SYSMON_NEXT_EVENT(x)		(((x) + 1) / SYSMON_MAX_POWER_EVENTS)
> +#define	SYSMON_NEXT_EVENT(x)		(((x) + 1) % SYSMON_MAX_POWER_EVENTS)
>
>  /*
>   * sysmon_queue_power_event:

-- thorpej