Re: Please pull u-boot-watchdog/next

2024-06-17 Thread Tom Rini
On Sun, Jun 16, 2024 at 12:18:52PM +0200, Stefan Roese wrote:

> Hi Tom,
> 
> please pull the following watchdog & cyclic related patches:
> 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Please pull u-boot-watchdog/next

2024-06-16 Thread Stefan Roese

Hi Tom,

please pull the following watchdog & cyclic related patches:


- misc cyclic infrastructure improvements (Rasmus)
- watchdog_reset cleanup (Rasmus)


Here the Azure build, without any issues:

https://dev.azure.com/sr0718/u-boot/_build/results?buildId=369&view=results

Thanks,
Stefan


The following changes since commit 0786dd573d0793417852e009dee3148ebdd163f3:

  test/py: net_boot: Add test cases for net boot (2024-06-13 16:31:24 
-0600)


are available in the Git repository at:

  g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next

for you to fetch changes up to 85c476759a42dfedb2d66e9734f8c05b7cfb62d5:

  powerpc: mpc85xx: remove dead watchdog-related code (2024-06-16 
12:14:18 +0200)



Rasmus Villemoes (10):
  cyclic: stop strdup'ing name in cyclic_register()
  wdt-uclass: prevent multiple cyclic_register calls
  cyclic: make clients embed a struct cyclic_info in their own data 
structure

  m68k: remove dead code
  wdt-uclass: watchdog_reset cleanup
  serial: ns16550: fix comment to mention schedule instead of 
watchdog_reset

  sh4: move reset_cpu() from watchdog.c to cpu.c
  sh4: remove watchdog.c file
  powerpc: mpc83xx: remove unused watchdog_reset() function
  powerpc: mpc85xx: remove dead watchdog-related code

 arch/m68k/cpu/mcf52x2/cpu.c| 108 
-

 arch/powerpc/cpu/mpc83xx/cpu.c |  15 --
 arch/powerpc/cpu/mpc85xx/cpu.c |  31 ---
 arch/sh/cpu/sh4/Makefile   |   2 +-
 arch/sh/cpu/sh4/cpu.c  |  10 
 arch/sh/cpu/sh4/watchdog.c |  60 -
 board/Marvell/octeon_nic23/board.c |  11 ++--
 cmd/cyclic.c   |  12 ++---
 common/cyclic.c|  24 +++--
 doc/develop/cyclic.rst |  26 +
 drivers/serial/ns16550.c   |   8 +--
 drivers/watchdog/wdt-uclass.c  |  57 
 include/cyclic.h   |  37 ++---
 include/watchdog.h |   3 --
 test/common/cyclic.c   |  19 ---
 15 files changed, 102 insertions(+), 321 deletions(-)
 delete mode 100644 arch/sh/cpu/sh4/watchdog.c


Re: Please pull u-boot-watchdog/next v2

2022-09-18 Thread Tom Rini
On Sun, Sep 18, 2022 at 12:39:17PM +0200, Stefan Roese wrote:

> Hi Tom,
> 
> please pull the following watchdog related patches:
> 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Please pull u-boot-watchdog/next v2

2022-09-18 Thread Stefan Roese

Hi Tom,

please pull the following watchdog related patches:


- Migrate watchdog reset to cyclic infrastructure (Stefan)


Here the Azure build, without any issues:

https://dev.azure.com/sr0718/u-boot/_build/results?buildId=262&view=results

Thanks,
Stefan

The following changes since commit d219fc06b30d4b1ac4fac6c40b2ca69cb5ecf642:

  configs: Resync with savedefconfig (2022-09-16 16:06:46 -0400)

are available in the Git repository at:

  g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next

for you to fetch changes up to 8695fbb3a7ff3640eff62f7123323b16546d5b35:

  watchdog: Further cleanup (2022-09-18 10:26:49 +0200)


Stefan Roese (6):
  watchdog: Integrate watchdog triggering into the cyclic framework
  cyclic: Introduce schedule() function
  cyclic: Use schedule() instead of WATCHDOG_RESET()
  watchdog: Get rid of ASSEMBLY hacks
  watchdog: Remove WATCHDOG_RESET macro
  watchdog: Further cleanup

 arch/arm/mach-at91/phy.c   |  2 +-
 arch/arm/mach-imx/i2c-mxv7.c   |  2 +-
 arch/arm/mach-socfpga/spl_a10.c|  8 +--
 .../mach-stm32mp/cmd_stm32prog/stm32prog_serial.c  |  6 +-
 arch/m68k/lib/time.c   |  2 +-
 arch/powerpc/cpu/mpc8xx/cpu_init.c |  2 +-
 arch/powerpc/lib/bootm.c   |  6 +-
 arch/powerpc/lib/cache.c   |  2 +-
 arch/powerpc/lib/interrupts.c  |  2 +-
 arch/powerpc/lib/ticks.S   |  5 +-
 board/astro/mcf5373l/fpga.c|  4 +-
 board/dhelectronics/dh_stm32mp1/board.c|  2 +-
 board/liebherr/display5/spl.c  |  2 +-
 board/nokia/rx51/rx51.c|  2 +-
 board/st/stm32mp1/stm32mp1.c   |  2 +-
 boot/bootretry.c   |  2 +-
 boot/image-board.c |  2 +-
 cmd/fastboot.c |  2 +-
 cmd/mem.c  | 16 ++---
 cmd/usb_mass_storage.c |  2 +-
 cmd/ximg.c |  2 +-
 common/board_f.c   |  4 +-
 common/board_r.c   |  2 +-
 common/cli_readline.c  |  4 +-
 common/console.c   |  2 +-
 common/cyclic.c| 16 +
 common/dfu.c   |  2 +-
 common/lcd.c   | 10 +--
 common/menu.c  |  6 +-
 common/usb_kbd.c   |  2 +-
 common/xyzModem.c  |  2 +-
 drivers/block/ide.c|  8 +--
 drivers/crypto/aspeed/aspeed_hace.c|  2 +-
 drivers/crypto/hash/hash_sw.c  |  2 +-
 drivers/ddr/altera/sdram_arria10.c |  4 +-
 drivers/ddr/altera/sdram_n5x.c |  4 +-
 drivers/ddr/altera/sdram_soc64.c   |  2 +-
 drivers/fpga/intel_sdm_mb.c|  8 +--
 drivers/fpga/socfpga_arria10.c |  8 +--
 drivers/i2c/mxc_i2c.c  |  4 +-
 drivers/mmc/octeontx_hsmmc.c   | 12 ++--
 drivers/mmc/sh_mmcif.c |  6 +-
 drivers/mmc/stm32_sdmmc2.c |  2 +-
 drivers/mtd/cfi_flash.c|  4 +-
 drivers/mtd/nand/core.c|  2 +-
 drivers/mtd/nand/raw/atmel_nand.c  |  6 +-
 drivers/mtd/nand/raw/nand_base.c   | 10 +--
 drivers/mtd/nand/raw/nand_util.c   |  6 +-
 drivers/mtd/nand/spi/core.c|  4 +-
 drivers/mtd/onenand/onenand_base.c |  4 +-
 drivers/mtd/spi/spi-nor-core.c |  4 +-
 drivers/net/octeontx2/nix.c|  2 +-
 drivers/net/octeontx2/nix_af.c | 32 +-
 drivers/ram/stm32mp1/stm32mp1_tests.c  |  2 +-
 drivers/serial/atmel_usart.c   |  2 +-
 drivers/serial/ns16550.c   |  6 +-
 drivers/serial/serial-uclass.c |  2 +-
 drivers/serial/serial_bcm283x_mu.c |  2 +-
 drivers/serial/serial_lpuart.c |  8 +--
 drivers/serial/serial_mpc8xx.c |  4 +-
 drivers/serial/serial_mt7620.c |  2 +-
 drivers/serial/serial_mtk.c|  4 +-
 drivers/serial/serial_mxc.c|  6 +-
 drivers/serial/serial_octeon_bootcmd.c   

Re: Please pull u-boot-watchdog/next

2022-09-17 Thread Stefan Roese

Hi Tom,

On 16.09.22 23:48, Tom Rini wrote:




Thanks for testing. I do have one last experiment for tonight. Please
give the attached v2 a try.

Thanks,
Stefan



 From 2f61bc2cf011190eedbc0be34b4d61f342e7e5a5 Mon Sep 17 00:00:00 2001
From: Stefan Roese 
Date: Fri, 16 Sep 2022 21:08:51 +0200
Subject: [PATCH v2] cyclic: Only call cyclic_run() from schedule() when it's
  ready

schedule() might get called very early in the boot process (SPL etc),
when the cyclic IF is not initialized. Let's make sure, that we only
call into cyclic_run() when it's ready.

Signed-off-by: Stefan Roese 
---
  common/cyclic.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/cyclic.c b/common/cyclic.c
index 594f9cd92592..b3c180bd1a62 100644
--- a/common/cyclic.c
+++ b/common/cyclic.c
@@ -104,7 +104,12 @@ void schedule(void)
if (IS_ENABLED(CONFIG_HW_WATCHDOG))
hw_watchdog_reset();
  
-	cyclic_run();

+   /*
+* schedule() might get called very early before the cyclic IF is
+* ready. Make sure to only call cyclic_run() when it's initalized.
+*/
+   if (gd && gd->cyclic && gd->cyclic->cyclic_ready)
+   cyclic_run();
  }
  
  int cyclic_uninit(void)


This worked and both boards that failed before now pass.


Perfect. Thanks again for testing.

I'll re-spin v2 of the patchset with this patch squashed in, so that
git bisect'ing will work.

Thanks,
Stefan


Re: Please pull u-boot-watchdog/next

2022-09-16 Thread Tom Rini
On Fri, Sep 16, 2022 at 09:46:49PM +0200, Stefan Roese wrote:
> Hi Tom,
> 
> On 16.09.22 21:22, Tom Rini wrote:
> > On Fri, Sep 16, 2022 at 09:12:54PM +0200, Stefan Roese wrote:
> > > Hi Tom,
> > > 
> > > On 16.09.22 16:37, Stefan Roese wrote:
> > > > Hi Tom,
> > > > 
> > > > On 16.09.22 16:21, Tom Rini wrote:
> > > > > On Fri, Sep 16, 2022 at 10:08:51AM -0400, Tom Rini wrote:
> > > > > > On Fri, Sep 16, 2022 at 09:22:16AM +0200, Stefan Roese wrote:
> > > > > > 
> > > > > > > Hi Tom,
> > > > > > > 
> > > > > > > please pull the following watchdog related patches:
> > > > > > > 
> > > > > > > 
> > > > > > > - Migrate watchdog reset to cyclic infrastructure (Stefan)
> > > > > > > 
> > > > > > > 
> > > > > > > Here the Azure build, without any issues:
> > > > > > > 
> > > > > > > https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results
> > > > > > > 
> > > > > > > 
> > > > > > > Thanks,
> > > > > > > Stefan
> > > > > > > 
> > > > > > > The following changes since commit
> > > > > > > 6ec7207ab3c4dad098967fef5df75e25240fd852:
> > > > > > > 
> > > > > > >     Merge branch '2022-09-15-TI-platform-updates' into next 
> > > > > > > (2022-09-15
> > > > > > > 17:02:52 -0400)
> > > > > > > 
> > > > > > > are available in the Git repository at:
> > > > > > > 
> > > > > > >     g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next
> > > > > > > 
> > > > > > > for you to fetch changes up to
> > > > > > > 4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:
> > > > > > > 
> > > > > > >     watchdog: Further cleanup (2022-09-16 07:09:05 +0200)
> > > > > > > 
> > > > > > > 
> > > > > > > Stefan Roese (6):
> > > > > > >     watchdog: Integrate watchdog triggering into the
> > > > > > > cyclic framework
> > > > > > >     cyclic: Introduce schedule() function
> > > > > > >     cyclic: Use schedule() instead of WATCHDOG_RESET()
> > > > > > >     watchdog: Get rid of ASSEMBLY hacks
> > > > > > >     watchdog: Remove WATCHDOG_RESET macro
> > > > > > >     watchdog: Further cleanup
> > > > > > 
> > > > > > Good bad news, I've got your first hardware failure report.  One of
> > > > > > these three:
> > > > > > cyclic: Use schedule() instead of WATCHDOG_RESET()
> > > > > > cyclic: Introduce schedule() function
> > > > > > watchdog: Integrate watchdog triggering into the cyclic framework
> > > > > > 
> > > > > > Causes am335x_evm to have no output in SPL and just hang. It, along 
> > > > > > with
> > > > > > all of the other TI AM335x platforms have watchdog enabled in SPL. 
> > > > > > I can
> > > > > > also observe that the system watchdog is not triggering, so maybe 
> > > > > > we're
> > > > > > stuck in some loop where that's being serviced still?
> > > > > > 
> > > > > > I suspect all the am335x boards are broken, so if you don't have
> > > > > > something there you can test on let me know off-list and I'll get 
> > > > > > you
> > > > > > access to my lab.
> > > > > > 
> > > > > 
> > > > > I'll note that pine64_plus_defconfig is now also failing, but
> > > > > interestingly dra7xx_evm_defconfig is passing.
> > > > 
> > > > Thanks for all your testing Tom. I'll check, if I still have an AM355x
> > > > here. I just now found an Cubieboard2, which also seems to have SPL
> > > > watchdog enabled. Let me check, if I can get this board running and
> > > > tested.
> > > 
> > > Cubieboard2 does not really use the watchdog in U-Boot and especially
> > > not very early (SPL). So no help here. But I figured out a potential
> > > problem that might explain you system hang. Could you please give the
> > > attached patch a try and let me know, if this changes the situation
> > > a bit?
> > > 
> > > Thanks,
> > > Stefan
> > 
> > >  From 3788aadff5d697e3e150a9e520915007f7a26def Mon Sep 17 00:00:00 2001
> > > From: Stefan Roese 
> > > Date: Fri, 16 Sep 2022 21:08:51 +0200
> > > Subject: [PATCH] cyclic: Only call cyclic_run() from schedule() when it's
> > >   ready
> > > 
> > > schedule() might get called very early in the boot process (SPL etc),
> > > when the cyclic IF is not initialized. Let's make sure, that we only
> > > call into cyclic_run() when it's ready.
> > > 
> > > Signed-off-by: Stefan Roese 
> > > ---
> > >   common/cyclic.c | 7 ++-
> > >   1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/common/cyclic.c b/common/cyclic.c
> > > index 594f9cd92592..9cdbed4ecc92 100644
> > > --- a/common/cyclic.c
> > > +++ b/common/cyclic.c
> > > @@ -104,7 +104,12 @@ void schedule(void)
> > >   if (IS_ENABLED(CONFIG_HW_WATCHDOG))
> > >   hw_watchdog_reset();
> > > - cyclic_run();
> > > + /*
> > > +  * schedule() might get called very early before the cyclic IF is
> > > +  * ready. Make sure to only call cyclic_run() when it's initalized.
> > > +  */
> > > + if (gd->cy

Re: Please pull u-boot-watchdog/next

2022-09-16 Thread Stefan Roese

Hi Tom,

On 16.09.22 21:22, Tom Rini wrote:

On Fri, Sep 16, 2022 at 09:12:54PM +0200, Stefan Roese wrote:

Hi Tom,

On 16.09.22 16:37, Stefan Roese wrote:

Hi Tom,

On 16.09.22 16:21, Tom Rini wrote:

On Fri, Sep 16, 2022 at 10:08:51AM -0400, Tom Rini wrote:

On Fri, Sep 16, 2022 at 09:22:16AM +0200, Stefan Roese wrote:


Hi Tom,

please pull the following watchdog related patches:


- Migrate watchdog reset to cyclic infrastructure (Stefan)


Here the Azure build, without any issues:

https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results


Thanks,
Stefan

The following changes since commit
6ec7207ab3c4dad098967fef5df75e25240fd852:

    Merge branch '2022-09-15-TI-platform-updates' into next (2022-09-15
17:02:52 -0400)

are available in the Git repository at:

    g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next

for you to fetch changes up to
4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:

    watchdog: Further cleanup (2022-09-16 07:09:05 +0200)


Stefan Roese (6):
    watchdog: Integrate watchdog triggering into the
cyclic framework
    cyclic: Introduce schedule() function
    cyclic: Use schedule() instead of WATCHDOG_RESET()
    watchdog: Get rid of ASSEMBLY hacks
    watchdog: Remove WATCHDOG_RESET macro
    watchdog: Further cleanup


Good bad news, I've got your first hardware failure report.  One of
these three:
cyclic: Use schedule() instead of WATCHDOG_RESET()
cyclic: Introduce schedule() function
watchdog: Integrate watchdog triggering into the cyclic framework

Causes am335x_evm to have no output in SPL and just hang. It, along with
all of the other TI AM335x platforms have watchdog enabled in SPL. I can
also observe that the system watchdog is not triggering, so maybe we're
stuck in some loop where that's being serviced still?

I suspect all the am335x boards are broken, so if you don't have
something there you can test on let me know off-list and I'll get you
access to my lab.



I'll note that pine64_plus_defconfig is now also failing, but
interestingly dra7xx_evm_defconfig is passing.


Thanks for all your testing Tom. I'll check, if I still have an AM355x
here. I just now found an Cubieboard2, which also seems to have SPL
watchdog enabled. Let me check, if I can get this board running and
tested.


Cubieboard2 does not really use the watchdog in U-Boot and especially
not very early (SPL). So no help here. But I figured out a potential
problem that might explain you system hang. Could you please give the
attached patch a try and let me know, if this changes the situation
a bit?

Thanks,
Stefan



 From 3788aadff5d697e3e150a9e520915007f7a26def Mon Sep 17 00:00:00 2001
From: Stefan Roese 
Date: Fri, 16 Sep 2022 21:08:51 +0200
Subject: [PATCH] cyclic: Only call cyclic_run() from schedule() when it's
  ready

schedule() might get called very early in the boot process (SPL etc),
when the cyclic IF is not initialized. Let's make sure, that we only
call into cyclic_run() when it's ready.

Signed-off-by: Stefan Roese 
---
  common/cyclic.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/cyclic.c b/common/cyclic.c
index 594f9cd92592..9cdbed4ecc92 100644
--- a/common/cyclic.c
+++ b/common/cyclic.c
@@ -104,7 +104,12 @@ void schedule(void)
if (IS_ENABLED(CONFIG_HW_WATCHDOG))
hw_watchdog_reset();
  
-	cyclic_run();

+   /*
+* schedule() might get called very early before the cyclic IF is
+* ready. Make sure to only call cyclic_run() when it's initalized.
+*/
+   if (gd->cyclic->cyclic_ready)
+   cyclic_run();
  }
  
  int cyclic_uninit(void)


No change.


Thanks for testing. I do have one last experiment for tonight. Please
give the attached v2 a try.

Thanks,
StefanFrom 2f61bc2cf011190eedbc0be34b4d61f342e7e5a5 Mon Sep 17 00:00:00 2001
From: Stefan Roese 
Date: Fri, 16 Sep 2022 21:08:51 +0200
Subject: [PATCH v2] cyclic: Only call cyclic_run() from schedule() when it's
 ready

schedule() might get called very early in the boot process (SPL etc),
when the cyclic IF is not initialized. Let's make sure, that we only
call into cyclic_run() when it's ready.

Signed-off-by: Stefan Roese 
---
 common/cyclic.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/cyclic.c b/common/cyclic.c
index 594f9cd92592..b3c180bd1a62 100644
--- a/common/cyclic.c
+++ b/common/cyclic.c
@@ -104,7 +104,12 @@ void schedule(void)
 	if (IS_ENABLED(CONFIG_HW_WATCHDOG))
 		hw_watchdog_reset();
 
-	cyclic_run();
+	/*
+	 * schedule() might get called very early before the cyclic IF is
+	 * ready. Make sure to only call cyclic_run() when it's initalized.
+	 */
+	if (gd && gd->cyclic && gd->cyclic->cyclic_ready)
+		cyclic_run();
 }
 
 int cyclic_uninit(void)
-- 

Re: Please pull u-boot-watchdog/next

2022-09-16 Thread Tom Rini
On Fri, Sep 16, 2022 at 09:12:54PM +0200, Stefan Roese wrote:
> Hi Tom,
> 
> On 16.09.22 16:37, Stefan Roese wrote:
> > Hi Tom,
> > 
> > On 16.09.22 16:21, Tom Rini wrote:
> > > On Fri, Sep 16, 2022 at 10:08:51AM -0400, Tom Rini wrote:
> > > > On Fri, Sep 16, 2022 at 09:22:16AM +0200, Stefan Roese wrote:
> > > > 
> > > > > Hi Tom,
> > > > > 
> > > > > please pull the following watchdog related patches:
> > > > > 
> > > > > 
> > > > > - Migrate watchdog reset to cyclic infrastructure (Stefan)
> > > > > 
> > > > > 
> > > > > Here the Azure build, without any issues:
> > > > > 
> > > > > https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results
> > > > > 
> > > > > 
> > > > > Thanks,
> > > > > Stefan
> > > > > 
> > > > > The following changes since commit
> > > > > 6ec7207ab3c4dad098967fef5df75e25240fd852:
> > > > > 
> > > > >    Merge branch '2022-09-15-TI-platform-updates' into next (2022-09-15
> > > > > 17:02:52 -0400)
> > > > > 
> > > > > are available in the Git repository at:
> > > > > 
> > > > >    g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next
> > > > > 
> > > > > for you to fetch changes up to
> > > > > 4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:
> > > > > 
> > > > >    watchdog: Further cleanup (2022-09-16 07:09:05 +0200)
> > > > > 
> > > > > 
> > > > > Stefan Roese (6):
> > > > >    watchdog: Integrate watchdog triggering into the
> > > > > cyclic framework
> > > > >    cyclic: Introduce schedule() function
> > > > >    cyclic: Use schedule() instead of WATCHDOG_RESET()
> > > > >    watchdog: Get rid of ASSEMBLY hacks
> > > > >    watchdog: Remove WATCHDOG_RESET macro
> > > > >    watchdog: Further cleanup
> > > > 
> > > > Good bad news, I've got your first hardware failure report.  One of
> > > > these three:
> > > > cyclic: Use schedule() instead of WATCHDOG_RESET()
> > > > cyclic: Introduce schedule() function
> > > > watchdog: Integrate watchdog triggering into the cyclic framework
> > > > 
> > > > Causes am335x_evm to have no output in SPL and just hang. It, along with
> > > > all of the other TI AM335x platforms have watchdog enabled in SPL. I can
> > > > also observe that the system watchdog is not triggering, so maybe we're
> > > > stuck in some loop where that's being serviced still?
> > > > 
> > > > I suspect all the am335x boards are broken, so if you don't have
> > > > something there you can test on let me know off-list and I'll get you
> > > > access to my lab.
> > > > 
> > > 
> > > I'll note that pine64_plus_defconfig is now also failing, but
> > > interestingly dra7xx_evm_defconfig is passing.
> > 
> > Thanks for all your testing Tom. I'll check, if I still have an AM355x
> > here. I just now found an Cubieboard2, which also seems to have SPL
> > watchdog enabled. Let me check, if I can get this board running and
> > tested.
> 
> Cubieboard2 does not really use the watchdog in U-Boot and especially
> not very early (SPL). So no help here. But I figured out a potential
> problem that might explain you system hang. Could you please give the
> attached patch a try and let me know, if this changes the situation
> a bit?
> 
> Thanks,
> Stefan

> From 3788aadff5d697e3e150a9e520915007f7a26def Mon Sep 17 00:00:00 2001
> From: Stefan Roese 
> Date: Fri, 16 Sep 2022 21:08:51 +0200
> Subject: [PATCH] cyclic: Only call cyclic_run() from schedule() when it's
>  ready
> 
> schedule() might get called very early in the boot process (SPL etc),
> when the cyclic IF is not initialized. Let's make sure, that we only
> call into cyclic_run() when it's ready.
> 
> Signed-off-by: Stefan Roese 
> ---
>  common/cyclic.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/common/cyclic.c b/common/cyclic.c
> index 594f9cd92592..9cdbed4ecc92 100644
> --- a/common/cyclic.c
> +++ b/common/cyclic.c
> @@ -104,7 +104,12 @@ void schedule(void)
>   if (IS_ENABLED(CONFIG_HW_WATCHDOG))
>   hw_watchdog_reset();
>  
> - cyclic_run();
> + /*
> +  * schedule() might get called very early before the cyclic IF is
> +  * ready. Make sure to only call cyclic_run() when it's initalized.
> +  */
> + if (gd->cyclic->cyclic_ready)
> + cyclic_run();
>  }
>  
>  int cyclic_uninit(void)

No change.

-- 
Tom


signature.asc
Description: PGP signature


Re: Please pull u-boot-watchdog/next

2022-09-16 Thread Stefan Roese

Hi Tom,

On 16.09.22 16:37, Stefan Roese wrote:

Hi Tom,

On 16.09.22 16:21, Tom Rini wrote:

On Fri, Sep 16, 2022 at 10:08:51AM -0400, Tom Rini wrote:

On Fri, Sep 16, 2022 at 09:22:16AM +0200, Stefan Roese wrote:


Hi Tom,

please pull the following watchdog related patches:


- Migrate watchdog reset to cyclic infrastructure (Stefan)


Here the Azure build, without any issues:

https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results 



Thanks,
Stefan

The following changes since commit 
6ec7207ab3c4dad098967fef5df75e25240fd852:


   Merge branch '2022-09-15-TI-platform-updates' into next (2022-09-15
17:02:52 -0400)

are available in the Git repository at:

   g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next

for you to fetch changes up to 
4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:


   watchdog: Further cleanup (2022-09-16 07:09:05 +0200)


Stefan Roese (6):
   watchdog: Integrate watchdog triggering into the cyclic 
framework

   cyclic: Introduce schedule() function
   cyclic: Use schedule() instead of WATCHDOG_RESET()
   watchdog: Get rid of ASSEMBLY hacks
   watchdog: Remove WATCHDOG_RESET macro
   watchdog: Further cleanup


Good bad news, I've got your first hardware failure report.  One of
these three:
cyclic: Use schedule() instead of WATCHDOG_RESET()
cyclic: Introduce schedule() function
watchdog: Integrate watchdog triggering into the cyclic framework

Causes am335x_evm to have no output in SPL and just hang. It, along with
all of the other TI AM335x platforms have watchdog enabled in SPL. I can
also observe that the system watchdog is not triggering, so maybe we're
stuck in some loop where that's being serviced still?

I suspect all the am335x boards are broken, so if you don't have
something there you can test on let me know off-list and I'll get you
access to my lab.



I'll note that pine64_plus_defconfig is now also failing, but
interestingly dra7xx_evm_defconfig is passing.


Thanks for all your testing Tom. I'll check, if I still have an AM355x
here. I just now found an Cubieboard2, which also seems to have SPL
watchdog enabled. Let me check, if I can get this board running and
tested.


Cubieboard2 does not really use the watchdog in U-Boot and especially
not very early (SPL). So no help here. But I figured out a potential
problem that might explain you system hang. Could you please give the
attached patch a try and let me know, if this changes the situation
a bit?

Thanks,
StefanFrom 3788aadff5d697e3e150a9e520915007f7a26def Mon Sep 17 00:00:00 2001
From: Stefan Roese 
Date: Fri, 16 Sep 2022 21:08:51 +0200
Subject: [PATCH] cyclic: Only call cyclic_run() from schedule() when it's
 ready

schedule() might get called very early in the boot process (SPL etc),
when the cyclic IF is not initialized. Let's make sure, that we only
call into cyclic_run() when it's ready.

Signed-off-by: Stefan Roese 
---
 common/cyclic.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/cyclic.c b/common/cyclic.c
index 594f9cd92592..9cdbed4ecc92 100644
--- a/common/cyclic.c
+++ b/common/cyclic.c
@@ -104,7 +104,12 @@ void schedule(void)
 	if (IS_ENABLED(CONFIG_HW_WATCHDOG))
 		hw_watchdog_reset();
 
-	cyclic_run();
+	/*
+	 * schedule() might get called very early before the cyclic IF is
+	 * ready. Make sure to only call cyclic_run() when it's initalized.
+	 */
+	if (gd->cyclic->cyclic_ready)
+		cyclic_run();
 }
 
 int cyclic_uninit(void)
-- 
2.37.3



Re: Please pull u-boot-watchdog/next

2022-09-16 Thread Stefan Roese

Hi Tom,

On 16.09.22 16:21, Tom Rini wrote:

On Fri, Sep 16, 2022 at 10:08:51AM -0400, Tom Rini wrote:

On Fri, Sep 16, 2022 at 09:22:16AM +0200, Stefan Roese wrote:


Hi Tom,

please pull the following watchdog related patches:


- Migrate watchdog reset to cyclic infrastructure (Stefan)


Here the Azure build, without any issues:

https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results

Thanks,
Stefan

The following changes since commit 6ec7207ab3c4dad098967fef5df75e25240fd852:

   Merge branch '2022-09-15-TI-platform-updates' into next (2022-09-15
17:02:52 -0400)

are available in the Git repository at:

   g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next

for you to fetch changes up to 4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:

   watchdog: Further cleanup (2022-09-16 07:09:05 +0200)


Stefan Roese (6):
   watchdog: Integrate watchdog triggering into the cyclic framework
   cyclic: Introduce schedule() function
   cyclic: Use schedule() instead of WATCHDOG_RESET()
   watchdog: Get rid of ASSEMBLY hacks
   watchdog: Remove WATCHDOG_RESET macro
   watchdog: Further cleanup


Good bad news, I've got your first hardware failure report.  One of
these three:
cyclic: Use schedule() instead of WATCHDOG_RESET()
cyclic: Introduce schedule() function
watchdog: Integrate watchdog triggering into the cyclic framework

Causes am335x_evm to have no output in SPL and just hang. It, along with
all of the other TI AM335x platforms have watchdog enabled in SPL. I can
also observe that the system watchdog is not triggering, so maybe we're
stuck in some loop where that's being serviced still?

I suspect all the am335x boards are broken, so if you don't have
something there you can test on let me know off-list and I'll get you
access to my lab.



I'll note that pine64_plus_defconfig is now also failing, but
interestingly dra7xx_evm_defconfig is passing.


Thanks for all your testing Tom. I'll check, if I still have an AM355x
here. I just now found an Cubieboard2, which also seems to have SPL
watchdog enabled. Let me check, if I can get this board running and
tested.

If all fails, I'll get back to you with the offer to access your HW.

Thanks,
Stefan


Re: Please pull u-boot-watchdog/next

2022-09-16 Thread Tom Rini
On Fri, Sep 16, 2022 at 10:08:51AM -0400, Tom Rini wrote:
> On Fri, Sep 16, 2022 at 09:22:16AM +0200, Stefan Roese wrote:
> 
> > Hi Tom,
> > 
> > please pull the following watchdog related patches:
> > 
> > 
> > - Migrate watchdog reset to cyclic infrastructure (Stefan)
> > 
> > 
> > Here the Azure build, without any issues:
> > 
> > https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results
> > 
> > Thanks,
> > Stefan
> > 
> > The following changes since commit 6ec7207ab3c4dad098967fef5df75e25240fd852:
> > 
> >   Merge branch '2022-09-15-TI-platform-updates' into next (2022-09-15
> > 17:02:52 -0400)
> > 
> > are available in the Git repository at:
> > 
> >   g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next
> > 
> > for you to fetch changes up to 4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:
> > 
> >   watchdog: Further cleanup (2022-09-16 07:09:05 +0200)
> > 
> > 
> > Stefan Roese (6):
> >   watchdog: Integrate watchdog triggering into the cyclic framework
> >   cyclic: Introduce schedule() function
> >   cyclic: Use schedule() instead of WATCHDOG_RESET()
> >   watchdog: Get rid of ASSEMBLY hacks
> >   watchdog: Remove WATCHDOG_RESET macro
> >   watchdog: Further cleanup
> 
> Good bad news, I've got your first hardware failure report.  One of
> these three:
> cyclic: Use schedule() instead of WATCHDOG_RESET()
> cyclic: Introduce schedule() function
> watchdog: Integrate watchdog triggering into the cyclic framework
> 
> Causes am335x_evm to have no output in SPL and just hang. It, along with
> all of the other TI AM335x platforms have watchdog enabled in SPL. I can
> also observe that the system watchdog is not triggering, so maybe we're
> stuck in some loop where that's being serviced still?
> 
> I suspect all the am335x boards are broken, so if you don't have
> something there you can test on let me know off-list and I'll get you
> access to my lab.
> 

I'll note that pine64_plus_defconfig is now also failing, but
interestingly dra7xx_evm_defconfig is passing.

-- 
Tom


signature.asc
Description: PGP signature


Re: Please pull u-boot-watchdog/next

2022-09-16 Thread Tom Rini
On Fri, Sep 16, 2022 at 09:22:16AM +0200, Stefan Roese wrote:

> Hi Tom,
> 
> please pull the following watchdog related patches:
> 
> 
> - Migrate watchdog reset to cyclic infrastructure (Stefan)
> 
> 
> Here the Azure build, without any issues:
> 
> https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results
> 
> Thanks,
> Stefan
> 
> The following changes since commit 6ec7207ab3c4dad098967fef5df75e25240fd852:
> 
>   Merge branch '2022-09-15-TI-platform-updates' into next (2022-09-15
> 17:02:52 -0400)
> 
> are available in the Git repository at:
> 
>   g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next
> 
> for you to fetch changes up to 4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:
> 
>   watchdog: Further cleanup (2022-09-16 07:09:05 +0200)
> 
> 
> Stefan Roese (6):
>   watchdog: Integrate watchdog triggering into the cyclic framework
>   cyclic: Introduce schedule() function
>   cyclic: Use schedule() instead of WATCHDOG_RESET()
>   watchdog: Get rid of ASSEMBLY hacks
>   watchdog: Remove WATCHDOG_RESET macro
>   watchdog: Further cleanup

Good bad news, I've got your first hardware failure report.  One of
these three:
cyclic: Use schedule() instead of WATCHDOG_RESET()
cyclic: Introduce schedule() function
watchdog: Integrate watchdog triggering into the cyclic framework

Causes am335x_evm to have no output in SPL and just hang. It, along with
all of the other TI AM335x platforms have watchdog enabled in SPL. I can
also observe that the system watchdog is not triggering, so maybe we're
stuck in some loop where that's being serviced still?

I suspect all the am335x boards are broken, so if you don't have
something there you can test on let me know off-list and I'll get you
access to my lab.

-- 
Tom


signature.asc
Description: PGP signature


Please pull u-boot-watchdog/next

2022-09-16 Thread Stefan Roese

Hi Tom,

please pull the following watchdog related patches:


- Migrate watchdog reset to cyclic infrastructure (Stefan)


Here the Azure build, without any issues:

https://dev.azure.com/sr0718/u-boot/_build/results?buildId=260&view=results

Thanks,
Stefan

The following changes since commit 6ec7207ab3c4dad098967fef5df75e25240fd852:

  Merge branch '2022-09-15-TI-platform-updates' into next (2022-09-15 
17:02:52 -0400)


are available in the Git repository at:

  g...@source.denx.de:u-boot/custodians/u-boot-watchdog.git next

for you to fetch changes up to 4bd01be23a9d0c2dbfaac0c196ead6a89824cbf8:

  watchdog: Further cleanup (2022-09-16 07:09:05 +0200)


Stefan Roese (6):
  watchdog: Integrate watchdog triggering into the cyclic framework
  cyclic: Introduce schedule() function
  cyclic: Use schedule() instead of WATCHDOG_RESET()
  watchdog: Get rid of ASSEMBLY hacks
  watchdog: Remove WATCHDOG_RESET macro
  watchdog: Further cleanup

 arch/arm/mach-at91/phy.c   |  2 +-
 arch/arm/mach-imx/i2c-mxv7.c   |  2 +-
 arch/arm/mach-socfpga/spl_a10.c|  8 +--
 .../mach-stm32mp/cmd_stm32prog/stm32prog_serial.c  |  6 +-
 arch/m68k/lib/time.c   |  2 +-
 arch/powerpc/cpu/mpc8xx/cpu_init.c |  2 +-
 arch/powerpc/lib/bootm.c   |  6 +-
 arch/powerpc/lib/cache.c   |  2 +-
 arch/powerpc/lib/interrupts.c  |  2 +-
 arch/powerpc/lib/ticks.S   |  5 +-
 board/astro/mcf5373l/fpga.c|  4 +-
 board/dhelectronics/dh_stm32mp1/board.c|  2 +-
 board/liebherr/display5/spl.c  |  2 +-
 board/nokia/rx51/rx51.c|  2 +-
 board/st/stm32mp1/stm32mp1.c   |  2 +-
 boot/bootretry.c   |  2 +-
 boot/image-board.c |  2 +-
 cmd/fastboot.c |  2 +-
 cmd/mem.c  | 16 ++---
 cmd/usb_mass_storage.c |  2 +-
 cmd/ximg.c |  2 +-
 common/board_f.c   |  4 +-
 common/board_r.c   |  2 +-
 common/cli_readline.c  |  4 +-
 common/console.c   |  2 +-
 common/cyclic.c| 11 
 common/dfu.c   |  2 +-
 common/lcd.c   | 10 +--
 common/menu.c  |  6 +-
 common/usb_kbd.c   |  2 +-
 common/xyzModem.c  |  2 +-
 drivers/block/ide.c|  8 +--
 drivers/crypto/aspeed/aspeed_hace.c|  2 +-
 drivers/crypto/hash/hash_sw.c  |  2 +-
 drivers/ddr/altera/sdram_arria10.c |  4 +-
 drivers/ddr/altera/sdram_n5x.c |  4 +-
 drivers/ddr/altera/sdram_soc64.c   |  2 +-
 drivers/fpga/intel_sdm_mb.c|  8 +--
 drivers/fpga/socfpga_arria10.c |  8 +--
 drivers/i2c/mxc_i2c.c  |  4 +-
 drivers/mmc/octeontx_hsmmc.c   | 12 ++--
 drivers/mmc/sh_mmcif.c |  6 +-
 drivers/mmc/stm32_sdmmc2.c |  2 +-
 drivers/mtd/cfi_flash.c|  4 +-
 drivers/mtd/nand/core.c|  2 +-
 drivers/mtd/nand/raw/atmel_nand.c  |  6 +-
 drivers/mtd/nand/raw/nand_base.c   | 10 +--
 drivers/mtd/nand/raw/nand_util.c   |  6 +-
 drivers/mtd/nand/spi/core.c|  4 +-
 drivers/mtd/onenand/onenand_base.c |  4 +-
 drivers/mtd/spi/spi-nor-core.c |  4 +-
 drivers/net/octeontx2/nix.c|  2 +-
 drivers/net/octeontx2/nix_af.c | 32 +-
 drivers/ram/stm32mp1/stm32mp1_tests.c  |  2 +-
 drivers/serial/atmel_usart.c   |  2 +-
 drivers/serial/ns16550.c   |  6 +-
 drivers/serial/serial-uclass.c |  2 +-
 drivers/serial/serial_bcm283x_mu.c |  2 +-
 drivers/serial/serial_lpuart.c |  8 +--
 drivers/serial/serial_mpc8xx.c |  4 +-
 drivers/serial/serial_mt7620.c |  2 +-
 drivers/serial/serial_mtk.c|  4 +-
 drivers/serial/serial_mxc.c|  6 +-
 drivers/serial/serial_octeo