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: <fd505d37aceaafd6b20626bfd3f25c47db1fb004.1758916484.git.marcelo.schmitt@analog.com>
Date: Fri, 26 Sep 2025 17:39:42 -0300
From: Marcelo Schmitt <marcelo.schmitt@...log.com>
To: <linux-iio@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-doc@...r.kernel.org>, <linux-spi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC: <jic23@...nel.org>, <michael.hennerich@...log.com>, <nuno.sa@...log.com>,
        <eblanc@...libre.com>, <dlechner@...libre.com>, <andy@...nel.org>,
        <robh@...nel.org>, <krzk+dt@...nel.org>, <conor+dt@...nel.org>,
        <corbet@....net>, <marcelo.schmitt1@...il.com>
Subject: [PATCH v3 4/8] iio: adc: ad4030: Reduce register access transfer speed

Configuration register accesses are not considered a critical path in terms
of time to complete. Even though register access transfers can run at high
speeds, nanosecond completion times are not required as device
configuration is usually done step by step from user space. Also, high
frequency transfers hinder debug with external tools since they require
faster clocked equipment. Reduce register access transfer speed.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@...log.com>
---
 drivers/iio/adc/ad4030.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/adc/ad4030.c b/drivers/iio/adc/ad4030.c
index 1bc2f9a22470..7f0dbb8a3b07 100644
--- a/drivers/iio/adc/ad4030.c
+++ b/drivers/iio/adc/ad4030.c
@@ -102,7 +102,7 @@
 #define AD4030_VREF_MAX_UV		(5000 * MILLI)
 #define AD4030_VIO_THRESHOLD_UV		(1400 * MILLI)
 #define AD4030_SPI_MAX_XFER_LEN		8
-#define AD4030_SPI_MAX_REG_XFER_SPEED	(80 * MEGA)
+#define AD4030_SPI_REG_XFER_SPEED	(10 * MEGA)
 #define AD4030_TCNVH_NS			10
 #define AD4030_TCNVL_NS			20
 #define AD4030_TCYC_NS			500
@@ -245,7 +245,7 @@ static int ad4030_enter_config_mode(struct ad4030_state *st)
 	struct spi_transfer xfer = {
 		.tx_buf = st->tx_data,
 		.len = 1,
-		.speed_hz = AD4030_SPI_MAX_REG_XFER_SPEED,
+		.speed_hz = AD4030_SPI_REG_XFER_SPEED,
 	};
 
 	return spi_sync_transfer(st->spi, &xfer, 1);
@@ -260,7 +260,7 @@ static int ad4030_exit_config_mode(struct ad4030_state *st)
 	struct spi_transfer xfer = {
 		.tx_buf = st->tx_data,
 		.len = 3,
-		.speed_hz = AD4030_SPI_MAX_REG_XFER_SPEED,
+		.speed_hz = AD4030_SPI_REG_XFER_SPEED,
 	};
 
 	return spi_sync_transfer(st->spi, &xfer, 1);
@@ -275,7 +275,7 @@ static int ad4030_spi_read(void *context, const void *reg, size_t reg_size,
 		.tx_buf = st->tx_data,
 		.rx_buf = st->rx_data.raw,
 		.len = reg_size + val_size,
-		.speed_hz = AD4030_SPI_MAX_REG_XFER_SPEED,
+		.speed_hz = AD4030_SPI_REG_XFER_SPEED,
 	};
 
 	if (xfer.len > sizeof(st->tx_data) ||
@@ -309,7 +309,7 @@ static int ad4030_spi_write(void *context, const void *data, size_t count)
 	struct spi_transfer xfer = {
 		.tx_buf = st->tx_data,
 		.len = count,
-		.speed_hz = AD4030_SPI_MAX_REG_XFER_SPEED,
+		.speed_hz = AD4030_SPI_REG_XFER_SPEED,
 	};
 
 	if (count > sizeof(st->tx_data))
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ