HID: amd_sfh: Fix SRA sensor when it's the only sensor
JIRA: https://issues.redhat.com/browse/RHEL-105420 commit 0cc2effbc8f522af6b9d871cd27678e6aed9d56c Author: Mario Limonciello <mario.limonciello@amd.com> Date: Mon Apr 21 16:32:09 2025 -0500 HID: amd_sfh: Fix SRA sensor when it's the only sensor On systems that only have an SRA sensor connected to SFH the sensor doesn't get enabled due to a bad optimization condition of breaking the sensor walk loop. This optimization is unnecessary in the first place because if there is only one device then the loop only runs once. Drop the condition and explicitly mark sensor as enabled. Reported-by: Yijun Shen <Yijun.Shen@dell.com> Tested-By: Yijun Shen <Yijun_Shen@Dell.com> Fixes: d1c444b47100d ("HID: amd_sfh: Add support to export device operating states") Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: David Arcari <darcari@redhat.com>
This commit is contained in:
parent
8fdadbdf17
commit
749efc61d7
|
@ -134,9 +134,6 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
|
|||
for (i = 0; i < cl_data->num_hid_devices; i++) {
|
||||
cl_data->sensor_sts[i] = SENSOR_DISABLED;
|
||||
|
||||
if (cl_data->num_hid_devices == 1 && cl_data->sensor_idx[0] == SRA_IDX)
|
||||
break;
|
||||
|
||||
if (cl_data->sensor_idx[i] == SRA_IDX) {
|
||||
info.sensor_idx = cl_data->sensor_idx[i];
|
||||
writel(0, privdata->mmio + amd_get_p2c_val(privdata, 0));
|
||||
|
@ -145,8 +142,10 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
|
|||
(privdata, cl_data->sensor_idx[i], ENABLE_SENSOR);
|
||||
|
||||
cl_data->sensor_sts[i] = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED;
|
||||
if (cl_data->sensor_sts[i] == SENSOR_ENABLED)
|
||||
if (cl_data->sensor_sts[i] == SENSOR_ENABLED) {
|
||||
cl_data->is_any_sensor_enabled = true;
|
||||
privdata->dev_en.is_sra_present = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue