public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rudolf Marek <r.marek@sh.cvut.cz>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: wim@iguana.be, linux-kernel@vger.kernel.org
Subject: Re: [RFC] Watchdog device class
Date: Tue, 18 Apr 2006 20:35:55 +0200	[thread overview]
Message-ID: <4445318B.1040800@sh.cvut.cz> (raw)
In-Reply-To: <1145309500.14497.6.camel@localhost.localdomain>

Hello Alan,

>>The char device of watchdog class is compatible with existing watchdog API,
>>so no need to change the user applications. There is just one exception
>>and this is temperature handling. I belive it should be implemented not
>>via IOCTL but using the HWMON class. (100% compatibility can be restored
>>with the ioctl class op)
> 
> 
> Then it should be kept.

Ok I think best would be to create ops->ioctl callback for not so common
ioctls (like the temp one) and let the driver to deal with them.

> The watchdog API simply pre-dates the sysfs world, it goes back to the
> 1.0-1.2 era and has remained very consistent since that time.
> 
> If you expose it in sysfs somewhere (which I think is a good idea) then
> the units should probably also be fixed in the sysfs case to be metric
> (ie Kelvin or Centigrade float values) [or scaled int]

Yep I have this in mind. But not yet the topic of the day. So far I have:

name - this is not need perhaps it can be found in another place in sysfs
timeout - timeout value in sec - convert it to ms perhaps?
ping - "ping" file, to replace the /dev/watchdog writes
boot_status - the boot status - meaning same as IOCTL has, generaly the reset reason
status - current status - same as ioctl equivalent

And optional firmware_ver to reflect the IOCTL equvalent.

This is needed to be discussed with Wim first. I hope he will speak up ;)

As for the temps/fans I belive the driver should register in hwmon class and use
hwmon class sysfs iterface and then just create sort of relation between the
sysfs files/classes, so the watchdog app can find the temps.

>>	int (*set_timeout)(struct device *, int sec);
> 
> 
> Pass the usual time structures instead. Seconds is a field so it is free
> but it means all the signed/unsigned stuff and any future subsecond
> watchdogs for embedded environments don't break stuff.

Good idea, I will change it. Thanks.

>>	int (*notify_reboot)(struct notifier_block *this, unsigned long code,
>>	        void *unused);
> Can this not use the power management callbacks from the device model
> instead

Ah I knew about the suspend/resume and it seems there is also a shutdown one.

 >>	/* this may be removed in the future */
>>	struct watchdog_info legacy_info;
> 
> This wants breaking out into sysfs, but again the ioctls are expected
> and standardised for years now.
> 
> People have talked about sorting out a watchdog helper library for years
> so this is overdue, and doing it with the class model in mind is even
> better.

I was quite amazed when I saw same code copied 40x in one directory ;)

Thanks for the comments,
Regards
Rudolf

  reply	other threads:[~2006-04-18 18:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-17 19:39 [RFC] Watchdog device class Rudolf Marek
2006-04-17 21:31 ` Alan Cox
2006-04-18 18:35   ` Rudolf Marek [this message]
2006-04-18 20:16     ` Alan Cox
2006-04-18  0:54 ` Arnd Bergmann
2006-04-18 19:32   ` Rudolf Marek
2006-04-18 22:24     ` Mark Rustad
2006-04-18 19:57 ` Wim Van Sebroeck
2006-04-18 20:59   ` Rudolf Marek
2006-04-19 21:02     ` Wim Van Sebroeck
2006-04-19 21:24       ` Rudolf Marek
2006-08-15 17:13         ` Wim Van Sebroeck
2006-09-14 12:19           ` Rudolf Marek
2006-04-18 23:07 ` Corey Minyard
2006-04-19 21:04   ` Wim Van Sebroeck

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=4445318B.1040800@sh.cvut.cz \
    --to=r.marek@sh.cvut.cz \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wim@iguana.be \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox