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=1795704793; b=SPV51AxRxPr7Gm29s4qZFDotWOZU67yeXfuKd4r9VMqCiOKn0jwTYDFwzrThRbm9mXBB j8ypGCEdNJp6Nx5fnSOwnGq3FnY4vjJ93+Fq3h9p7jea2U1mwEUsad32hy8jVyzEJ4Fjj hWLI0+e6STrxulfFffzO98EzfE/sdjw9bXcjBFYvJgFZxCIOLmRT5S5QukSyweyh6qsWC LB9EMsb/zbCyvbnd0KWeQ/bKcHD0ppLM66kP8ZAW4mSJrgoKiFla/A5CNNErxUWjhtui6 O6HX4SwbayyhwFMKw9kXGg4zEmhXmZodcPqGj34xKch8NNIyQIqwncKt++r8oGiraFQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795704793; 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=SRZqPH9oNvWbHHEEf8ZjHqehB3DlB+d/s2noM9ZmBpE=; b=taxQTjaXhnO5/kUpZdz6QL5vzic4yWZiRhKzyeHC0UiwdyQmUOelRCnng89hIfOJqaqb JgH9LxKGBrvR/Vr9K0kTpXANvfVh5AV+bBQzjAgezBlusClFzRKoxumkY4YlZDBnuBvbV 3JSrAc7qjs35jc9U6mfpTsn+LcinNtTQDkgoQugidfseD4fITjrKkVEJg2EG3Q/SqgxWt EBa8slJgb+5p6RjaBoUuEJlE0B7Pa3Z/YmVJsXiq430WjvnkYa2luS+4sWOfGrCFH5nXc tZ6/Md8yo5mL2nkUG3KZQsMhSkom4vPBRy3Dv/8YW/F7qlhZVHYbz/VkWPaf38tXb8g== 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=NEIWkTzr; 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 913DB606A6A3; Thu, 26 Nov 2026 14:53:13 +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=NEIWkTzr Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0C991F000E0; Thu, 26 Nov 2026 14:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795704793; bh=SRZqPH9oNvWbHHEEf8ZjHqehB3DlB+d/s2noM9ZmBpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NEIWkTzrkzpJyDSQwkxqEHpztpssxrGLJDrlju7jTTv2yRo1wChqhGcr3Oq1JgMXx +VPf93SHoK422SB1L+xtxYh890WDPaRTgN5aH8ipTmPrrKeSIujsV0C2mrtDsbK941 ZSf/9SfgPFmEii6P8mK7qtjqpRMDFyE0FROJkxT0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiale Yao , Jonathan Cameron Subject: [PATCH 5.10 246/265] iio: gyro: bmg160: reject duplicate event disable Date: Thu, 26 Nov 2026 15:39:36 +0100 Message-ID: <20261126143622.452720472@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261126143605.076581697@linuxfoundation.org> References: <20261126143605.076581697@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 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiale Yao commit d0c8bd5d18a492d64d05482f4b1700e14df7ff84 upstream. The IIO core does not filter duplicate writes to the event enable attribute. bmg160_write_event_config() already ignores repeated enable requests, but a repeated disable request still calls bmg160_set_power_state(data, false), 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: 22b46c45fb9b ("iio:gyro:bmg160 Gyro Sensor driver") Signed-off-by: Jiale Yao Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/gyro/bmg160_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -765,7 +765,7 @@ static int bmg160_write_event_config(str struct bmg160_data *data = iio_priv(indio_dev); int ret; - if (state && data->ev_enable_state) + if (state == data->ev_enable_state) return 0; mutex_lock(&data->mutex);