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=1796385760; b=BmqxLYauEcHxAhaDEz8iSZxfe9+0X4cALIl4l5yNGtYYZ+SQvCQ+OifdszOVYpX8aS9L zb+alTwzskjf60pODPEYZTqDRlIWtQ5BLZHv7ziq1hLRMDB+DMW40Udo3in8eu3ay7Xzq Qr4705cJ3PFKAnuOBEM0/2Ms9ihoelTpExymALgfRavEDp6mbGclb7aD2SpWosTgBmgFr LJl5Y91Z/aOY0ZIwqZrXwhLhWUQiDlXou1+SNVjxHnviQyrsyFzMidpJQpazb1AO5XxvJ hqOlmEA4kbHjeRNOuLsDEfTHrKETcJQOV/uwdQ8vRiDISZctK4FnWBcgu8hGb0CZjrA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385760; 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=OiwxCoRYCxmaYiSQVb5BjJAeOg+1t8+t2cuKr5VlEUk=; b=dRMxgNdv/adwGDQK9q0DRZyiubfxHob010hx7KQhV0pOVXEGDAskHIn5QvVdAamjqdBZ Kzchgs5CknQbJnSOy6rJA05TgQVlUCHOQ7KqbWUUiP722yuNuUNDh3nQR5XLCWBbRVh5Q SAMX/NXFYKMFpOUZXB9Lp4IU6A4/AI3sfdwsSuosgsC91F9y+N4NRS7FmoNtQxYMViZ0M VRIisBgH4YAJc/yyvhWFoG9gRo34rBVvB7tajZT/O+lHIiz3XqfOARDS3Cnp7Oj5biy3t 6EF/tIdz/zuG6kQbtI/sEb474wbcAFProt4BW8GPeAqYyXRk6e/NK9QPckRcFVpLnjA== 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="U/IVL3/Q"; 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 63BD0606A32C; Fri, 4 Dec 2026 12:02:40 +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=U/IVL3/Q Received: by smtp.kernel.org (Postfix) with ESMTPSA id D36F81F000CE; Fri, 4 Dec 2026 12:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385760; bh=OiwxCoRYCxmaYiSQVb5BjJAeOg+1t8+t2cuKr5VlEUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=U/IVL3/Q1qaqav99Y44e8x5wdJquGNgz8O41wIL0ZMtWrM9zklK/Ghyh6ScEO4YBo 12t7imydEljY9DXyWXyGbbz7WHCUtWmP/k0ZpUvAUdp0CLE/R8ULaJnbq8oqSp6jHD 329MDSNprlW3hmo7D0Y/VNk1xWO6ZIBbvOSxeTsY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiale Yao , Jonathan Cameron Subject: [PATCH 6.6 0684/1167] iio: gyro: bmg160: reject duplicate event disable Date: Fri, 4 Dec 2026 19:01:51 +0900 Message-ID: <20261204100719.882594545@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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 @@ -766,7 +766,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);