HID: amd_sfh: Increase sensor command timeout
authorBasavaraj Natikar <Basavaraj.Natikar@amd.com>
Wed, 14 Feb 2024 14:41:40 +0000 (20:11 +0530)
committerJiri Kosina <jkosina@suse.com>
Tue, 27 Feb 2024 14:13:55 +0000 (15:13 +0100)
During the initialization sensors may take some time to respond. Hence,
increase the sensor command timeouts in order to obtain status responses
within a maximum timeout.

Co-developed-by: Akshata MukundShetty <akshata.mukundshetty@amd.com>
Signed-off-by: Akshata MukundShetty <akshata.mukundshetty@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

index 2530fa98b568beed5c32fc3e714ed72575b3ef8f..8a4cd793d0217486bfe559b68a7a276ad7f0c2d3 100644 (file)
@@ -39,11 +39,11 @@ static int amd_sfh_wait_response_v2(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_
 {
        union cmd_response cmd_resp;
 
-       /* Get response with status within a max of 1600 ms timeout */
+       /* Get response with status within a max of 10 seconds timeout */
        if (!readl_poll_timeout(mp2->mmio + AMD_P2C_MSG(0), cmd_resp.resp,
                                (cmd_resp.response_v2.response == sensor_sts &&
                                cmd_resp.response_v2.status == 0 && (sid == 0xff ||
-                               cmd_resp.response_v2.sensor_id == sid)), 500, 1600000))
+                               cmd_resp.response_v2.sensor_id == sid)), 500, 10000000))
                return cmd_resp.response_v2.response;
 
        return SENSOR_DISABLED;