Linux-RTC Archive on lore.kernel.org
 help / color / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Bruno Thomsen <bruno.thomsen@gmail.com>,
	linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org,
	a.zummo@towertech.it, wim@linux-watchdog.org, linux@roeck-us.net,
	bth@kamstrup.com
Subject: Re: [PATCH v3 4/5] rtc: pcf2127: add watchdog feature support
Date: Fri, 17 Jul 2020 08:21:07 +0200
Message-ID: <20200717062107.mpanwzpn52kdk7ut@pengutronix.de> (raw)
In-Reply-To: <20200716181816.GF3428@piout.net>


[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]

Hi Alexandre,

On Thu, Jul 16, 2020 at 08:18:16PM +0200, Alexandre Belloni wrote:
> On 16/07/2020 16:47:05+0200, Uwe Kleine-König wrote:
> > On Thu, Aug 22, 2019 at 03:19:35PM +0200, Bruno Thomsen wrote:
> > > Add partial support for the watchdog functionality of
> > > both PCF2127 and PCF2129 chips.
> > 
> > I have a board here with a pcf2127 that has the #RST pin
> > not connected.
> > 
> > The problem this creates is: The bootloader arms the SoC's watchdog and
> > jumps into Linux. The pcf2127 driver happens to load first, so watchdog0
> > is provided by the RTC (but non-functional). Systemd is configured to
> > feed the watchdog, but happens to feed the wrong one, so the machine
> > resets shortly after it is up :-|
> > 
> > So I wonder if we need a dt property that tells the driver if the RST
> > line is connected or not.
> 
> I guess the current solution is to set WatchdogDevice to point to a link
> that is updated by udev thus ensuring it points to the correct watchdog
> device regardless of the probe order.
> 
> This would be similar to the /dev/rtc symlink, pointing to the systohc
> RTC by default (even if I don't really like that heuristic).
> 
> What you suggest is somewhat okay but doesn't really solve the issue if
> both watchdogs are functional and systemd still doesn't pick the one
> that is armed by the bootloader.

Yes, my suggestion doesn't solve the problem "Oh, there are two
watchdogs, which should I feed?". But IMHO in this case there shouldn't
be a watchdog device provided at all by an RTC that can be a watchdog
but isn't wired up correctly.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 13:19 [PATCH v3 1/5] rtc: pcf2127: convert to devm_rtc_allocate_device Bruno Thomsen
2019-08-22 13:19 ` [PATCH v3 2/5] rtc: pcf2127: cleanup register and bit defines Bruno Thomsen
2019-08-22 21:27   ` Alexandre Belloni
2019-08-22 13:19 ` [PATCH v3 3/5] rtc: pcf2127: bugfix: read rtc disables watchdog Bruno Thomsen
2019-08-22 21:28   ` Alexandre Belloni
2019-08-22 13:19 ` [PATCH v3 4/5] rtc: pcf2127: add watchdog feature support Bruno Thomsen
2019-08-22 14:11   ` Guenter Roeck
2019-08-22 21:28   ` Alexandre Belloni
2020-07-16 14:47   ` Uwe Kleine-König
2020-07-16 18:18     ` Alexandre Belloni
2020-07-17  6:21       ` Uwe Kleine-König [this message]
2019-08-22 13:19 ` [PATCH v3 5/5] rtc: pcf2127: add tamper detection support Bruno Thomsen
2019-08-22 21:29   ` Alexandre Belloni
2019-08-22 21:26 ` [PATCH v3 1/5] rtc: pcf2127: convert to devm_rtc_allocate_device Alexandre Belloni

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=20200717062107.mpanwzpn52kdk7ut@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bruno.thomsen@gmail.com \
    --cc=bth@kamstrup.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org
	public-inbox-index linux-rtc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git