lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119100331.2594-3-xiang.ye@intel.com>
Date:   Thu, 19 Nov 2020 18:03:29 +0800
From:   Ye Xiang <xiang.ye@...el.com>
To:     jikos@...nel.org, jic23@...nel.org,
        srinivas.pandruvada@...ux.intel.com
Cc:     linux-input@...r.kernel.org, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, Ye Xiang <xiang.ye@...el.com>
Subject: [PATCH v2 2/4] iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal

To avoid pm_runtime_disable called repeatedly by hid sensor drivers,
decrease runtime pm enable count after call it.

Signed-off-by: Ye Xiang <xiang.ye@...el.com>
---
 drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index ff375790b7e8..30340abcbc8d 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -227,8 +227,10 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
 void hid_sensor_remove_trigger(struct iio_dev *indio_dev,
 			       struct hid_sensor_common *attrb)
 {
-	if (atomic_read(&attrb->runtime_pm_enable))
+	if (atomic_read(&attrb->runtime_pm_enable)) {
 		pm_runtime_disable(&attrb->pdev->dev);
+		atomic_dec(&attrb->runtime_pm_enable);
+	}
 
 	pm_runtime_set_suspended(&attrb->pdev->dev);
 	pm_runtime_put_noidle(&attrb->pdev->dev);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ