[PATCH 1/5] ARM: SoCFPGA: move wait_on_timeout to generic

Steffen Trumtrar s.trumtrar at pengutronix.de
Mon Mar 3 03:11:29 PST 2025


Hi Ahmad,

On 2025-03-03 at 10:12 +01, Ahmad Fatoum <a.fatoum at pengutronix.de> wrote:

> Hello Steffen,
>
> On 03.03.25 09:59, Steffen Trumtrar wrote:
> > To be able to use the __wait_on_timeout macro in more places, move it to
> > the generic socfpga header.
> >
> > Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
> > ---
> >  arch/arm/mach-socfpga/arria10-xload.c | 16 ----------------
> >  include/mach/socfpga/generic.h        | 16 ++++++++++++++++
> >  2 files changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/arm/mach-socfpga/arria10-xload.c b/arch/arm/mach-socfpga/arria10-xload.c
> > index afec55c33a278f7aa7c13d16557881a5e13f38f9..fb87135ca94a1fd12992bc8e7fb9d1725831aad6 100644
> > --- a/arch/arm/mach-socfpga/arria10-xload.c
> > +++ b/arch/arm/mach-socfpga/arria10-xload.c
> > @@ -16,22 +16,6 @@
> >  #include <mach/socfpga/generic.h>
> >  #include <linux/sizes.h>
> >
> > -#define __wait_on_timeout(timeout, condition) \
> > -({								\
> > -	int __ret = 0;						\
> > -	int __timeout = timeout;				\
> > -								\
> > -	while ((condition)) {					\
> > -		if (__timeout-- < 0) {				\
> > -			__ret = -ETIMEDOUT;			\
> > -			break;					\
> > -		}						\
> > -		arria10_kick_l4wd0();                           \
> > -                __udelay(1);                                    \
>
> Unrelated to your patch. But feeding the watchdog every 1us is
> a bit excessive, isn't it?
>

uuh, yes. That should not be necessary.


Thanks,
Steffen


--
Pengutronix e.K.                | Dipl.-Inform. Steffen Trumtrar |
Steuerwalder Str. 21            | https://www.pengutronix.de/    |
31137 Hildesheim, Germany       | Phone: +49-5121-206917-0       |
Amtsgericht Hildesheim, HRA 2686| Fax:   +49-5121-206917-5555    |



More information about the barebox mailing list