[PATCH v2] net: axi_emac: Fix timeout test
Anand Moon
linux.amoon at gmail.com
Tue Aug 19 09:13:40 CEST 2025
Hi Michal,
On Mon, 18 Aug 2025 at 18:48, Michal Simek <michal.simek at amd.com> wrote:
>
>
>
> On 8/18/25 13:40, Anand Moon wrote:
> > Hi Andrew,
> >
> > On Mon, 18 Aug 2025 at 14:54, Andrew Goodbody
> > <andrew.goodbody at linaro.org> wrote:
> >>
> >> The timeout test in axi_dma_init is not correct due to the
> >> post-decrement used on the timeout variable which will mean timeout is
> >> not 0 if the timeout occurs. Make the timeout variable an int instead of
> >> a u32 and then test for timeout being -1.
> >>
> >> This issue was found by Smatch.
> >>
> > You can use read_poll_timeout instead of a while loop timeout?
> he could use it but then this should be split to two reads because two
> conditions are checked and not sure if it is worth to do it.
>
I initially overlooked the separate readl calls for dmatx and dmarx,
but replacing the manual while loop with read_poll_timeout would
significantly improve the code by making the polling logic cleaner.
> Thanks,
> Michal
Thanks
-Anand
More information about the U-Boot
mailing list