All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
@ 2019-04-14 11:09 Wolfram Sang
  2019-04-14 14:52 ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Wolfram Sang @ 2019-04-14 11:09 UTC (permalink / raw)
  To: linux-watchdog; +Cc: linux-renesas-soc, Support Opensource, Wolfram Sang

And make sure the final obtained value gets properly scaled. Remove two
empty lines to group the initialization blocks while we are here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Tested with a Renesas Lager board (R-Car H2, DA9063AD), checking the initial
timeout value via sysfs. I didn't test handover from bootloader because my
bootloader neither supports WDT or I2C out of the box.

 drivers/watchdog/da9063_wdt.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c
index 06eb9070203c..3d65e92a4e3f 100644
--- a/drivers/watchdog/da9063_wdt.c
+++ b/drivers/watchdog/da9063_wdt.c
@@ -208,18 +208,20 @@ static int da9063_wdt_probe(struct platform_device *pdev)
 	wdd->min_timeout = DA9063_WDT_MIN_TIMEOUT;
 	wdd->max_timeout = DA9063_WDT_MAX_TIMEOUT;
 	wdd->min_hw_heartbeat_ms = DA9063_RESET_PROTECTION_MS;
-	wdd->timeout = DA9063_WDG_TIMEOUT;
 	wdd->parent = dev;
-
 	wdd->status = WATCHDOG_NOWAYOUT_INIT_STATUS;
 
 	watchdog_set_restart_priority(wdd, 128);
-
 	watchdog_set_drvdata(wdd, da9063);
 
+	/* Set default timeout, maybe override it with DT value, scale it */
+	wdd->timeout = DA9063_WDG_TIMEOUT;
+	watchdog_init_timeout(wdd, 0, dev);
+	da9063_wdt_set_timeout(wdd, wdd->timeout);
+
 	/* Change the timeout to the default value if the watchdog is running */
 	if (da9063_wdt_is_running(da9063)) {
-		da9063_wdt_update_timeout(da9063, DA9063_WDG_TIMEOUT);
+		da9063_wdt_update_timeout(da9063, wdd->timeout);
 		set_bit(WDOG_HW_RUNNING, &wdd->status);
 	}
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-14 11:09 [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too Wolfram Sang
@ 2019-04-14 14:52 ` Guenter Roeck
  2019-04-15  8:11 ` Steve Twiss
  2019-04-16 10:21 ` Steve Twiss
  2 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2019-04-14 14:52 UTC (permalink / raw)
  To: Wolfram Sang, linux-watchdog; +Cc: linux-renesas-soc, Support Opensource

On 4/14/19 4:09 AM, Wolfram Sang wrote:
> And make sure the final obtained value gets properly scaled. Remove two
> empty lines to group the initialization blocks while we are here.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Tested with a Renesas Lager board (R-Car H2, DA9063AD), checking the initial
> timeout value via sysfs. I didn't test handover from bootloader because my
> bootloader neither supports WDT or I2C out of the box.
> 
>   drivers/watchdog/da9063_wdt.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c
> index 06eb9070203c..3d65e92a4e3f 100644
> --- a/drivers/watchdog/da9063_wdt.c
> +++ b/drivers/watchdog/da9063_wdt.c
> @@ -208,18 +208,20 @@ static int da9063_wdt_probe(struct platform_device *pdev)
>   	wdd->min_timeout = DA9063_WDT_MIN_TIMEOUT;
>   	wdd->max_timeout = DA9063_WDT_MAX_TIMEOUT;
>   	wdd->min_hw_heartbeat_ms = DA9063_RESET_PROTECTION_MS;
> -	wdd->timeout = DA9063_WDG_TIMEOUT;
>   	wdd->parent = dev;
> -
>   	wdd->status = WATCHDOG_NOWAYOUT_INIT_STATUS;
>   
>   	watchdog_set_restart_priority(wdd, 128);
> -
>   	watchdog_set_drvdata(wdd, da9063);
>   
> +	/* Set default timeout, maybe override it with DT value, scale it */
> +	wdd->timeout = DA9063_WDG_TIMEOUT;
> +	watchdog_init_timeout(wdd, 0, dev);
> +	da9063_wdt_set_timeout(wdd, wdd->timeout);
> +
>   	/* Change the timeout to the default value if the watchdog is running */
>   	if (da9063_wdt_is_running(da9063)) {
> -		da9063_wdt_update_timeout(da9063, DA9063_WDG_TIMEOUT);
> +		da9063_wdt_update_timeout(da9063, wdd->timeout);
>   		set_bit(WDOG_HW_RUNNING, &wdd->status);
>   	}
>   
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-14 11:09 [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too Wolfram Sang
  2019-04-14 14:52 ` Guenter Roeck
@ 2019-04-15  8:11 ` Steve Twiss
  2019-04-15  9:28   ` Wolfram Sang
  2019-04-16 10:21 ` Steve Twiss
  2 siblings, 1 reply; 10+ messages in thread
From: Steve Twiss @ 2019-04-15  8:11 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: LINUX RENESAS SOC, LKML, Support Opensource

Hi Wolfram,

On 14 April 2019 12:10, Wolfram Sang wrote:

> Tested with a Renesas Lager board (R-Car H2, DA9063AD), checking the initial
> timeout value via sysfs. I didn't test handover from bootloader because my
> bootloader neither supports WDT or I2C out of the box.

Can I please check there is no mistake in your description. I have been repeatedly
told by the hardware engineers here, (for the past 6 years) it is not possible.
But, you seem to have an R-Car H2 with the AD silicon version of DA9063?

Regards,
Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-15  8:11 ` Steve Twiss
@ 2019-04-15  9:28   ` Wolfram Sang
  2019-04-15 10:09     ` Steve Twiss
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2019-04-15  9:28 UTC (permalink / raw)
  To: Steve Twiss; +Cc: Wolfram Sang, LINUX RENESAS SOC, LKML, Support Opensource

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

On Mon, Apr 15, 2019 at 08:11:16AM +0000, Steve Twiss wrote:
> Hi Wolfram,
> 
> On 14 April 2019 12:10, Wolfram Sang wrote:
> 
> > Tested with a Renesas Lager board (R-Car H2, DA9063AD), checking the initial
> > timeout value via sysfs. I didn't test handover from bootloader because my
> > bootloader neither supports WDT or I2C out of the box.
> 
> Can I please check there is no mistake in your description. I have been repeatedly
> told by the hardware engineers here, (for the past 6 years) it is not possible.
> But, you seem to have an R-Car H2 with the AD silicon version of DA9063?

I am confused, what is not possible? That I have an AD version? Yes, we
found that out when we worked on the RTC recently. It is an early
version of the Lager development board. I have no numbers but my
assumption is there are not too many out there.


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-15  9:28   ` Wolfram Sang
@ 2019-04-15 10:09     ` Steve Twiss
  2019-04-15 11:04       ` Wolfram Sang
  2019-04-24  9:32       ` Geert Uytterhoeven
  0 siblings, 2 replies; 10+ messages in thread
From: Steve Twiss @ 2019-04-15 10:09 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Wolfram Sang, LINUX RENESAS SOC, LKML, Support Opensource

Hi Wolfram,

No problem.

On 15 April 2019 10:29, Wolfram Sang wrote:

> Subject: Re: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
> 
> On Mon, Apr 15, 2019 at 08:11:16AM +0000, Steve Twiss wrote:
> > Hi Wolfram,
> >
> > On 14 April 2019 12:10, Wolfram Sang wrote:
> >
> > > Tested with a Renesas Lager board (R-Car H2, DA9063AD)
> >
> > Can I please check there is no mistake in your description. I have been repeatedly
> > told by the hardware engineers here, (for the past 6 years) it is not possible.
> > But, you seem to have an R-Car H2 with the AD silicon version of DA9063?
> 
> I am confused, what is not possible? That I have an AD version? Yes, we
> found that out when we worked on the RTC recently. 

Sure, I know, people have been requesting continued support for DA9063 AD silicon
for years. The original DA9063 Linux driver was sent to LKML with AD support.

> It is an early version of the Lager development board. I have no numbers
> but my assumption is there are not too many out there.

Thanks, yes, there is interest from the hardware engineers here. Thanks for the
confirmation about your board. I will inform them about the DA9063 AD silicon on
the Renesas Lager board -- and I will let you know their response.

Regards,
Steve



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-15 10:09     ` Steve Twiss
@ 2019-04-15 11:04       ` Wolfram Sang
  2019-04-15 12:05         ` Steve Twiss
  2019-04-24  9:32       ` Geert Uytterhoeven
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2019-04-15 11:04 UTC (permalink / raw)
  To: Steve Twiss; +Cc: Wolfram Sang, LINUX RENESAS SOC, LKML, Support Opensource

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


> > I am confused, what is not possible? That I have an AD version? Yes, we
> > found that out when we worked on the RTC recently. 
> 
> Sure, I know, people have been requesting continued support for DA9063 AD silicon
> for years. The original DA9063 Linux driver was sent to LKML with AD support.

I see. Well, unlike the RTC patches recently, this watchdog patch is
independent of the variant AFAICS, or?


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-15 11:04       ` Wolfram Sang
@ 2019-04-15 12:05         ` Steve Twiss
  0 siblings, 0 replies; 10+ messages in thread
From: Steve Twiss @ 2019-04-15 12:05 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Wolfram Sang, LINUX RENESAS SOC, LKML, Support Opensource

On 15 April 2019 12:04, Wolfram Sang wrote:

> > Sure, I know, people have been requesting continued support for DA9063 AD silicon
> > for years. The original DA9063 Linux driver was sent to LKML with AD support.
> 
> I see. Well, unlike the RTC patches recently, this watchdog patch is
> independent of the variant AFAICS, or?

Agreed!

I am going to test your watchdog changes with a later silicon version later today
and I expect no problems.

Regards,
Steve


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-14 11:09 [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too Wolfram Sang
  2019-04-14 14:52 ` Guenter Roeck
  2019-04-15  8:11 ` Steve Twiss
@ 2019-04-16 10:21 ` Steve Twiss
  2 siblings, 0 replies; 10+ messages in thread
From: Steve Twiss @ 2019-04-16 10:21 UTC (permalink / raw)
  To: Wolfram Sang, linux-watchdog; +Cc: linux-renesas-soc, Support Opensource, LKML

On 14 April 2019 12:10, Wolfram Sang wrote:

> Subject: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
> 
> And make sure the final obtained value gets properly scaled. Remove two
> empty lines to group the initialization blocks while we are here.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> Tested with a Renesas Lager board (R-Car H2, DA9063AD), checking the initial
> timeout value via sysfs. I didn't test handover from bootloader because my
> bootloader neither supports WDT or I2C out of the box.

Tested on git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
* watchdog-next                 6829e6ef3f22 [origin/watchdog-next] watchdog: pnx4008: readout watchdog state

Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>

Regards,
Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-15 10:09     ` Steve Twiss
  2019-04-15 11:04       ` Wolfram Sang
@ 2019-04-24  9:32       ` Geert Uytterhoeven
  2019-04-24 10:36         ` Steve Twiss
  1 sibling, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2019-04-24  9:32 UTC (permalink / raw)
  To: Steve Twiss, Marek Vasut
  Cc: Wolfram Sang, Wolfram Sang, LINUX RENESAS SOC, LKML, Support Opensource

Hi Steve,

On Mon, Apr 15, 2019 at 12:10 PM Steve Twiss
<stwiss.opensource@diasemi.com> wrote:
> On 15 April 2019 10:29, Wolfram Sang wrote:
> > Subject: Re: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
> > On Mon, Apr 15, 2019 at 08:11:16AM +0000, Steve Twiss wrote:
> > > On 14 April 2019 12:10, Wolfram Sang wrote:
> > >
> > > > Tested with a Renesas Lager board (R-Car H2, DA9063AD)
> > >
> > > Can I please check there is no mistake in your description. I have been repeatedly
> > > told by the hardware engineers here, (for the past 6 years) it is not possible.
> > > But, you seem to have an R-Car H2 with the AD silicon version of DA9063?
> >
> > I am confused, what is not possible? That I have an AD version? Yes, we
> > found that out when we worked on the RTC recently.
>
> Sure, I know, people have been requesting continued support for DA9063 AD silicon
> for years. The original DA9063 Linux driver was sent to LKML with AD support.
>
> > It is an early version of the Lager development board. I have no numbers
> > but my assumption is there are not too many out there.
>
> Thanks, yes, there is interest from the hardware engineers here. Thanks for the
> confirmation about your board. I will inform them about the DA9063 AD silicon on
> the Renesas Lager board -- and I will let you know their response.

For the record, I see the following DA9063 variants on the Renesas boards I have
access to:
  - DA9063 AD: Lager (R-Car H2), Koelsch (R-Car M2-W),
  - DA9063 BB: Gose (R-Car M2-N), Blanche (R-Car V2H), Alt (R-Car E2).

I cannot check Porter (R-Car M2-W) and Silk (R-Car E2) right now, but
from Marek's report, Porter has DA9063L CA.

Marek: which variant does your Stout (R-Car H2) have?

Thanks!

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
  2019-04-24  9:32       ` Geert Uytterhoeven
@ 2019-04-24 10:36         ` Steve Twiss
  0 siblings, 0 replies; 10+ messages in thread
From: Steve Twiss @ 2019-04-24 10:36 UTC (permalink / raw)
  To: Geert Uytterhoeven, Marek Vasut, Wolfram Sang
  Cc: Wolfram Sang, LINUX RENESAS SOC, LKML, Support Opensource

Hi Geert,

Thanks.

On 24 April 2019 10:32, Geert Uytterhoeven wrote:

> Subject: Re: [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too
> 
> Hi Steve,
> 
> On Mon, Apr 15, 2019 at 12:10 PM Steve Twiss wrote:
> > On 15 April 2019 10:29, Wolfram Sang wrote:
> > > On Mon, Apr 15, 2019 at 08:11:16AM +0000, Steve Twiss wrote:
> > > > On 14 April 2019 12:10, Wolfram Sang wrote:
> > > >
> > > > > Tested with a Renesas Lager board (R-Car H2, DA9063AD)
> > > >
> > > It is an early version of the Lager development board. I have no numbers
> > > but my assumption is there are not too many out there.
> >
> > Thanks, yes, there is interest from the hardware engineers here. Thanks for the
> > confirmation about your board. I will inform them about the DA9063 AD silicon on
> > the Renesas Lager board -- and I will let you know their response.
> 
> For the record, I see the following DA9063 variants on the Renesas boards I have
> access to:
>   - DA9063 AD: Lager (R-Car H2), Koelsch (R-Car M2-W),
>   - DA9063 BB: Gose (R-Car M2-N), Blanche (R-Car V2H), Alt (R-Car E2).
> 
> I cannot check Porter (R-Car M2-W) and Silk (R-Car E2) right now, but
> from Marek's report, Porter has DA9063L CA.
> 
> Marek: which variant does your Stout (R-Car H2) have?

Thanks for the hardware details. I re-iterated the info from Wolfram's last e-mail to the
hardware engineers during this morning's meeting. It can also be looked up on LKML if
needed. I will pass on the details you have sent, next.

To be clear -- I am treating these informal conversations on LKML as a data collection
exercise and for them to be used as information-only. But, I pushed-back again and asked for
any discussions to go through more formal channels and not to require me as a go-between,
or to include the involvement of individuals like yourselves, or to use the LKML channel.

This is not patch related and I don't want to request any more of anybody's time.

Regards,
Steve


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-24 10:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 11:09 [PATCH RFT] watchdog: da9063_wdt: parse DT for timeout value, too Wolfram Sang
2019-04-14 14:52 ` Guenter Roeck
2019-04-15  8:11 ` Steve Twiss
2019-04-15  9:28   ` Wolfram Sang
2019-04-15 10:09     ` Steve Twiss
2019-04-15 11:04       ` Wolfram Sang
2019-04-15 12:05         ` Steve Twiss
2019-04-24  9:32       ` Geert Uytterhoeven
2019-04-24 10:36         ` Steve Twiss
2019-04-16 10:21 ` Steve Twiss

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.