Re: [PATCH v2 1/2] iio: dac: adi-axi-dac: fix bus read
From: Andy Shevchenko
Date: Wed Apr 09 2025 - 12:49:42 EST
On Wed, Apr 09, 2025 at 11:16:54AM +0200, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@xxxxxxxxxxxx>
>
> Fix bus read function.
>
> Testing the driver, on a random basis, wrong reads was detected, mainly
> by a wrong DAC chip ID read at first boot.
> Before reading the expected value from the AXI regmap, need always to
> wait for busy flag to be cleared.
...
> + ret = regmap_read_poll_timeout(st->regmap,
> + AXI_DAC_UI_STATUS_REG, ival,
> + FIELD_GET(AXI_DAC_UI_STATUS_IF_BUSY, ival) == 0,
> + 10, 100 * KILO);
It's timeout, we have special constants for that, I believe you wanted to have
USEC_PER_MSEC here.
> + if (ret)
> + return ret;
--
With Best Regards,
Andy Shevchenko