lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <da4fa029-048b-4ada-bfe7-9194b6886436@baylibre.com>
Date: Wed, 8 Jan 2025 15:00:48 -0600
From: David Lechner <dlechner@...libre.com>
To: Angelo Dureghello <adureghello@...libre.com>,
 Lars-Peter Clausen <lars@...afoo.de>,
 Michael Hennerich <Michael.Hennerich@...log.com>,
 Jonathan Cameron <jic23@...nel.org>,
 Mihail Chindris <mihail.chindris@...log.com>, Nuno Sa <nuno.sa@...log.com>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/9] iio: dac: adi-axi-dac: modify stream enable

On 1/8/25 11:29 AM, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@...libre.com>
> 
> Change suggested from the AXI HDL team, modify the function
> axi_dac_data_stream_enable() to check for interface busy, to avoid
> possible issues when starting the stream.
> 
> Fixes: e61d7178429a ("iio: dac: adi-axi-dac: extend features")
> Signed-off-by: Angelo Dureghello <adureghello@...libre.com>
> ---
>  drivers/iio/dac/adi-axi-dac.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-dac.c
> index b143f7ed6847..d02eb535b648 100644
> --- a/drivers/iio/dac/adi-axi-dac.c
> +++ b/drivers/iio/dac/adi-axi-dac.c
> @@ -585,6 +585,17 @@ static int axi_dac_ddr_disable(struct iio_backend *back)
>  static int axi_dac_data_stream_enable(struct iio_backend *back)
>  {
>  	struct axi_dac_state *st = iio_backend_get_priv(back);
> +	int ret, val;
> +
> +	ret = regmap_read_poll_timeout(st->regmap,
> +				AXI_DAC_UI_STATUS_REG, val,
> +				FIELD_GET(AXI_DAC_UI_STATUS_IF_BUSY, val) == 0,
> +				10, 100 * KILO);
> +	if (ret) {
> +		if (ret == -ETIMEDOUT)
> +			dev_err(st->dev, "AXI read timeout\n");

Do we really need the `dev_err()`? I think the ETIMEDOUT will bubble up to
userspace anyway via buffer_postenable.

If we keep it though, it could use a better message. The important part is that
the AXI IP block never became ready, not that reading the register timed out.

> +		return ret;
> +	}
>  
>  	return regmap_set_bits(st->regmap, AXI_DAC_CUSTOM_CTRL_REG,
>  			       AXI_DAC_CUSTOM_CTRL_STREAM_ENABLE);
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ