Skip to content

Commit

Permalink
HID: amd_sfh: Increase sensor command timeout for SFH1.1
Browse files Browse the repository at this point in the history
[ Upstream commit 571dc8f ]

The initialization of SFH1.1 sensors may take some time. Hence, increase
sensor command timeouts in order to obtain status responses within a
maximum timeout.

Fixes: 93ce5e0 ("HID: amd_sfh: Implement SFH1.1 functionality")
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 May 11, 2023
1 parent 2ccae85 commit 86a06ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ static int amd_sfh_wait_response(struct amd_mp2_dev *mp2, u8 sid, u32 cmd_id)
{
struct sfh_cmd_response cmd_resp;

/* Get response with status within a max of 1600 ms timeout */
/* Get response with status within a max of 10000 ms timeout */
if (!readl_poll_timeout(mp2->mmio + AMD_P2C_MSG(0), cmd_resp.resp,
(cmd_resp.response.response == 0 &&
cmd_resp.response.cmd_id == cmd_id && (sid == 0xff ||
cmd_resp.response.sensor_id == sid)), 500, 1600000))
cmd_resp.response.sensor_id == sid)), 500, 10000000))
return cmd_resp.response.response;

return -1;
Expand Down

0 comments on commit 86a06ac

Please sign in to comment.