linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Clement LE GOFFIC <clement.legoffic@foss.st.com>
To: Marek Vasut <marex@denx.de>, <linux-watchdog@vger.kernel.org>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH v4] watchdog: stm32_iwdg: Add pretimeout support
Date: Wed, 11 Dec 2024 10:02:17 +0100	[thread overview]
Message-ID: <49ccec07-4d4c-4582-814b-d4a60adbbfe1@foss.st.com> (raw)
In-Reply-To: <20240415134903.8084-1-marex@denx.de>

On 4/15/24 15:48, Marek Vasut wrote:
> The STM32MP15xx IWDG adds registers which permit this IP to generate
> pretimeout interrupt. This interrupt can also be used to wake the CPU
> from suspend. Implement support for generating this interrupt and let
> userspace configure the pretimeout. In case the pretimeout is not
> configured by user, set pretimeout to 3/4 of the WDT timeout cycle.
> 
> Reviewed-by: Clément Le Goffic <clement.legoffic@foss.st.com>
> Tested-by: Clément Le Goffic <clement.legoffic@foss.st.com>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-stm32@st-md-mailman.stormreply.com
> Cc: linux-watchdog@vger.kernel.org
> ---
> V2: - Subtract the pretimeout value from timeout value before writing it
>        into the IWDG pretimeout register, because the watchdog counter
>        register is counting down, and the pretimeout interrupt triggers
>        when watchdog counter register matches the pretimeout register
>        content.
>      - Set default pretimeout to 3/4 of timeout .
> V3: - Use dev instead of pdev->dev
>      - Swap order of ret/return 0
>      - Split this from the DT changes, which are orthogonal
>      - Uh, this patch got stuck in upstreaming queue, sorry
> V4: - Update commit message to match V2 default pretimeout to 3/4
>      - Add RB/TB from Clément
> ---
>   drivers/watchdog/stm32_iwdg.c | 95 ++++++++++++++++++++++++++++++++++-
>   1 file changed, 94 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
> index 5404e03876202..d700e0d49bb95 100644
> --- a/drivers/watchdog/stm32_iwdg.c
> +++ b/drivers/watchdog/stm32_iwdg.c
>  
>  [.....]
>  
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq <= 0)
> +		return 0;

Hi Marek,

After re-evaluating this patch, it seems it lacks of a dt-bindings 
update that tackles the 'interrupts' property you are adding.

That said, the interrupt line should not be mandatory for the driver to 
probe. For backward compatibility with existing DT, I recommend to use 
the 'platform_get_irq_optional()' API to not fail during the probe of 
the driver.

Best regards,

Clément


  parent reply	other threads:[~2024-12-11  9:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 13:48 [PATCH v4] watchdog: stm32_iwdg: Add pretimeout support Marek Vasut
2024-06-23 18:18 ` Marek Vasut
2024-09-05 13:12   ` Marek Vasut
2024-09-24 10:04     ` Marek Vasut
2024-09-30 18:23 ` Guenter Roeck
2024-09-30 18:28   ` Marek Vasut
2024-12-11  9:02 ` Clement LE GOFFIC [this message]
2024-12-11 18:31   ` Marek Vasut

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=49ccec07-4d4c-4582-814b-d4a60adbbfe1@foss.st.com \
    --to=clement.legoffic@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=marex@denx.de \
    --cc=mcoquelin.stm32@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).