All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2, 1/2] driver: watchdog: reset watchdog in designware_wdt_stop() function
Date: Tue, 27 Apr 2021 10:49:46 -0400	[thread overview]
Message-ID: <40059839-66a0-9dc8-5787-94a790df3025@seco.com> (raw)
In-Reply-To: <613c442f-1843-d545-35f9-0493e6f68c95@denx.de>



On 4/27/21 10:23 AM, Stefan Roese wrote:
 > On 27.04.21 10:41, Meng.Li at windriver.com wrote:
 >> From: MengLi <meng.li@windriver.com>
 >>
 >> In uboot command line environment, watchdog is not able to be
 >> stopped with below commands:
 >> SOCFPGA_STRATIX10 # wdt dev watchdog at ffd00200
 >> SOCFPGA_STRATIX10 # wdt stop
 >> Refer to watchdog driver in linux kernel, it is also need to reset
 >> watchdog after disable it so that the disable action takes effect.
 >>
 >> v2:
 >> Change "#if CONFIG_IS_ENABLED(DM_RESET)" into
 >> "if (CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable
 >> into if condition sentence.
 >
 > A few comments:
 >
 > This version changelog belongs below the "---" line.
 >
 > Please Cc interested people upon new versions, e.g. myself as I reviewed
 > this patch.
 >
 > Other that this:
 >
 > Reviewed-by: Stefan Roese <sr@denx.de>
 >
 > Thanks,
 > Stefan
 >
 >> Signed-off-by: Meng Li <Meng.Li@windriver.com>
 >> ---
 >>   drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++
 >>   1 file changed, 17 insertions(+)
 >>
 >> diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
 >> index 12f09a7a39..57cad1effc 100644
 >> --- a/drivers/watchdog/designware_wdt.c
 >> +++ b/drivers/watchdog/designware_wdt.c
 >> @@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice *dev)
 >>       designware_wdt_reset(dev);
 >>       writel(0, priv->base + DW_WDT_CR);
 >> +        if (CONFIG_IS_ENABLED(DM_RESET)) {
 >> +        struct reset_ctl_bulk resets;
 >> +        int ret;
 >> +
 >> +        ret = reset_get_bulk(dev, &resets);

Have you considered adding the resets to designware_wdt_priv and saving
them when we request them in probe()?

--Sean

 >> +        if (ret)
 >> +            return ret;
 >> +
 >> +        ret = reset_assert_bulk(&resets);
 >> +        if (ret)
 >> +            return ret;
 >> +
 >> +        ret = reset_deassert_bulk(&resets);
 >> +        if (ret)
 >> +            return ret;
 >> +    }
 >> +
 >>       return 0;
 >>   }
 >>
 >
 >
 > Viele Gr??e,
 > Stefan
 >

  reply	other threads:[~2021-04-27 14:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  8:41 [PATCH v2, 1/2] driver: watchdog: reset watchdog in designware_wdt_stop() function Meng.Li at windriver.com
2021-04-27  8:41 ` [PATCH v2,2/2] driver: watchdog: enable wdt command by default Meng.Li at windriver.com
2021-04-27 14:23 ` [PATCH v2, 1/2] driver: watchdog: reset watchdog in designware_wdt_stop() function Stefan Roese
2021-04-27 14:49   ` Sean Anderson [this message]
2021-04-28  2:12     ` Li, Meng
2021-04-28  5:19       ` Stefan Roese
2021-04-28  2:15   ` Li, Meng
2021-04-28  4:51     ` Stefan Roese

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=40059839-66a0-9dc8-5787-94a790df3025@seco.com \
    --to=sean.anderson@seco.com \
    --cc=u-boot@lists.denx.de \
    /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.