public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: shawnguo@kernel.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] watchdog: imx2_wdt: add external reset support via 'ext-reset-output' dt prop
Date: Fri, 3 Jul 2015 09:02:31 +0800	[thread overview]
Message-ID: <20150703010231.GA28488@tiger> (raw)
In-Reply-To: <CAJ+vNU3me-qBZT7h1e+54UNRJw-2SH=nofnTRM4GEn0j9jh3ig@mail.gmail.com>

On Thu, Jul 02, 2015 at 09:49:20AM -0700, Tim Harvey wrote:
> On Sun, Jun 28, 2015 at 6:17 PM, Shawn Guo <shawnguo@kernel.org> wrote:
> > On Thu, Jun 04, 2015 at 01:15:59PM -0700, Tim Harvey wrote:
> >> @@ -90,6 +92,11 @@ static int imx2_restart_handler(struct notifier_block *this, unsigned long mode,
> >>       struct imx2_wdt_device *wdev = container_of(this,
> >>                                                   struct imx2_wdt_device,
> >>                                                   restart_handler);
> >> +
> >> +     /* Use external reset */
> >> +     if (wdev->ext_reset)
> >> +             wcr_enable |= IMX2_WDT_WCR_SRS;
> >> +
> >
> > The existing code simply writes the register with only WDE (Watchdog
> > Enable) bit set.  That said, bit WDA and SRS are cleared at the same
> > time.  What's the result of that?  Both internal reset and external
> > reset will be asserted?  If this is the case, it's unsafe per your reply
> > to Frank's comment, right?  So we should only clear one bit between
> > these two based on ext_reset flag to avoid asserting both internal and
> > external reset?
> >
> > Shawn
> 
> Shawn,
> 
> Correct.
> 
> Are you saying that you think we should change the above to something
> like the following to ensure in the internal reset case external reset
> is not also being asserted?:

Yes, that's what I'm saying.

> 
> +     /* Use external reset */
> +     if (wdev->ext_reset)
> +             wcr_enable |= IMX2_WDT_WCR_SRS; /* do not assert
> internal system reset */
> +     else
> +             wcr_enable |= IMX2_WDT_WCR_WDA; /* do not assert external reset */
> 
> I was not worried about the else case above because if you hit that
> path your device-tree is saying you are not using external reset
> anyway.

It's a safeguard for platforms which have WDOG_B signal routed to some
hardware, while their device trees haven't specified ext_reset_output
property.

Shawn

  reply	other threads:[~2015-07-03  1:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 22:54 [PATCH 0/2] imx6: Implement external watchdog reset Tim Harvey
2015-05-28 22:54 ` [PATCH 1/2] watchdog: imx2_wdt: add external reset support via 'ext-reset' dt property Tim Harvey
2015-05-29 16:37   ` Lucas Stach
2015-05-28 22:54 ` [PATCH 2/2] ARM: dts: ventana: Add ext-reset support Tim Harvey
2015-05-29  6:17   ` Markus Pargmann
2015-05-29 14:01     ` Tim Harvey
2015-06-04 20:15 ` [PATCH v2 0/2] imx6: Implement external watchdog reset Tim Harvey
2015-06-04 20:15   ` [PATCH v2 1/2] watchdog: imx2_wdt: add external reset support via 'ext-reset-output' dt prop Tim Harvey
2015-06-05 16:38     ` Zhi Li
2015-06-25 23:22       ` Tim Harvey
2015-06-22  9:22     ` Lucas Stach
2015-06-28 15:07     ` Shawn Guo
2015-06-29  1:17     ` Shawn Guo
2015-07-02 16:49       ` Tim Harvey
2015-07-03  1:02         ` Shawn Guo [this message]
2015-07-28 15:27     ` [PATCH v3 0/2] imx6: Implement external watchdog reset Tim Harvey
2015-07-28 15:27       ` [PATCH v3 1/2] watchdog: imx2_wdt: add external reset support via 'ext-reset-output' dt prop Tim Harvey
2015-08-05 13:01         ` Shawn Guo
2015-10-13 14:11         ` Tim Harvey
2015-07-28 15:27       ` [PATCH v3 2/2] ARM: dts: ventana: Add ext-reset support Tim Harvey
2015-10-30 17:00       ` [PATCH v3 0/2] imx6: Implement external watchdog reset Akshay Bhat
2015-10-30 17:31         ` Tim Harvey
2015-06-04 20:16   ` [PATCH v2 2/2] ARM: dts: ventana: Add ext-reset support Tim Harvey

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=20150703010231.GA28488@tiger \
    --to=shawnguo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox