All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] OMAP watchdog timer reset on BBB
@ 2019-09-12 13:45 Sam Protsenko
  2019-09-12 14:02 ` Grygorii Strashko
  2019-09-12 14:37 ` Stefan Roese
  0 siblings, 2 replies; 12+ messages in thread
From: Sam Protsenko @ 2019-09-12 13:45 UTC (permalink / raw)
  To: u-boot

Hi Suniel,

After transition to DM WDT, watchdog timer on BeagleBone Black resets
the board after 1 minute or so. I'm using this defconfig: [1]. After
disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
reset. I guess it might be happening on other boards using
CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
U-Boot shell (=>) and waiting for 1 minute.

Do you know by chance why it might be happening, or maybe some fix
already exists?

Thanks!

[1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-12 13:45 [U-Boot] OMAP watchdog timer reset on BBB Sam Protsenko
@ 2019-09-12 14:02 ` Grygorii Strashko
  2019-09-12 14:37 ` Stefan Roese
  1 sibling, 0 replies; 12+ messages in thread
From: Grygorii Strashko @ 2019-09-12 14:02 UTC (permalink / raw)
  To: u-boot

CC: Lokesh

On 12/09/2019 16:45, Sam Protsenko wrote:
> Hi Suniel,
> 
> After transition to DM WDT, watchdog timer on BeagleBone Black resets
> the board after 1 minute or so. I'm using this defconfig: [1]. After
> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
> reset. I guess it might be happening on other boards using
> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
> U-Boot shell (=>) and waiting for 1 minute.
> 
> Do you know by chance why it might be happening, or maybe some fix
> already exists?
> 
> Thanks!
> 
> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
> 

-- 
Best regards,
grygorii

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-12 13:45 [U-Boot] OMAP watchdog timer reset on BBB Sam Protsenko
  2019-09-12 14:02 ` Grygorii Strashko
@ 2019-09-12 14:37 ` Stefan Roese
  2019-09-12 16:33   ` Sam Protsenko
  1 sibling, 1 reply; 12+ messages in thread
From: Stefan Roese @ 2019-09-12 14:37 UTC (permalink / raw)
  To: u-boot

Hi Sam,

On 12.09.19 15:45, Sam Protsenko wrote:
> Hi Suniel,
> 
> After transition to DM WDT, watchdog timer on BeagleBone Black resets
> the board after 1 minute or so. I'm using this defconfig: [1]. After
> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
> reset. I guess it might be happening on other boards using
> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
> U-Boot shell (=>) and waiting for 1 minute.
> 
> Do you know by chance why it might be happening, or maybe some fix
> already exists?
> 
> Thanks!
> 
> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/

So you have enabled the watchdog and should see something like this
upon bootup:

WDT:   Started without servicing (60s timeout)

Is this correct? Then you need to enable the U-Boot internal WDT
servicing by enabling CONFIG_WATCHDOG as well, as this will
result in the internal U-Boot servicing of the watchdog. Then
you should see this upon bootup and no reset will appear in
U-Boot:

WDT:   Started with servicing (60s timeout)

Does this help?

Thanks,
Stefan

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-12 14:37 ` Stefan Roese
@ 2019-09-12 16:33   ` Sam Protsenko
  2019-09-13  6:16     ` Suniel Mahesh
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sam Protsenko @ 2019-09-12 16:33 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
>
> Hi Sam,
>
> On 12.09.19 15:45, Sam Protsenko wrote:
> > Hi Suniel,
> >
> > After transition to DM WDT, watchdog timer on BeagleBone Black resets
> > the board after 1 minute or so. I'm using this defconfig: [1]. After
> > disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
> > reset. I guess it might be happening on other boards using
> > CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
> > U-Boot shell (=>) and waiting for 1 minute.
> >
> > Do you know by chance why it might be happening, or maybe some fix
> > already exists?
> >
> > Thanks!
> >
> > [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
>
> So you have enabled the watchdog and should see something like this
> upon bootup:
>
> WDT:   Started without servicing (60s timeout)
>
> Is this correct? Then you need to enable the U-Boot internal WDT
> servicing by enabling CONFIG_WATCHDOG as well, as this will
> result in the internal U-Boot servicing of the watchdog. Then
> you should see this upon bootup and no reset will appear in
> U-Boot:
>
> WDT:   Started with servicing (60s timeout)
>

I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
already enabled in am335x_evm_defconfig. So I think it's an issue,
which *probably* appeared when watchdog drivers were converted to
Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
options). Any clues what can be wrong?

> Does this help?
>
> Thanks,
> Stefan

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-12 16:33   ` Sam Protsenko
@ 2019-09-13  6:16     ` Suniel Mahesh
  2019-09-13 11:20     ` Stefan Roese
  2019-09-13 17:58     ` Grygorii Strashko
  2 siblings, 0 replies; 12+ messages in thread
From: Suniel Mahesh @ 2019-09-13  6:16 UTC (permalink / raw)
  To: u-boot

Hi Sam,

On 12/09/19 22:03, Sam Protsenko wrote:
> Hi Stefan,
> 
> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
>>
>> Hi Sam,
>>
>> On 12.09.19 15:45, Sam Protsenko wrote:
>>> Hi Suniel,
>>>
>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
>>> the board after 1 minute or so. I'm using this defconfig: [1]. After
>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
>>> reset. I guess it might be happening on other boards using
>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
>>> U-Boot shell (=>) and waiting for 1 minute.
>>>
>>> Do you know by chance why it might be happening, or maybe some fix
>>> already exists?
>>>
>>> Thanks!
>>>
>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
>>
>> So you have enabled the watchdog and should see something like this
>> upon bootup:
>>
>> WDT:   Started without servicing (60s timeout)
>>
>> Is this correct? Then you need to enable the U-Boot internal WDT
>> servicing by enabling CONFIG_WATCHDOG as well, as this will
>> result in the internal U-Boot servicing of the watchdog. Then
>> you should see this upon bootup and no reset will appear in
>> U-Boot:
>>
>> WDT:   Started with servicing (60s timeout)
>>
> 
> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
> already enabled in am335x_evm_defconfig. So I think it's an issue,
> which *probably* appeared when watchdog drivers were converted to
> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
> options).

No, I didn't see any target reset issues because of DM WDT.
It was well tested when it was converted to DM(both on hardware and travis). 
Yes the config uses both CONFIG_WDT + CONFIG_WDT_OMAP3.

Any clues what can be wrong?

compiled and ran latest u-boot (am335x_evm_defconfig) as it is on the target(BBB). 
Checked three boot modes MMC, SD and serial, didn't see any issues.
https://paste.ubuntu.com/p/tjcPhv4FMQ/ (sd card boot)
https://pastebin.ubuntu.com/p/X4tkp4ngMK/ (serial boot)

I am suspecting something else might be causing the issue.
Hope this helps

Thanks
Suniel
> 
>> Does this help?
>>
>> Thanks,
>> Stefan

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-12 16:33   ` Sam Protsenko
  2019-09-13  6:16     ` Suniel Mahesh
@ 2019-09-13 11:20     ` Stefan Roese
  2019-09-13 17:58     ` Grygorii Strashko
  2 siblings, 0 replies; 12+ messages in thread
From: Stefan Roese @ 2019-09-13 11:20 UTC (permalink / raw)
  To: u-boot

Hi Sam,

On 12.09.19 18:33, Sam Protsenko wrote:
> Hi Stefan,
> 
> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
>>
>> Hi Sam,
>>
>> On 12.09.19 15:45, Sam Protsenko wrote:
>>> Hi Suniel,
>>>
>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
>>> the board after 1 minute or so. I'm using this defconfig: [1]. After
>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
>>> reset. I guess it might be happening on other boards using
>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
>>> U-Boot shell (=>) and waiting for 1 minute.
>>>
>>> Do you know by chance why it might be happening, or maybe some fix
>>> already exists?
>>>
>>> Thanks!
>>>
>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
>>
>> So you have enabled the watchdog and should see something like this
>> upon bootup:
>>
>> WDT:   Started without servicing (60s timeout)
>>
>> Is this correct? Then you need to enable the U-Boot internal WDT
>> servicing by enabling CONFIG_WATCHDOG as well, as this will
>> result in the internal U-Boot servicing of the watchdog. Then
>> you should see this upon bootup and no reset will appear in
>> U-Boot:
>>
>> WDT:   Started with servicing (60s timeout)
>>
> 
> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
> already enabled in am335x_evm_defconfig. So I think it's an issue,
> which *probably* appeared when watchdog drivers were converted to
> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
> options). Any clues what can be wrong?

If the board has CONFIG_WATCHDOG enabled, then it should call the
reset function periodically (omap3_wdt_reset). Please check if
this function get called - I assume pretty often.

If it gets called and a WDT reset still does occur after the
timeout, then the reset function is incorrect and does not reset
the watchdog timer correctly.

HTH.

Thanks,
Stefan

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-12 16:33   ` Sam Protsenko
  2019-09-13  6:16     ` Suniel Mahesh
  2019-09-13 11:20     ` Stefan Roese
@ 2019-09-13 17:58     ` Grygorii Strashko
  2019-09-14  5:07       ` Suniel Mahesh
  2019-09-14  7:25       ` Sam Protsenko
  2 siblings, 2 replies; 12+ messages in thread
From: Grygorii Strashko @ 2019-09-13 17:58 UTC (permalink / raw)
  To: u-boot



On 12/09/2019 19:33, Sam Protsenko wrote:
> Hi Stefan,
> 
> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
>>
>> Hi Sam,
>>
>> On 12.09.19 15:45, Sam Protsenko wrote:
>>> Hi Suniel,
>>>
>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
>>> the board after 1 minute or so. I'm using this defconfig: [1]. After
>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
>>> reset. I guess it might be happening on other boards using
>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
>>> U-Boot shell (=>) and waiting for 1 minute.
>>>
>>> Do you know by chance why it might be happening, or maybe some fix
>>> already exists?
>>>
>>> Thanks!
>>>
>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
>>
>> So you have enabled the watchdog and should see something like this
>> upon bootup:
>>
>> WDT:   Started without servicing (60s timeout)
>>
>> Is this correct? Then you need to enable the U-Boot internal WDT
>> servicing by enabling CONFIG_WATCHDOG as well, as this will
>> result in the internal U-Boot servicing of the watchdog. Then
>> you should see this upon bootup and no reset will appear in
>> U-Boot:
>>
>> WDT:   Started with servicing (60s timeout)
>>
> 
> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
> already enabled in am335x_evm_defconfig. So I think it's an issue,
> which *probably* appeared when watchdog drivers were converted to
> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
> options). Any clues what can be wrong?
> 
>> Does this help?
It seems logic of hw_watchdog_reset() and omap3_wdt_reset() is different.
Pay attention at wdt_trgr_pattern.

It seems that
  	priv->wdt_trgr_pattern = 0x1234;
need to be moved in omap3_wdt_probe()
  

-- 
Best regards,
grygorii

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-13 17:58     ` Grygorii Strashko
@ 2019-09-14  5:07       ` Suniel Mahesh
  2019-09-14  7:25       ` Sam Protsenko
  1 sibling, 0 replies; 12+ messages in thread
From: Suniel Mahesh @ 2019-09-14  5:07 UTC (permalink / raw)
  To: u-boot

On 13/09/19 23:28, Grygorii Strashko wrote:
> 
> 
> On 12/09/2019 19:33, Sam Protsenko wrote:
>> Hi Stefan,
>>
>> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
>>>
>>> Hi Sam,
>>>
>>> On 12.09.19 15:45, Sam Protsenko wrote:
>>>> Hi Suniel,
>>>>
>>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
>>>> the board after 1 minute or so. I'm using this defconfig: [1]. After
>>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
>>>> reset. I guess it might be happening on other boards using
>>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
>>>> U-Boot shell (=>) and waiting for 1 minute.
>>>>
>>>> Do you know by chance why it might be happening, or maybe some fix
>>>> already exists?
>>>>
>>>> Thanks!
>>>>
>>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
>>>
>>> So you have enabled the watchdog and should see something like this
>>> upon bootup:
>>>
>>> WDT:   Started without servicing (60s timeout)
>>>
>>> Is this correct? Then you need to enable the U-Boot internal WDT
>>> servicing by enabling CONFIG_WATCHDOG as well, as this will
>>> result in the internal U-Boot servicing of the watchdog. Then
>>> you should see this upon bootup and no reset will appear in
>>> U-Boot:
>>>
>>> WDT:   Started with servicing (60s timeout)
>>>
>>
>> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
>> already enabled in am335x_evm_defconfig. So I think it's an issue,
>> which *probably* appeared when watchdog drivers were converted to
>> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
>> options). Any clues what can be wrong?
>>
>>> Does this help?
> It seems logic of hw_watchdog_reset() and omap3_wdt_reset() is different.
> Pay attention at wdt_trgr_pattern.

Didn't do anything different. It was just a replication of hw_watchdog_reset() logic into omap3_wdt_reset().

in hw_watchdog_reset: a global variable "wdt_trgr_pattern" is assigned a value and written into register
static unsigned int wdt_trgr_pattern = 0x1234;
wdt_trgr_pattern = ~wdt_trgr_pattern;
writel(wdt_trgr_pattern, &wdt->wdtwtgr);

in omap3_wdt_reset:  as per DM, all glob var's must be part of drivers private structure
so initialised priv->wdt_trgr_pattern = 0x1234; and then written into register
priv->wdt_trgr_pattern = ~(priv->wdt_trgr_pattern);
writel(priv->wdt_trgr_pattern, &priv->regs->wdtwtgr);

> 
> It seems that
>      priv->wdt_trgr_pattern = 0x1234;
> need to be moved in omap3_wdt_probe()

As per my understanding the above change will not make any difference, because its just initialization of the variable.
should be ready before its use.
>  
Please go through this pastebin link, at my end, omap3_wdt_reset() happens at regular intervals, where ever
it is triggered. (print messages are inserted in omap3_wdt_reset)
https://pastebin.ubuntu.com/p/WvS9PZb45p/

The target doesn't restart.

Thanks
Suniel

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-13 17:58     ` Grygorii Strashko
  2019-09-14  5:07       ` Suniel Mahesh
@ 2019-09-14  7:25       ` Sam Protsenko
  2019-09-16  7:05         ` Suniel Mahesh
  1 sibling, 1 reply; 12+ messages in thread
From: Sam Protsenko @ 2019-09-14  7:25 UTC (permalink / raw)
  To: u-boot

Hi Grygorii,

On Fri, Sep 13, 2019 at 8:58 PM Grygorii Strashko
<grygorii.strashko@ti.com> wrote:
>
>
>
> On 12/09/2019 19:33, Sam Protsenko wrote:
> > Hi Stefan,
> >
> > On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
> >>
> >> Hi Sam,
> >>
> >> On 12.09.19 15:45, Sam Protsenko wrote:
> >>> Hi Suniel,
> >>>
> >>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
> >>> the board after 1 minute or so. I'm using this defconfig: [1]. After
> >>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
> >>> reset. I guess it might be happening on other boards using
> >>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
> >>> U-Boot shell (=>) and waiting for 1 minute.
> >>>
> >>> Do you know by chance why it might be happening, or maybe some fix
> >>> already exists?
> >>>
> >>> Thanks!
> >>>
> >>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
> >>
> >> So you have enabled the watchdog and should see something like this
> >> upon bootup:
> >>
> >> WDT:   Started without servicing (60s timeout)
> >>
> >> Is this correct? Then you need to enable the U-Boot internal WDT
> >> servicing by enabling CONFIG_WATCHDOG as well, as this will
> >> result in the internal U-Boot servicing of the watchdog. Then
> >> you should see this upon bootup and no reset will appear in
> >> U-Boot:
> >>
> >> WDT:   Started with servicing (60s timeout)
> >>
> >
> > I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
> > already enabled in am335x_evm_defconfig. So I think it's an issue,
> > which *probably* appeared when watchdog drivers were converted to
> > Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
> > options). Any clues what can be wrong?
> >
> >> Does this help?
> It seems logic of hw_watchdog_reset() and omap3_wdt_reset() is different.
> Pay attention at wdt_trgr_pattern.
>
> It seems that
>         priv->wdt_trgr_pattern = 0x1234;
> need to be moved in omap3_wdt_probe()
>

Thanks a lot for the investigation. I'll check that once I have some spare time.

>
> --
> Best regards,
> grygorii

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-14  7:25       ` Sam Protsenko
@ 2019-09-16  7:05         ` Suniel Mahesh
  2019-09-16  8:43           ` Grygorii Strashko
  0 siblings, 1 reply; 12+ messages in thread
From: Suniel Mahesh @ 2019-09-16  7:05 UTC (permalink / raw)
  To: u-boot

Hi all,

On 14/09/19 12:55, Sam Protsenko wrote:
> Hi Grygorii,
> 
> On Fri, Sep 13, 2019 at 8:58 PM Grygorii Strashko
> <grygorii.strashko@ti.com> wrote:
>>
>>
>>
>> On 12/09/2019 19:33, Sam Protsenko wrote:
>>> Hi Stefan,
>>>
>>> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
>>>>
>>>> Hi Sam,
>>>>
>>>> On 12.09.19 15:45, Sam Protsenko wrote:
>>>>> Hi Suniel,
>>>>>
>>>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
>>>>> the board after 1 minute or so. I'm using this defconfig: [1]. After
>>>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
>>>>> reset. I guess it might be happening on other boards using
>>>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
>>>>> U-Boot shell (=>) and waiting for 1 minute.
>>>>>
>>>>> Do you know by chance why it might be happening, or maybe some fix
>>>>> already exists?
>>>>>
>>>>> Thanks!
>>>>>
>>>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
>>>>
>>>> So you have enabled the watchdog and should see something like this
>>>> upon bootup:
>>>>
>>>> WDT:   Started without servicing (60s timeout)
>>>>
>>>> Is this correct? Then you need to enable the U-Boot internal WDT
>>>> servicing by enabling CONFIG_WATCHDOG as well, as this will
>>>> result in the internal U-Boot servicing of the watchdog. Then
>>>> you should see this upon bootup and no reset will appear in
>>>> U-Boot:
>>>>
>>>> WDT:   Started with servicing (60s timeout)
>>>>
>>>
>>> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
>>> already enabled in am335x_evm_defconfig. So I think it's an issue,
>>> which *probably* appeared when watchdog drivers were converted to
>>> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
>>> options). Any clues what can be wrong?
>>>
>>>> Does this help?
>> It seems logic of hw_watchdog_reset() and omap3_wdt_reset() is different.
>> Pay attention at wdt_trgr_pattern.
>>
>> It seems that
>>         priv->wdt_trgr_pattern = 0x1234;
>> need to be moved in omap3_wdt_probe()
>>
> 
> Thanks a lot for the investigation. I'll check that once I have some spare time.

I have done some investigation and I am unable to conclude the behaviour(though the problem got fixed)
Here are my observations:

watchdog timer doesn't reset the board if booted via sd-card and serial.
https://paste.ubuntu.com/p/tjcPhv4FMQ/ (sd card boot)
https://pastebin.ubuntu.com/p/X4tkp4ngMK/ (serial boot)
https://pastebin.ubuntu.com/p/WvS9PZb45p/ (serial boot with print messages)

Sam was right. watchdog timer is resetting the board after conversion to DM, but only if we booted via emmc.
earlier for some reason I couldn't concentrate on emmc booting. "my bad".

analyzed the behaviour, the count is getting reset in the register when ever watchdog_reset is called but for some reason 
at around < 60s, the board gets reset (this shouldn't happen...!!). please go through the pastebin link:
https://pastebin.ubuntu.com/p/td6c4SQmnm/ (emmc boot)

As pointed by Grygorii, I just moved priv->wdt_trgr_pattern into probe and the problem disappears. didn't understand how that
change made a difference. Generally as per documentation all initializations are to be done in probe (but still). 
Why this is not happening on the other two bootmodes (sd-card and serial) ?
Can some body shed some light for this behaviour ?

The problem seems to be fixed, I will be patching u-boot in a while. Request Sam if possible to check/test/deploy the change on the 
board and acknowledge. (I have already tested the changeset and its fixed at my end)

Thanks
Suniel

> 
>>
>> --
>> Best regards,
>> grygorii

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-16  7:05         ` Suniel Mahesh
@ 2019-09-16  8:43           ` Grygorii Strashko
  2019-09-16 11:13             ` Sam Protsenko
  0 siblings, 1 reply; 12+ messages in thread
From: Grygorii Strashko @ 2019-09-16  8:43 UTC (permalink / raw)
  To: u-boot



On 16/09/2019 10:05, Suniel Mahesh wrote:
> Hi all,
> 
> On 14/09/19 12:55, Sam Protsenko wrote:
>> Hi Grygorii,
>>
>> On Fri, Sep 13, 2019 at 8:58 PM Grygorii Strashko
>> <grygorii.strashko@ti.com> wrote:
>>>
>>>
>>>
>>> On 12/09/2019 19:33, Sam Protsenko wrote:
>>>> Hi Stefan,
>>>>
>>>> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
>>>>>
>>>>> Hi Sam,
>>>>>
>>>>> On 12.09.19 15:45, Sam Protsenko wrote:
>>>>>> Hi Suniel,
>>>>>>
>>>>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
>>>>>> the board after 1 minute or so. I'm using this defconfig: [1]. After
>>>>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
>>>>>> reset. I guess it might be happening on other boards using
>>>>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
>>>>>> U-Boot shell (=>) and waiting for 1 minute.
>>>>>>
>>>>>> Do you know by chance why it might be happening, or maybe some fix
>>>>>> already exists?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
>>>>>
>>>>> So you have enabled the watchdog and should see something like this
>>>>> upon bootup:
>>>>>
>>>>> WDT:   Started without servicing (60s timeout)
>>>>>
>>>>> Is this correct? Then you need to enable the U-Boot internal WDT
>>>>> servicing by enabling CONFIG_WATCHDOG as well, as this will
>>>>> result in the internal U-Boot servicing of the watchdog. Then
>>>>> you should see this upon bootup and no reset will appear in
>>>>> U-Boot:
>>>>>
>>>>> WDT:   Started with servicing (60s timeout)
>>>>>
>>>>
>>>> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
>>>> already enabled in am335x_evm_defconfig. So I think it's an issue,
>>>> which *probably* appeared when watchdog drivers were converted to
>>>> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
>>>> options). Any clues what can be wrong?
>>>>
>>>>> Does this help?
>>> It seems logic of hw_watchdog_reset() and omap3_wdt_reset() is different.
>>> Pay attention at wdt_trgr_pattern.
>>>
>>> It seems that
>>>          priv->wdt_trgr_pattern = 0x1234;
>>> need to be moved in omap3_wdt_probe()
>>>
>>
>> Thanks a lot for the investigation. I'll check that once I have some spare time.
> 
> I have done some investigation and I am unable to conclude the behaviour(though the problem got fixed)
> Here are my observations:
> 
> watchdog timer doesn't reset the board if booted via sd-card and serial.
> https://paste.ubuntu.com/p/tjcPhv4FMQ/ (sd card boot)
> https://pastebin.ubuntu.com/p/X4tkp4ngMK/ (serial boot)
> https://pastebin.ubuntu.com/p/WvS9PZb45p/ (serial boot with print messages)
> 
> Sam was right. watchdog timer is resetting the board after conversion to DM, but only if we booted via emmc.
> earlier for some reason I couldn't concentrate on emmc booting. "my bad".
> 
> analyzed the behaviour, the count is getting reset in the register when ever watchdog_reset is called but for some reason
> at around < 60s, the board gets reset (this shouldn't happen...!!). please go through the pastebin link:
> https://pastebin.ubuntu.com/p/td6c4SQmnm/ (emmc boot)
> 
> As pointed by Grygorii, I just moved priv->wdt_trgr_pattern into probe and the problem disappears. didn't understand how that
> change made a difference. Generally as per documentation all initializations are to be done in probe (but still).
> Why this is not happening on the other two bootmodes (sd-card and serial) ?
> Can some body shed some light for this behaviour ?

It's kinda simple - non DM code defines wdt_trgr_pattern as static so it's initialized only once.
Your code initializes it on every reset, so violates TRM.

TRM says:
"The specific reload sequence is performed whenever the written value on the WDT_WTGR register differs
from its previous value. In this case, reload is executed in the same way as an overflow autoreload, but
without the generation of a reset pulse."

> 
> The problem seems to be fixed, I will be patching u-boot in a while. Request Sam if possible to check/test/deploy the change on the
> board and acknowledge. (I have already tested the changeset and its fixed at my end)

-- 
Best regards,
grygorii

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

* [U-Boot] OMAP watchdog timer reset on BBB
  2019-09-16  8:43           ` Grygorii Strashko
@ 2019-09-16 11:13             ` Sam Protsenko
  0 siblings, 0 replies; 12+ messages in thread
From: Sam Protsenko @ 2019-09-16 11:13 UTC (permalink / raw)
  To: u-boot

Hi Suniel, Grygorii,

Tested eMMC boot on BBB with this patch (suggested by Grygorii):

    [1] https://pastebin.ubuntu.com/p/pKhX6Jsjr9/

I can confirm that it works fine now, with patch applied, no reset occurs.

Guys, please send out the patch, you can use [1] as a boilerplate.

Thanks!

On Mon, Sep 16, 2019 at 11:43 AM Grygorii Strashko
<grygorii.strashko@ti.com> wrote:
>
>
>
> On 16/09/2019 10:05, Suniel Mahesh wrote:
> > Hi all,
> >
> > On 14/09/19 12:55, Sam Protsenko wrote:
> >> Hi Grygorii,
> >>
> >> On Fri, Sep 13, 2019 at 8:58 PM Grygorii Strashko
> >> <grygorii.strashko@ti.com> wrote:
> >>>
> >>>
> >>>
> >>> On 12/09/2019 19:33, Sam Protsenko wrote:
> >>>> Hi Stefan,
> >>>>
> >>>> On Thu, Sep 12, 2019 at 5:38 PM Stefan Roese <sr@denx.de> wrote:
> >>>>>
> >>>>> Hi Sam,
> >>>>>
> >>>>> On 12.09.19 15:45, Sam Protsenko wrote:
> >>>>>> Hi Suniel,
> >>>>>>
> >>>>>> After transition to DM WDT, watchdog timer on BeagleBone Black resets
> >>>>>> the board after 1 minute or so. I'm using this defconfig: [1]. After
> >>>>>> disabling CONFIG_WDT and CONFIG_WATCHDOG options the board doesn't
> >>>>>> reset. I guess it might be happening on other boards using
> >>>>>> CONFIG_WDT_OMAP3 as well. The issue can be reproduced by stopping in
> >>>>>> U-Boot shell (=>) and waiting for 1 minute.
> >>>>>>
> >>>>>> Do you know by chance why it might be happening, or maybe some fix
> >>>>>> already exists?
> >>>>>>
> >>>>>> Thanks!
> >>>>>>
> >>>>>> [1] https://pastebin.ubuntu.com/p/Zz5bY6cYXS/
> >>>>>
> >>>>> So you have enabled the watchdog and should see something like this
> >>>>> upon bootup:
> >>>>>
> >>>>> WDT:   Started without servicing (60s timeout)
> >>>>>
> >>>>> Is this correct? Then you need to enable the U-Boot internal WDT
> >>>>> servicing by enabling CONFIG_WATCHDOG as well, as this will
> >>>>> result in the internal U-Boot servicing of the watchdog. Then
> >>>>> you should see this upon bootup and no reset will appear in
> >>>>> U-Boot:
> >>>>>
> >>>>> WDT:   Started with servicing (60s timeout)
> >>>>>
> >>>>
> >>>> I'm seeing this ("with servicing") line, and CONFIG_WATCHDOG is
> >>>> already enabled in am335x_evm_defconfig. So I think it's an issue,
> >>>> which *probably* appeared when watchdog drivers were converted to
> >>>> Driver Model (this defconfig is using CONFIG_WDT + CONFIG_WDT_OMAP3
> >>>> options). Any clues what can be wrong?
> >>>>
> >>>>> Does this help?
> >>> It seems logic of hw_watchdog_reset() and omap3_wdt_reset() is different.
> >>> Pay attention at wdt_trgr_pattern.
> >>>
> >>> It seems that
> >>>          priv->wdt_trgr_pattern = 0x1234;
> >>> need to be moved in omap3_wdt_probe()
> >>>
> >>
> >> Thanks a lot for the investigation. I'll check that once I have some spare time.
> >
> > I have done some investigation and I am unable to conclude the behaviour(though the problem got fixed)
> > Here are my observations:
> >
> > watchdog timer doesn't reset the board if booted via sd-card and serial.
> > https://paste.ubuntu.com/p/tjcPhv4FMQ/ (sd card boot)
> > https://pastebin.ubuntu.com/p/X4tkp4ngMK/ (serial boot)
> > https://pastebin.ubuntu.com/p/WvS9PZb45p/ (serial boot with print messages)
> >
> > Sam was right. watchdog timer is resetting the board after conversion to DM, but only if we booted via emmc.
> > earlier for some reason I couldn't concentrate on emmc booting. "my bad".
> >
> > analyzed the behaviour, the count is getting reset in the register when ever watchdog_reset is called but for some reason
> > at around < 60s, the board gets reset (this shouldn't happen...!!). please go through the pastebin link:
> > https://pastebin.ubuntu.com/p/td6c4SQmnm/ (emmc boot)
> >
> > As pointed by Grygorii, I just moved priv->wdt_trgr_pattern into probe and the problem disappears. didn't understand how that
> > change made a difference. Generally as per documentation all initializations are to be done in probe (but still).
> > Why this is not happening on the other two bootmodes (sd-card and serial) ?
> > Can some body shed some light for this behaviour ?
>
> It's kinda simple - non DM code defines wdt_trgr_pattern as static so it's initialized only once.
> Your code initializes it on every reset, so violates TRM.
>
> TRM says:
> "The specific reload sequence is performed whenever the written value on the WDT_WTGR register differs
> from its previous value. In this case, reload is executed in the same way as an overflow autoreload, but
> without the generation of a reset pulse."
>
> >
> > The problem seems to be fixed, I will be patching u-boot in a while. Request Sam if possible to check/test/deploy the change on the
> > board and acknowledge. (I have already tested the changeset and its fixed at my end)
>
> --
> Best regards,
> grygorii

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

end of thread, other threads:[~2019-09-16 11:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 13:45 [U-Boot] OMAP watchdog timer reset on BBB Sam Protsenko
2019-09-12 14:02 ` Grygorii Strashko
2019-09-12 14:37 ` Stefan Roese
2019-09-12 16:33   ` Sam Protsenko
2019-09-13  6:16     ` Suniel Mahesh
2019-09-13 11:20     ` Stefan Roese
2019-09-13 17:58     ` Grygorii Strashko
2019-09-14  5:07       ` Suniel Mahesh
2019-09-14  7:25       ` Sam Protsenko
2019-09-16  7:05         ` Suniel Mahesh
2019-09-16  8:43           ` Grygorii Strashko
2019-09-16 11:13             ` Sam Protsenko

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.