diff mbox series

[3/7,SRU,OEM-5.14] HID: amd_sfh: Handle amd_sfh work buffer in PM ops

Message ID 20220221055257.1168996-4-alex.hung@canonical.com
State New
Headers show
Series Not able to enter s2idle state on AMD platforms | expand

Commit Message

Alex Hung Feb. 21, 2022, 5:52 a.m. UTC
From: Basavaraj Natikar <Basavaraj.Natikar@amd.com>

BugLink: https://bugs.launchpad.net/bugs/1961121

Since in the current amd_sfh design the sensor data is periodically
obtained in the form of poll data, during the suspend/resume cycle,
scheduling a delayed work adds no value.

So, cancel the work and restart back during the suspend/resume cycle
respectively.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 0cf74235f4403b760a37f77271d2ca3424001ff9)
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 2a40f32a..6ecf1f0 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -285,6 +285,8 @@  static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
 		}
 	}
 
+	schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
+
 	return 0;
 }
 
@@ -306,6 +308,8 @@  static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
 		}
 	}
 
+	cancel_delayed_work_sync(&cl_data->work_buffer);
+
 	return 0;
 }