tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: sysctl question

On 21-Jun-2008 Paul Goyette wrote:
> And now for some initial questions:

I'm going to answer the ones I know the answer to off the top of my head.  I
may have to think or dig some on the other one, or perhaps someone else could
chime in on #5.

> 6. The current code seems to assume that zero is an invalid value for
>     the user_crit_{min,max} setting.  Is this assumption valid?  While
>     I can't imagine anyone actually trying to run their system in sub-
>     freezing temperatures, the sensors I'm playing with are capable of
>     registering temperatures from -256 to +255 degC!

Yeah, thats because temperature is internally in microkelvin, it will never fall
to zero on a working sensor.

> 7. I've noticed that the values for PENVSYS_EVENT_* defined in
>     sys/power.h have values in increments of 10.  I don't seem to find
>     any rationale for this.  Would it be acceptable to insert new values
>     in between existing ones, or should the whole table be renumbered?
>     (Inserting might make it easier if sorting the work queue is the
>     right answer to #5).

I suspect it was done this way to allow you to insert things between them as
you intend to.  You might dig through the CVS logs to see if any mention of
that was made.

> 8. If I modify the envsys framework to add the user_warn_{min,max}
>     stuff, would it even make sense for the sensor's driver to set the
>     hardware-based thresholds?  It seems to me that if I do that, I'll
>     end up sending two events for every threshold crossing.  For example
>     I'd send both a CRITOVER and USER_CRITOVER event if the sensor gets
>     above the crit_max setting.

That seems broken to me.  I would imagine correct behavior would be that USER
overrides the system set/default one.  I do think you should set one by default
in the driver, in case the user doesn't bother to wire stuff up properly though.

Tim Rightnour <>
NetBSD: Free multi-architecture OS
Genecys: Open Source 3D MMORPG:

Home | Main Index | Thread Index | Old Index