From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9780F2D739D; Tue, 17 Mar 2026 17:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773768417; cv=none; b=cB9fVWZ5bO4y37pKA4AJrCoC0u0VeL6uOrMCAB65q47aQa3lZlbdmSTQngpXDBY4BdP4DMMKfKEUNev1slHoDDY95BoDnvIVkoRz9bpCpsQCyEPNgSWqxohFaOhyfigkncHCY0Px4xbX8NK9WbpEcNgZfUcTMeiYmNE2gWeFKgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773768417; c=relaxed/simple; bh=oQbRp08QUHwDLSwk8MIuD5HHb9aX0874JX43aE+lR/Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MAtdSZPfNkDe0OtDm5UjW69drVb88h5rjjnR1OhaLhSt3etzcdRmJGg8p/OKaeWjhytVIIVcc5g44v2hhyJsMxIb/Pp/DD89xua6VCqRatboweVudl72fUiRESD2/3WPIzQJ2hLFpvQ2BoAh57ZyVGcXD5kwwFVwKyndDSwZkp0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f8NQQe5U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="f8NQQe5U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF60DC4CEF7; Tue, 17 Mar 2026 17:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773768417; bh=oQbRp08QUHwDLSwk8MIuD5HHb9aX0874JX43aE+lR/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f8NQQe5UI4tl3MD1kfni1K1DPuJ7xZQr5NrI8rGUpjp/YUgJU9s4F2bEk2Dkcu+qP Xgm2SHp4DEcXjjvdQ6YU8wkySAz+zqwthBhinTF6GPo2PvqnbbJI55pZoqbREfKHMt U+ZaeY+CV+114I0AkIELelO6GmyPhM148rJuXma0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jean-Baptiste Maneyrol , Jonathan Cameron Subject: [PATCH 6.18 304/333] iio: imu: inv_icm42600: fix odr switch to the same value Date: Tue, 17 Mar 2026 17:35:33 +0100 Message-ID: <20260317163010.663767202@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260317162959.345812316@linuxfoundation.org> References: <20260317162959.345812316@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jean-Baptiste Maneyrol commit c9f3a593137d862d424130343e77d4b5260a4f5a upstream. ODR switch is done in 2 steps when FIFO is on : change the ODR register value and acknowledge change when reading the FIFO ODR change flag. When we are switching to the same odr value, we end up waiting for a FIFO ODR flag that is never happening. Fix the issue by doing nothing and exiting properly when we are switching to the same ODR value. Fixes: ec74ae9fd37c ("iio: imu: inv_icm42600: add accurate timestamping") Signed-off-by: Jean-Baptiste Maneyrol Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 ++ drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 2 ++ 2 files changed, 4 insertions(+) --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c @@ -651,6 +651,8 @@ static int inv_icm42600_accel_write_odr( return -EINVAL; conf.odr = inv_icm42600_accel_odr_conv[idx / 2]; + if (conf.odr == st->conf.accel.odr) + return 0; pm_runtime_get_sync(dev); mutex_lock(&st->lock); --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c @@ -358,6 +358,8 @@ static int inv_icm42600_gyro_write_odr(s return -EINVAL; conf.odr = inv_icm42600_gyro_odr_conv[idx / 2]; + if (conf.odr == st->conf.gyro.odr) + return 0; pm_runtime_get_sync(dev); mutex_lock(&st->lock);