From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388488; b=JZMdPjaJtdP5QlntxLUNiOxGiDBUZ+gUaNgqfuMlqMGHrjwp8AooO5Kr/xA31nb4Y3S5 3n1K598DEk7IB4ZsjBp6RtAhpXgp7ENX/GXRWoje+PokYDxT9e/sMs/rN4vMPGSCZKgij rz3GJv3S35Ev/KplLsU38SwM5YdS+fWAEBRcp/QntfvDYKb7NFonigc8wIn+7sU81idW+ z/Z5EogcePUud6aQBuZ/PumSzIhBfyIyzwXHssiFsVhAJ8Ig5vkn6R1qAXbv9OLNqW+W+ a7x76B1vieV2/+MyZd3LaIqt2jLqKOXAKqREhV9Ebv6ex8R3YVbxh3aYPZ4HARArusg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388488; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=W2CRzlIYw0gPIGikTjTi3bxVi07yP4h7ynsb71A7GAQ=; b=qlqsHefE6EnJkAiImCBdnsf/YjbmnwRPDQmhcrD+dhkD0cSQNGmaqmR/r/zdUJjGcI++ Kj4misRMBUbQVhESoYqvqSms9CBmKnTvlbW63Lx89rdB0oT6eKze53Ih0uNM8CdKi1/lO ao9eo22XymZXLbmtWFuaTA2iuMusw1RVAE9JRw+EnvChyDfFAVhDvY3uDJWaRbaYipBa7 oLVCDRqp+LriQVEhrYZOfCa3q3I16+hGFNJY+kTogiSQBpDNDCLKKFceXNyCl1+f65Zub f0NVu9bjEg4DcAOTOu11W3ctc+q+/PWfelQWXXKD9qB5Lvpxt7Ix2Yybjc1gl54SHVg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=H2UR0oms; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0E27606A322; Fri, 4 Dec 2026 12:48:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=H2UR0oms Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CEC71F00933; Fri, 4 Dec 2026 12:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388488; bh=W2CRzlIYw0gPIGikTjTi3bxVi07yP4h7ynsb71A7GAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H2UR0omsOstSn+XGT/BG0V5V3u3wevhcDl6Zj2agm8zyHMjeCCbENX7evw+jh0hF8 pZ4vG3IlS0BLVG7OrXgU6jIcx9y9zHybNo5bFqZbmvEa7qpWIo6P6TCLE1Ziv0anrl BQg9YGQ2IR358KU2iDUFQVUEVFYwPgBJpCsjm+t0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiale Yao , Jonathan Cameron Subject: [PATCH 6.1 0636/1059] iio: imu: kmx61: reject duplicate event disable Date: Fri, 4 Dec 2026 19:02:47 +0900 Message-ID: <20261204100700.557186849@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiale Yao commit 9a60b35fe45801d45454e1efe90569c9cc6ea736 upstream. The IIO core does not filter duplicate writes to the event enable attribute. kmx61_write_event_config() already ignores repeated enable requests, but a repeated disable request still calls kmx61_set_power_state(data, false, KMX61_ACC), dropping a runtime PM reference that was not acquired for this request. This can underflow the runtime PM usage count and trigger a "Runtime PM usage count underflow" warning. Return early when the requested state already matches ev_enable_state. Fixes: fd3ae7a9f21c ("iio: imu: kmx61: Add support for any motion trigger") Signed-off-by: Jiale Yao Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/kmx61.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/imu/kmx61.c +++ b/drivers/iio/imu/kmx61.c @@ -946,7 +946,7 @@ static int kmx61_write_event_config(stru struct kmx61_data *data = kmx61_get_data(indio_dev); int ret = 0; - if (state && data->ev_enable_state) + if (state == data->ev_enable_state) return 0; mutex_lock(&data->lock);