Skip to content

Commit c1db007

Browse files
basuamdJiri Kosina
authored andcommitted
HID: amd_sfh: Avoid disabling the interrupt
HP ProBook x360 435 G7 using older version of firmware which doesn't support disabling the interrupt for all commands. Hence avoid disabling the interrupt for that particular model. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218104 Fixes: b300667 ("HID: amd_sfh: Disable the interrupt for all command") Co-developed-by: Akshata MukundShetty <[email protected]> Signed-off-by: Akshata MukundShetty <[email protected]> Signed-off-by: Basavaraj Natikar <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent bbf0dec commit c1db007

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ static int sensor_mask_override = -1;
3535
module_param_named(sensor_mask, sensor_mask_override, int, 0444);
3636
MODULE_PARM_DESC(sensor_mask, "override the detected sensors mask");
3737

38+
static bool intr_disable = true;
39+
3840
static int amd_sfh_wait_response_v2(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts)
3941
{
4042
union cmd_response cmd_resp;
@@ -55,7 +57,7 @@ static void amd_start_sensor_v2(struct amd_mp2_dev *privdata, struct amd_mp2_sen
5557

5658
cmd_base.ul = 0;
5759
cmd_base.cmd_v2.cmd_id = ENABLE_SENSOR;
58-
cmd_base.cmd_v2.intr_disable = 1;
60+
cmd_base.cmd_v2.intr_disable = intr_disable;
5961
cmd_base.cmd_v2.period = info.period;
6062
cmd_base.cmd_v2.sensor_id = info.sensor_idx;
6163
cmd_base.cmd_v2.length = 16;
@@ -73,7 +75,7 @@ static void amd_stop_sensor_v2(struct amd_mp2_dev *privdata, u16 sensor_idx)
7375

7476
cmd_base.ul = 0;
7577
cmd_base.cmd_v2.cmd_id = DISABLE_SENSOR;
76-
cmd_base.cmd_v2.intr_disable = 1;
78+
cmd_base.cmd_v2.intr_disable = intr_disable;
7779
cmd_base.cmd_v2.period = 0;
7880
cmd_base.cmd_v2.sensor_id = sensor_idx;
7981
cmd_base.cmd_v2.length = 16;
@@ -87,7 +89,7 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata)
8789
union sfh_cmd_base cmd_base;
8890

8991
cmd_base.cmd_v2.cmd_id = STOP_ALL_SENSORS;
90-
cmd_base.cmd_v2.intr_disable = 1;
92+
cmd_base.cmd_v2.intr_disable = intr_disable;
9193
cmd_base.cmd_v2.period = 0;
9294
cmd_base.cmd_v2.sensor_id = 0;
9395

@@ -292,6 +294,26 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
292294
return 0;
293295
}
294296

297+
static int mp2_disable_intr(const struct dmi_system_id *id)
298+
{
299+
intr_disable = false;
300+
return 0;
301+
}
302+
303+
static const struct dmi_system_id dmi_sfh_table[] = {
304+
{
305+
/*
306+
* https://bugzilla.kernel.org/show_bug.cgi?id=218104
307+
*/
308+
.callback = mp2_disable_intr,
309+
.matches = {
310+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
311+
DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook x360 435 G7"),
312+
},
313+
},
314+
{}
315+
};
316+
295317
static const struct dmi_system_id dmi_nodevs[] = {
296318
{
297319
/*
@@ -315,6 +337,8 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
315337
if (dmi_first_match(dmi_nodevs))
316338
return -ENODEV;
317339

340+
dmi_check_system(dmi_sfh_table);
341+
318342
privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
319343
if (!privdata)
320344
return -ENOMEM;

0 commit comments

Comments
 (0)