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 9EC9F32BF21; Mon, 27 Oct 2025 19:03:28 +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=1761591808; cv=none; b=s3K8vZPnVhcQ3pxQg21h/7zsqbazV+hRozwWlz67nw0GjJmap9FMPHPVrzbC4UMEOSciJSHFrFUdPDoCA7SEwsosBoLxWNKa89QlslID0PD5KR20FBLGUIx3sYcLNAuS4BCw3v6f0yNyH5DYI+o4w6LULu/mcpsEso41r1M9JLU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761591808; c=relaxed/simple; bh=hXeaHJUJuqaQQifbBmhLTAlE7p/ja3D5A38+nC2oCoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vFrPY+Khj6SixPRkfuWntDiNdjJdqSTOQs9eJVgZJ2jMnsQ1apsbS4IZrKbUxaPvS7s0MTOSyvFKngFV5YZ3xR1I4hrBIGLe5RigbxirM92mea5pvw+Rp+0WsYXz8gZE8uQ3omfzLnKGRhtpjQkFlGYPYPV6E1bxMWYepQ8ZRp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ScL5WoCD; 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="ScL5WoCD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19556C113D0; Mon, 27 Oct 2025 19:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761591808; bh=hXeaHJUJuqaQQifbBmhLTAlE7p/ja3D5A38+nC2oCoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ScL5WoCDIZsSV5cfsRWe72qwHbFxpp4d3t++1SUVg0HllWZP6eSaNUjvWuYOEKe3H T54ZMeWK/xPP90Yz0Qw1moUf2Xxjpa+lgLyMfbnrGzev7W+Dm5WRQHKWftdklTBBt5 5mOCufCx9Hrid3CxqnFfrUd4HE8jobPr8gg00Zt0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sean Nyekjaer , Stable@vger.kernel.org, Jonathan Cameron , Sasha Levin Subject: [PATCH 5.10 309/332] iio: imu: inv_icm42600: Avoid configuring if already pm_runtime suspended Date: Mon, 27 Oct 2025 19:36:02 +0100 Message-ID: <20251027183533.015173404@linuxfoundation.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251027183524.611456697@linuxfoundation.org> References: <20251027183524.611456697@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean Nyekjaer [ Upstream commit 466f7a2fef2a4e426f809f79845a1ec1aeb558f4 ] Do as in suspend, skip resume configuration steps if the device is already pm_runtime suspended. This avoids reconfiguring a device that is already in the correct low-power state and ensures that pm_runtime handles the power state transitions properly. Fixes: 31c24c1e93c3 ("iio: imu: inv_icm42600: add core of new inv_icm42600 driver") Signed-off-by: Sean Nyekjaer Link: https://patch.msgid.link/20250901-icm42pmreg-v3-3-ef1336246960@geanix.com Cc: Signed-off-by: Jonathan Cameron [ adjusted context to non-APEX suspend/resume implementation ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c @@ -680,17 +680,15 @@ EXPORT_SYMBOL_GPL(inv_icm42600_core_prob static int __maybe_unused inv_icm42600_suspend(struct device *dev) { struct inv_icm42600_state *st = dev_get_drvdata(dev); - int ret; + int ret = 0; mutex_lock(&st->lock); st->suspended.gyro = st->conf.gyro.mode; st->suspended.accel = st->conf.accel.mode; st->suspended.temp = st->conf.temp_en; - if (pm_runtime_suspended(dev)) { - ret = 0; + if (pm_runtime_suspended(dev)) goto out_unlock; - } /* disable FIFO data streaming */ if (st->fifo.on) { @@ -722,10 +720,13 @@ static int __maybe_unused inv_icm42600_r struct inv_icm42600_state *st = dev_get_drvdata(dev); struct inv_icm42600_timestamp *gyro_ts = iio_priv(st->indio_gyro); struct inv_icm42600_timestamp *accel_ts = iio_priv(st->indio_accel); - int ret; + int ret = 0; mutex_lock(&st->lock); + if (pm_runtime_suspended(dev)) + goto out_unlock; + ret = inv_icm42600_enable_regulator_vddio(st); if (ret) goto out_unlock;