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 2953F33507C; Fri, 17 Oct 2025 15:37:56 +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=1760715476; cv=none; b=D4OdHGQcBgJSZTIBoA6XtxVuRwv8CyioOv9MocwT//RON3Yxwo6bt4uFIiJK/JwwBhTLeZ/RneaRxBDYFvw1uIp5vE5uvapdjoL4YLVFrbHBegXr8xY4mDVKSs4lxpBOcaHDJz/NN3akf8UGnZLE38DkKd34SojM2HohjmVIKn4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760715476; c=relaxed/simple; bh=XdTQ1Hs3Ga6T4rPnVhYDBEvvzNqAQ9TSKQPJHs1Y2PM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=leQsE6/U3VrLzGSmR01WM1eclBM1EazzaO+vP12NPoHLCh1IJttauc7T3CURTSB/lPefSgVfY6CLn+MdhLxP5KZi+uX3shTIBZa+E9d+IL1wDk7QMhgaZ88PpnsRPn3D2+H6mdFwJ4tXmhEHUu0Zy18Ka0VpdzdwpITY1I/kbrU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DszGWmEy; 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="DszGWmEy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BFE2C4CEE7; Fri, 17 Oct 2025 15:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760715475; bh=XdTQ1Hs3Ga6T4rPnVhYDBEvvzNqAQ9TSKQPJHs1Y2PM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DszGWmEyiiwrdxZOvX8ixVqn/XuiV1zt4TT68bDRmwmHriTMejSJDgkt0QExx48gn K2/EsuzjZVcSlyL6qAzGYeuZdBpfL7MdUSmArluC5vHFp58JCckwUrUW6gYGq2SeRv aeQgbImR54U5e+3y7/RpXaf3w4dWWtneh51jRD40= 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 Subject: [PATCH 6.17 228/371] iio: imu: inv_icm42600: Avoid configuring if already pm_runtime suspended Date: Fri, 17 Oct 2025 16:53:23 +0200 Message-ID: <20251017145210.334110623@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017145201.780251198@linuxfoundation.org> References: <20251017145201.780251198@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.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean Nyekjaer commit 466f7a2fef2a4e426f809f79845a1ec1aeb558f4 upstream. 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 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 @@ -837,17 +837,15 @@ static int inv_icm42600_suspend(struct d struct device *accel_dev; bool wakeup; int accel_conf; - 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) { @@ -900,10 +898,13 @@ static int inv_icm42600_resume(struct de struct inv_icm42600_sensor_state *accel_st = iio_priv(st->indio_accel); struct device *accel_dev; bool wakeup; - int ret; + int ret = 0; mutex_lock(&st->lock); + if (pm_runtime_suspended(dev)) + goto out_unlock; + /* check wakeup capability */ accel_dev = &st->indio_accel->dev; wakeup = st->apex.on && device_may_wakeup(accel_dev);