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=1795620608; b=D4eR/Xw8BLOylY/388NNofkhSNe72hsy/qDyindxP3CpQ5MGFAitxJfojs2vrd4T8btA 5LXkgWHwlDDbm7vhR3Sk4EZ7T0X1s+8AwhKu25O1k0MGcIF/P+QV/ETKYuslN9w5Vu5XL 3d4KIAGFDBCWTdfF/ImLMH0hIADjIRRuD7OXZuy4UTSGPybN5XMUJZG5nM/zXWORdwtEf GKLbXsVJ1lYbt0CWMbLh6l+QHX06mS4AWTneZ7dGjKfChu3PRr+7VojnkyaaoCoUozkqL vGj1thnadngWb/SbvPHkXHVAuTASAEzRJN+Ibk5sV0s6sgZhpTUsvJiX05a6QWQlXSw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795620608; 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=+zncWkmGse8hBd2gjkEi9kMAjNmHcRHwKleEnVfneAM=; b=Kw3uSUUvbF+KxnBGU7cSK2f3y6fKPLVwYpXGB99Bj3K04K7JlJmahtT+KXWpR6fZKo0V 5n2O8IExHaLM/3Sqej4yZcPtMm5E2ozQE4UhfY1kiGdSchWff0+2vQmklHjcVtwNkicyv fCx3TbQn8fiEyAIOe+OZ6uxhtC4IC5X3rAHA6NZ3MMkQvDAyPSeS9r5gY7fAHW5hausWr k/BZBPWOJDKM66YNERuLaSiCez6z5YnBWrauccQ/xWYQERrCg1pKZ71RbuvxCaBYZXYSE zx7xT1+fYMm8IkavKyIpwoEZK5QvdkYO6UVasYCU4GYGDXY7lcWyQLfp6EyrglX+PiQ== 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=JFifOGiu; 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 5AA82606A323; Wed, 25 Nov 2026 15:30: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=JFifOGiu Received: by smtp.kernel.org (Postfix) with ESMTPSA id A762B1F000C0; Wed, 25 Nov 2026 15:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795620608; bh=+zncWkmGse8hBd2gjkEi9kMAjNmHcRHwKleEnVfneAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JFifOGiufYSym8derru78gPz351CPelt1wHp9NSgMNcjE45c/P0U7YobGpCIhK+x8 1yuAGM3tkQaM+RR+p0auipZSdvZ4In8jDHUxq0eGFFM3MZDvdiGLse5MC7mnXn40qm kPvcbyTbCN+uHTY2mJ7exroahv6ovqZGc3A2lzYY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiale Yao , Jonathan Cameron Subject: [PATCH 7.3 0972/1005] iio: gyro: bmg160: reject duplicate event disable Date: Wed, 25 Nov 2026 15:38:30 +0100 Message-ID: <20261125143844.434006698@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261125143821.729802100@linuxfoundation.org> References: <20261125143821.729802100@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 7.3-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 @@ -761,7 +761,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);