All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>,
	Jose Noguera <jnoguera@redhat.com>,
	wim@linux-watchdog.org, linux-watchdog@vger.kernel.org
Cc: Peter Robinson <perobins@redhat.com>
Subject: Re: [Watchdog drivers] - WDIOC_GETSUPPORT clarification
Date: Wed, 18 Aug 2021 16:49:28 +0200	[thread overview]
Message-ID: <0db70d23-d15c-e485-2600-439dc5d55d47@redhat.com> (raw)
In-Reply-To: <9866b7d2-1d43-db77-fa79-0be4bed51f5f@roeck-us.net>

Hi,

On 8/18/21 4:13 PM, Guenter Roeck wrote:
> On 8/18/21 2:57 AM, Jose Noguera wrote:
>> Hello all!
>>
>> I’m Jose, working in Red Hat on Fedora IoT and RHEL For Edge related projects.
>>
>> While trying to add the feature of figuring out whether the current boot was triggered or not by a hardware watchdog using wdctl, we’ve found an odd behaviour in the drivers definition that we would like to check with you.
>>
>> Looking specifically for the flag WDIOF_CARDRESET, we can find 40 files that contain it:
>>
>> $ grep -rl CARDRESET drivers/watchdog/ | wc -l
>> 40
>>
>> but only 19 of them have the flag advertised in the options field of the watchdog_info struct returned by the WDIOC_GETSUPPORT ioctl.
>>
>> This leads to wdctl not showing WDIOF_CARDRESET for drivers like i6300esb, even when the board had been reset this way:
>>
>> $ sudo wdctl
>> Device: /dev/watchdog0
>> Identity: i6300ESB timer [version 0]
>> Timeout: 30 seconds
>> Pre-timeout: 0 seconds
>>
>> FLAG DESCRIPTION STATUS BOOT-STATUS
>> KEEPALIVEPING Keep alive ping reply 1 0
>> MAGICCLOSE Supports magic close char 0 0
>> SETTIMEOUT Set timeout (in seconds) 0 0
>>
>> Working with Hans (in CC), we added a little patch (BugZilla ticket: 1993983) on wdctl and this would be the output of the command when it was a card reset triggered boot:
>>
>> $ sudo wdctl
>> Device: /dev/watchdog0
>> Identity: i6300ESB timer [version 0]
>> Thank you all for your time,
>>
>> Jose
> 
>> Timeout: 30 seconds
>> Pre-timeout: 0 seconds
>>
>> FLAG DESCRIPTION STATUS BOOT-STATUS
>> CARDRESET Card previously reset the CPU 1 1
>> KEEPALIVEPING Keep alive ping reply 1 0
>> MAGICCLOSE Supports magic close char 0 0
>> SETTIMEOUT Set timeout (in seconds) 0 0
>>
>> So our question is, may we know what is intended to be present in ident.options? What should the API call WDIOC_GETSUPPORT return in the options field?
>>
> 
> Search for WDIOC_GETSUPPORT in Documentation/watchdog/watchdog-api.rst.
> I don't see any ambiguity there. Patches welcome.

Ok, so drivers which may set CARDRESET in their GETBOOTSTATUS reply, but
don't advertise this in their GETSUPPORT watchdog_info.options reply
are buggy and should be fixed, got it. Thanks.

I've made a note about fixing this in a possible-kernel-projects document
which I keep for when people who are interested in kernel development
ask me for projects.

Regards,

Hans


  reply	other threads:[~2021-08-18 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKu6O181WOq36RCDO0VPcsZZoUFAJ88BMqv0Hqf+qYCeZsMJtQ@mail.gmail.com>
2021-08-18 12:53 ` [Watchdog drivers] - WDIOC_GETSUPPORT clarification Hans de Goede
2021-08-18 14:13 ` Guenter Roeck
2021-08-18 14:49   ` Hans de Goede [this message]
2021-08-18 14:53     ` Guenter Roeck
2021-09-01 11:15       ` Peter Robinson
2021-09-01 19:51         ` Guenter Roeck

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=0db70d23-d15c-e485-2600-439dc5d55d47@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=jnoguera@redhat.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=perobins@redhat.com \
    --cc=wim@linux-watchdog.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.