Skip to contentSkip to conversation

patch "iio: adis16475: fix deadlock on frequency set" added to staging-linus

PATCH [email protected] 1 participant 1 message Oct 5, 2021

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: adis16475: fix deadlock on frequency set

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 9da1b86865ab4376408c58cd9fec332c8bdb5c73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nuno=20S=C3=A1?= <[email protected]>
Date: Mon, 20 Sep 2021 11:00:47 +0200
Subject: iio: adis16475: fix deadlock on frequency set
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

With commit 39c024b51b560
("iio: adis16475: improve sync scale mode handling"), two deadlocks were introduced:
1) The call to 'adis_write_reg_16()' was not changed to it's unlocked version.
2) The lock was not being released on the success path of the function.

This change fixes both these issues.

Fixes 39c024b51b560 ("iio: adis16475: improve sync scale mode handling")
---
 drivers/iio/imu/adis16475.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/imu/adis16475.c +2 -1
index eb48102f9424..287fff39a927 100644
@@ -353,10 +353,11 @@ static int adis16475_set_freq(struct adis16475 *st, const u32 freq)
 	if (dec > st->info->max_dec)
 		dec = st->info->max_dec;
 
-	ret = adis_write_reg_16(&st->adis, ADIS16475_REG_DEC_RATE, dec);
+	ret = __adis_write_reg_16(&st->adis, ADIS16475_REG_DEC_RATE, dec);
 	if (ret)
 		goto error;
 
+	adis_dev_unlock(&st->adis);
 	/*
 	 * If decimation is used, then gyro and accel data will have meaningful
 	 * bits on the LSB registers. This info is used on the trigger handler.
Signature · 1 line
2.33.0