From: Wim Coekaerts <wim.coekaerts@oracle.com>
To: Julian Calaby <julian.calaby@gmail.com>, davem@davemloft.net
Cc: wim@iguana.be, linux-watchdog@vger.kernel.org,
sparclinux <sparclinux@vger.kernel.org>
Subject: Re: [PATCH] watchdog: add sun4v_wdt device support
Date: Wed, 20 Jan 2016 23:37:16 +0000 [thread overview]
Message-ID: <56A01A2C.3020805@oracle.com> (raw)
In-Reply-To: <CAGRGNgX+bKYEvc8toZEf+F9fwTm+TedEu7gtd5YhqNb6LP4eGQ@mail.gmail.com>
On 1/20/16 2:43 PM, Julian Calaby wrote:
> Hi Wim Coekaerts,
>
> On Thu, Jan 21, 2016 at 7:30 AM, <wim.coekaerts@oracle.com> wrote:
>> From: Wim Coekaerts <wim.coekaerts@oracle.com>
>>
>> This adds a simple watchdog timer for the SPARC sunv4 architecture.
>> Export the sun4v_mach_set_watchdog() hv call, and add the target.
>>
>> The driver is implemented using the new watchdog api framework.
>>
>> Signed-off-by: Wim Coekaerts <wim.coekaerts@oracle.com>
> This all looks _much_ better.
>
> There's nothing glaringly wrong with the code like the last version,
> so I've only got a couple of general questions:
>
> 1. Is the platform device and driver necessary? Can't you just
> register the watchdog device directly from sun4v_wdt_init_module()?
>
> 2. If the platform device is unnecessary, do you still need a struct
> watchdog_device in struct sun4v_wdt? I.e. does the watchdog core stop
> watchdogs when you call watchdog_unregister_device()? (Or could you
> refactor to not require it?)
>
> 3. Is it possible to get the data for sun4v_wdt_get_timeleft() by
> calling some other sun4v_mach_*() function?
>
> 4. You still don't use the result returned through the second
> parameter of sun4v_mach_set_watchdog(). Does this number have any
> meaning and would it make sense to store it in ->expires instead of
> calculating it from the timeout?
>
actually one thing we could do:
we could change the sun4v_mach_set_watchdog hv call like below (thanks
Greg Onufer for this tweak)
diff --git a/arch/sparc/kernel/hvcalls.S b/arch/sparc/kernel/hvcalls.S
index caedf83..b7122a2 100644
--- a/arch/sparc/kernel/hvcalls.S
+++ b/arch/sparc/kernel/hvcalls.S
@@ -338,8 +338,9 @@ ENTRY(sun4v_mach_set_watchdog)
mov %o1, %o4
mov HV_FAST_MACH_SET_WATCHDOG, %o5
ta HV_FAST_TRAP
- stx %o1, [%o4]
- retl
+ brnz,a,pn %o4, 0f
+ stx %o1, [%o4]
+0: retl
nop
ENDPROC(sun4v_mach_set_watchdog)
and then do sun4v_mach_set_watchdog(timeout, NULL) instead.
I'd be fine with that if that's preferred.
Dave?
next prev parent reply other threads:[~2016-01-20 23:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 23:10 [PATCH] watchdog: add sun4v_wdt device support wim.coekaerts
2016-01-13 0:06 ` Julian Calaby
2016-01-13 1:12 ` Guenter Roeck
2016-01-14 16:27 ` Wim Coekaerts
2016-01-15 20:21 ` David Miller
2016-01-20 20:30 ` wim.coekaerts
2016-01-20 22:43 ` Julian Calaby
2016-01-20 23:19 ` Wim Coekaerts
2016-01-20 23:40 ` Julian Calaby
2016-01-20 23:45 ` Guenter Roeck
2016-01-21 1:35 ` Wim Coekaerts
2016-01-21 2:23 ` Julian Calaby
2016-01-21 2:36 ` Wim Coekaerts
2016-01-21 2:41 ` Julian Calaby
2016-01-20 23:37 ` Wim Coekaerts [this message]
2016-01-21 16:34 ` Guenter Roeck
2016-01-22 19:06 ` Wim Coekaerts
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=56A01A2C.3020805@oracle.com \
--to=wim.coekaerts@oracle.com \
--cc=davem@davemloft.net \
--cc=julian.calaby@gmail.com \
--cc=linux-watchdog@vger.kernel.org \
--cc=sparclinux@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