All of lore.kernel.org
 help / color / mirror / Atom feed
From: j.w.r.degoede@hhs.nl (Hans de Goede)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] Proposal to individual alarm/beep sysfs files
Date: Mon, 06 Mar 2006 07:30:11 +0000	[thread overview]
Message-ID: <440BE503.3010303@hhs.nl> (raw)
In-Reply-To: <20060305231105.97f9085a.khali@linux-fr.org>

Jean Delvare wrote:

>The original discussion was between per-type files versus per-channel
>files. I think we agreed that individual files were better, allowing a
>much cleaner implementation. Per-type files would require us to reorder
>all bits when the chip has them in a random order (which is most often
>the case, unfortunately). With per-channel files, we just have to
>extract the correct bit, which is easy. We can even use the same
>callback for all alarms, as demonstrated at the end of this post.
>
>Now, some chips offer more than one alarm for a given channel. For
>example the LM90/ADM1032 has a separate alarm for low limit crossed,
>high limit crossed and critical limit crossed. It was suggested that we
>could have non-boolean alarm files, and it makes some sense. However,
>on second though, it means that we would have to define a standard bit
>order inside such alarm files, and we'll have to build the contents
>from the registers. This won't be easier than having per-type files,
>which we said we did not want to do.
>
>So my new suggestion is to have per-limit alarm files for chips which
>implement things that way. This makes every alarm file a boolean. The
>only drawback I can think of is that we'll end up with many more sysfs
>files defined in each driver. However, the size increase seems to be
>acceptable, thanks to the dynamic sysfs callbacks and the array of
>attributes which we can use now.
>
>Fault conditions and beep masks can be handled exactly the same way.
>  
>

I still vote for having one file per type of alarm. All you need is an 
array which contains the correct masks per sensor type for the alarm reg 
and then a loop which contructs a new virtual alarm reg , by masking the 
real alarm reg with the values in the array and storing the true/false 
results linear in a new mask.

I think having a zillion files in sysfs is a bad idea, besides the 
obvious driver size this also requires a kobject per file, which is a 
refcount ed object and thus not so light.

Either way we need a standard and we need it yesterday.

Regards,

Hans



  parent reply	other threads:[~2006-03-06  7:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-05 22:11 [lm-sensors] Proposal to individual alarm/beep sysfs files Jean Delvare
2006-03-06  7:08 ` Philip Pokorny
2006-03-06  7:30 ` Hans de Goede [this message]
2006-03-06 10:21 ` Jean Delvare
2006-03-06 10:54 ` Jean Delvare
2006-03-10  2:44 ` Mark M. Hoffman
2006-03-10 13:15 ` Jean Delvare
2006-03-14  6:32 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=440BE503.3010303@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.