Skip to content

Commit

Permalink
HID: amd_sfh: Handle amd_sfh work buffer in PM ops
Browse files Browse the repository at this point in the history
[ Upstream commit 0cf7423 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Basavaraj Natikar authored and gregkh committed Mar 8, 2022
1 parent 563431c commit 2144e45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
Expand Up @@ -290,6 +290,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;
}

Expand All @@ -312,6 +314,8 @@ static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
}
}

cancel_delayed_work_sync(&cl_data->work_buffer);

return 0;
}

Expand Down

0 comments on commit 2144e45

Please sign in to comment.