mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Artem Shimko <a.shimko.dev@gmail.com>
Cc: wim@linux-watchdog.org, linux@roeck-us.net,
	p.zabel@pengutronix.de, Sergey.Semin@baikalelectronics.ru,
	mika.westerberg@linux.intel.com, andi.shyti@kernel.org,
	iav@iav.lv, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] watchdog: dw_wdt: manage reset line during system suspend/resume
Date: Fri, 23 Oct 2026 03:05:50 +0000	[thread overview]
Message-ID: <atrPDqHCt5Y3OE8u@google.com> (raw)
In-Reply-To: <20261022134354.534642-3-a.shimko.dev@gmail.com>

On Thu, Oct 22, 2026 at 04:43:50PM +0300, Artem Shimko wrote:
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index 2cffe337b4ea..ec6a09673da4 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -382,6 +382,8 @@ static int dw_wdt_suspend(struct device *dev)
>  	dw_wdt->control = readl(dw_wdt->regs + WDOG_CONTROL_REG_OFFSET);
>  	dw_wdt->timeout = readl(dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>  
> +	reset_control_assert(dw_wdt->rst);
> +

Doesn't it need to check the return value and propagate the error just
like what dw_wdt_resume() does in the patch?

> @@ -402,12 +404,22 @@ static int dw_wdt_resume(struct device *dev)
>  		return err;
>  	}
>  
> +	err = reset_control_deassert(dw_wdt->rst);
> +	if (err)
> +		goto unprepare_pclk;
> +
>  	writel(dw_wdt->timeout, dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
>  	writel(dw_wdt->control, dw_wdt->regs + WDOG_CONTROL_REG_OFFSET);
>  
>  	dw_wdt_ping(&dw_wdt->wdd);
>  
>  	return 0;
> +
> +unprepare_pclk:
> +	clk_disable_unprepare(dw_wdt->pclk);
> +	clk_disable_unprepare(dw_wdt->clk);
> +
> +	return err;

There is only one user of `unprepare_pclk`.  Two options:
A) Drop the goto label and inline the cleanup within `if (err) ...`.
B) Refactor error handling for clk_prepare_enable() to use stacked goto
   labels.

I just realized [PATCH v2 3/3] actually does option B.  Please consider
squashing patch 3/3 into this patch.

  reply	other threads:[~2026-10-23  3:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 13:43 [PATCH v2 0/3] watchdog: dw_wdt: fix reset line management Artem Shimko
2026-10-22 13:43 ` [PATCH v2 1/3] watchdog: dw_wdt: use devm_reset_control_get_optional_shared_deasserted Artem Shimko
2026-10-23  3:05   ` Tzung-Bi Shih
2026-10-22 13:43 ` [PATCH v2 2/3] watchdog: dw_wdt: manage reset line during system suspend/resume Artem Shimko
2026-10-23  3:05   ` Tzung-Bi Shih [this message]
2026-10-22 13:43 ` [PATCH v2 3/3] watchdog: dw_wdt: clean up error paths in resume function Artem Shimko
2026-10-23  3:06   ` Tzung-Bi Shih
2026-10-22 21:15 ` [PATCH v2 0/3] watchdog: dw_wdt: fix reset line management Igor Velkov

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=atrPDqHCt5Y3OE8u@google.com \
    --to=tzungbi@kernel.org \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=a.shimko.dev@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=iav@iav.lv \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mika.westerberg@linux.intel.com \
    --cc=p.zabel@pengutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®