From: Scott Cheloha <cheloha@linux.ibm.com>
To: linux-watchdog@vger.kernel.org
Cc: bjking@linux.ibm.com, nathanl@linux.ibm.com, aik@ozlabs.ru,
npiggin@gmail.com, vaishnavi@linux.ibm.com, wvoigt@us.ibm.com
Subject: [RFC v1 0/2] Add driver for PAPR watchdog timers
Date: Wed, 13 Apr 2022 11:51:02 -0500 [thread overview]
Message-ID: <20220413165104.179144-1-cheloha@linux.ibm.com> (raw)
This series adds a driver for PAPR hypercall-based watchdog timers,
tentatively named "pseries-wdt".
I wanted to get some clarification on a few things before submitting
the series as a patch, hence the RFC. The first patch adding the
hypercall to hvcall.h is straightforward, but I have questions about
the second patch (the driver). In particular:
- In pseries_wdt_probe() we register the watchdog device with
devm_watchdog_register_device(). However, in pseries_wdt_remove(),
calling watchdog_unregister_devce() causes a kernel panic later,
so I assume this is the wrong thing to do.
Do we need to do anything to clean up the watchdog device during
pseries_wdt_remove()? Or does devm_watchdog_register_device()
ensure the cleanup is handled transparently?
- In pseries_wdt_probe(), is it incorrect to devm_kfree() my
allocation in the event that devm_watchdog_register_device()
fails?
- The enormous hypercall input/output comment is mostly for my
edification. It seems like the sort of thing that will rot over time.
I intend to remove most of it. However, as far as I know the PAPR
revision containing these details is not published yet. Should I
leave the comment in to ease review for now and remove it later?
Or should I omit it from the initial commit entirely?
- Should we print something to the console when probing/removing the
watchdog0 device or is that just noise?
Most drivers (as distinct from devices) seem to print something
during initialization, so that's what I've done in
pseries_wdt_module_init() when the capability query succeeds.
- The timeout action is currently hardcoded to a hard reset. This
could be made configurable through a module parameter. I intend
to do this in a later patch unless someone needs it included
in the initial patch.
- We set EIO if the hypercall fails in pseries_wdt_start() or
pseries_wdt_stop(). There is nothing userspace can do if this
happens. All hypercall failures in these contexts are unexpected.
Given all of that, is there is a more appropriate errno than EIO?
- The H_WATCHDOG spec indicates that H_BUSY is possible. Is it
probable, though? Should we spin and retry the hypercall in
the event that we see it? Or is that pointless?
next reply other threads:[~2022-04-13 16:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 16:51 Scott Cheloha [this message]
2022-04-13 16:51 ` [RFC v1 1/2] powerpc/pseries: hvcall.h: add definitions for H_WATCHDOG hypercall Scott Cheloha
2022-04-13 16:51 ` [RFC v1 2/2] watchdog: pseries-wdt: initial support for PAPR virtual watchdog timers Scott Cheloha
2022-04-14 3:20 ` Tzung-Bi Shih
2022-04-14 3:48 ` Guenter Roeck
2022-04-14 2:23 ` [RFC v1 0/2] Add driver for PAPR " Guenter Roeck
2022-04-14 12:39 ` Nathan Lynch
2022-04-19 8:49 ` Alexey Kardashevskiy
2022-04-19 13:55 ` Guenter Roeck
-- strict thread matches above, loose matches on Subject: below --
2022-04-13 16:48 Scott Cheloha
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=20220413165104.179144-1-cheloha@linux.ibm.com \
--to=cheloha@linux.ibm.com \
--cc=aik@ozlabs.ru \
--cc=bjking@linux.ibm.com \
--cc=linux-watchdog@vger.kernel.org \
--cc=nathanl@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=vaishnavi@linux.ibm.com \
--cc=wvoigt@us.ibm.com \
/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.