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=1796388576; b=xwCt5CtjCBlmFF6ZkS6cJlUWjVdkjiQHncxMgSO8ps5OUU1qvS4xT7gZFrtgVcfhGc9V KrxcjQ+TNFu/wOV8zH6615KVlLCV/98PZA/C5SyzNeoNSVviqInwN0fBhCf9a+0flvskx bxzKFGOzEEzaqDLwHv5Nds1Vsu+w1jbUGI9Vy5kYVVcJDe+HHIHJv5DBHjMqOC69yajSt 2OHUBP2QN27WkURIZIixSVnBW2jmECgKea2kRqi7al7oP3ZfYagr0wzChMemRFRTiNxJZ rnvwZGHwHRscExm7M40VmjMEndxpFIWL4D+q/+NLIb8eWxwcqZsS2pe1SNzkY6N+oQA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388576; 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=7e+MpE96X9tuQ5HEVPMI0Ecv72O1UKyO+snDBxE6gtE=; b=pM6UkLLqE/EzPj2sjRN+d0PZQDjuQlH9Co5aCVzrhKq9qGaT0s1DYZ+YdE7jrSA3umz/ Cvq6Q8OtsW4sg1N2uilQWk7eiGHlpZ+YpZ6vGmqrZm+pXONyQY9rLyYpi3CVoQ4A7FYsj j3pHkRJNBdlYoIFQc58NTGLHqptUIzPjIWQzqUBi6S79ca9/iVVjs9bzuOdL6PDqrtq/D wFkq2NW1KvLIzBcbXa6KDBUTUIiezwnCmpxofDzYyBEAF8berMcqFTjenP5JdVtqgzKrV qDN9NnkA1Mn7hflRSB6we0w+goVCpZsNlPKpSyT8wnBzDd+HrUVhy4ZreTOXuZnht2w== 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=wQyexrTv; 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 56443606A322; Fri, 4 Dec 2026 12:49:36 +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=wQyexrTv Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC0861F000C2; Fri, 4 Dec 2026 12:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388576; bh=7e+MpE96X9tuQ5HEVPMI0Ecv72O1UKyO+snDBxE6gtE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wQyexrTv5h0mpQFa+MX7Uijcr9g+82JAOjOrbEuKbRcMjGjJ3eg/JMisZAE1Ra/UL px/vozUYbFAYf51yojaWHGO5BQWtOIiIMrVktzO54ZsNc3qNguyp5/AGNQLxKYWiua CNqf1ne98jUeuAc/409U9azwkoyPatOA6BRf9bec= 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 0631/1059] iio: gyro: bmg160: reject duplicate event disable Date: Fri, 4 Dec 2026 19:02:42 +0900 Message-ID: <20261204100700.435368734@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: stable@vger.kernel.org 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 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 @@ -767,7 +767,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);