Skip to content

Commit d0452e3

Browse files
committed
Merge tag 'platform-drivers-x86-v6.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Ilpo Järvinen: - amd/pmc: Add quirk for MECHREVO Wujie 15X Pro - classmate-laptop: Add missing NULL pointer checks - hp-bioscfg: Skip empty attribute names - intel_telemetry: - Fix PSS event register mask - Fix swapped arrays in PSS output - intel/tpmi/plr: Make the file domain<n>/status writeable - intel/vsec: Add Nova Lake PUNIT support - lg-laptop: Recognize 2022-2025 models - panasonic-laptop: Fix sysfs group leak in error path - toshiba_haps: Fix memory leaks in add/remove routines * tag 'platform-drivers-x86-v6.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/intel/tpmi/plr: Make the file domain<n>/status writeable platform/x86: hp-bioscfg: Skip empty attribute names platform/x86: classmate-laptop: Add missing NULL pointer checks platform/x86: lg-laptop: Recognize 2022-2025 models platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro platform/x86: intel_telemetry: Fix PSS event register mask platform/x86: intel_telemetry: Fix swapped arrays in PSS output platform/x86/intel/vsec: Add Nova Lake PUNIT support platform/x86: toshiba_haps: Fix memory leaks in add/remove routines platform/x86: panasonic-laptop: Fix sysfs group leak in error path
2 parents 6bd9ed0 + 008bec8 commit d0452e3

10 files changed

Lines changed: 64 additions & 7 deletions

File tree

drivers/platform/x86/amd/pmc/pmc-quirks.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@ static const struct dmi_system_id fwbug_list[] = {
302302
DMI_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"),
303303
}
304304
},
305+
{
306+
.ident = "MECHREVO Wujie 15X Pro",
307+
.driver_data = &quirk_spurious_8042,
308+
.matches = {
309+
DMI_MATCH(DMI_BOARD_NAME, "WUJIE Series-X5SP4NAG"),
310+
}
311+
},
305312
{}
306313
};
307314

drivers/platform/x86/classmate-laptop.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,12 @@ static ssize_t cmpc_accel_sensitivity_show_v4(struct device *dev,
207207

208208
acpi = to_acpi_device(dev);
209209
inputdev = dev_get_drvdata(&acpi->dev);
210+
if (!inputdev)
211+
return -ENXIO;
212+
210213
accel = dev_get_drvdata(&inputdev->dev);
214+
if (!accel)
215+
return -ENXIO;
211216

212217
return sysfs_emit(buf, "%d\n", accel->sensitivity);
213218
}
@@ -224,7 +229,12 @@ static ssize_t cmpc_accel_sensitivity_store_v4(struct device *dev,
224229

225230
acpi = to_acpi_device(dev);
226231
inputdev = dev_get_drvdata(&acpi->dev);
232+
if (!inputdev)
233+
return -ENXIO;
234+
227235
accel = dev_get_drvdata(&inputdev->dev);
236+
if (!accel)
237+
return -ENXIO;
228238

229239
r = kstrtoul(buf, 0, &sensitivity);
230240
if (r)
@@ -256,7 +266,12 @@ static ssize_t cmpc_accel_g_select_show_v4(struct device *dev,
256266

257267
acpi = to_acpi_device(dev);
258268
inputdev = dev_get_drvdata(&acpi->dev);
269+
if (!inputdev)
270+
return -ENXIO;
271+
259272
accel = dev_get_drvdata(&inputdev->dev);
273+
if (!accel)
274+
return -ENXIO;
260275

261276
return sysfs_emit(buf, "%d\n", accel->g_select);
262277
}
@@ -273,7 +288,12 @@ static ssize_t cmpc_accel_g_select_store_v4(struct device *dev,
273288

274289
acpi = to_acpi_device(dev);
275290
inputdev = dev_get_drvdata(&acpi->dev);
291+
if (!inputdev)
292+
return -ENXIO;
293+
276294
accel = dev_get_drvdata(&inputdev->dev);
295+
if (!accel)
296+
return -ENXIO;
277297

278298
r = kstrtoul(buf, 0, &g_select);
279299
if (r)
@@ -302,6 +322,8 @@ static int cmpc_accel_open_v4(struct input_dev *input)
302322

303323
acpi = to_acpi_device(input->dev.parent);
304324
accel = dev_get_drvdata(&input->dev);
325+
if (!accel)
326+
return -ENXIO;
305327

306328
cmpc_accel_set_sensitivity_v4(acpi->handle, accel->sensitivity);
307329
cmpc_accel_set_g_select_v4(acpi->handle, accel->g_select);
@@ -549,7 +571,12 @@ static ssize_t cmpc_accel_sensitivity_show(struct device *dev,
549571

550572
acpi = to_acpi_device(dev);
551573
inputdev = dev_get_drvdata(&acpi->dev);
574+
if (!inputdev)
575+
return -ENXIO;
576+
552577
accel = dev_get_drvdata(&inputdev->dev);
578+
if (!accel)
579+
return -ENXIO;
553580

554581
return sysfs_emit(buf, "%d\n", accel->sensitivity);
555582
}
@@ -566,7 +593,12 @@ static ssize_t cmpc_accel_sensitivity_store(struct device *dev,
566593

567594
acpi = to_acpi_device(dev);
568595
inputdev = dev_get_drvdata(&acpi->dev);
596+
if (!inputdev)
597+
return -ENXIO;
598+
569599
accel = dev_get_drvdata(&inputdev->dev);
600+
if (!accel)
601+
return -ENXIO;
570602

571603
r = kstrtoul(buf, 0, &sensitivity);
572604
if (r)

drivers/platform/x86/hp/hp-bioscfg/bioscfg.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,11 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
696696
return ret;
697697
}
698698

699+
if (!str_value || !str_value[0]) {
700+
pr_debug("Ignoring attribute with empty name\n");
701+
goto pack_attr_exit;
702+
}
703+
699704
/* All duplicate attributes found are ignored */
700705
duplicate = kset_find_obj(temp_kset, str_value);
701706
if (duplicate) {

drivers/platform/x86/intel/plr_tpmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static int intel_plr_probe(struct auxiliary_device *auxdev, const struct auxilia
316316
snprintf(name, sizeof(name), "domain%d", i);
317317

318318
dentry = debugfs_create_dir(name, plr->dbgfs_dir);
319-
debugfs_create_file("status", 0444, dentry, &plr->die_info[i],
319+
debugfs_create_file("status", 0644, dentry, &plr->die_info[i],
320320
&plr_status_fops);
321321
}
322322

drivers/platform/x86/intel/telemetry/debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static int telem_pss_states_show(struct seq_file *s, void *unused)
449449
for (index = 0; index < debugfs_conf->pss_ltr_evts; index++) {
450450
seq_printf(s, "%-32s\t%u\n",
451451
debugfs_conf->pss_ltr_data[index].name,
452-
pss_s0ix_wakeup[index]);
452+
pss_ltr_blkd[index]);
453453
}
454454

455455
seq_puts(s, "\n--------------------------------------\n");
@@ -459,7 +459,7 @@ static int telem_pss_states_show(struct seq_file *s, void *unused)
459459
for (index = 0; index < debugfs_conf->pss_wakeup_evts; index++) {
460460
seq_printf(s, "%-32s\t%u\n",
461461
debugfs_conf->pss_wakeup[index].name,
462-
pss_ltr_blkd[index]);
462+
pss_s0ix_wakeup[index]);
463463
}
464464

465465
return 0;

drivers/platform/x86/intel/telemetry/pltdrv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ static int telemetry_setup(struct platform_device *pdev)
610610
/* Get telemetry Info */
611611
events = (read_buf & TELEM_INFO_SRAMEVTS_MASK) >>
612612
TELEM_INFO_SRAMEVTS_SHIFT;
613-
event_regs = read_buf & TELEM_INFO_SRAMEVTS_MASK;
613+
event_regs = read_buf & TELEM_INFO_NENABLES_MASK;
614614
if ((events < TELEM_MAX_EVENTS_SRAM) ||
615615
(event_regs < TELEM_MAX_EVENTS_SRAM)) {
616616
dev_err(&pdev->dev, "PSS:Insufficient Space for SRAM Trace\n");

drivers/platform/x86/intel/vsec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ static const struct intel_vsec_platform_info lnl_info = {
766766
#define PCI_DEVICE_ID_INTEL_VSEC_LNL_M 0x647d
767767
#define PCI_DEVICE_ID_INTEL_VSEC_PTL 0xb07d
768768
#define PCI_DEVICE_ID_INTEL_VSEC_WCL 0xfd7d
769+
#define PCI_DEVICE_ID_INTEL_VSEC_NVL 0xd70d
769770
static const struct pci_device_id intel_vsec_pci_ids[] = {
770771
{ PCI_DEVICE_DATA(INTEL, VSEC_ADL, &tgl_info) },
771772
{ PCI_DEVICE_DATA(INTEL, VSEC_DG1, &dg1_info) },
@@ -778,6 +779,7 @@ static const struct pci_device_id intel_vsec_pci_ids[] = {
778779
{ PCI_DEVICE_DATA(INTEL, VSEC_LNL_M, &lnl_info) },
779780
{ PCI_DEVICE_DATA(INTEL, VSEC_PTL, &mtl_info) },
780781
{ PCI_DEVICE_DATA(INTEL, VSEC_WCL, &mtl_info) },
782+
{ PCI_DEVICE_DATA(INTEL, VSEC_NVL, &mtl_info) },
781783
{ }
782784
};
783785
MODULE_DEVICE_TABLE(pci, intel_vsec_pci_ids);

drivers/platform/x86/lg-laptop.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,17 @@ static int acpi_add(struct acpi_device *device)
838838
case 'P':
839839
year = 2021;
840840
break;
841-
default:
841+
case 'Q':
842842
year = 2022;
843+
break;
844+
case 'R':
845+
year = 2023;
846+
break;
847+
case 'S':
848+
year = 2024;
849+
break;
850+
default:
851+
year = 2025;
843852
}
844853
break;
845854
default:

drivers/platform/x86/panasonic-laptop.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
10891089
PLATFORM_DEVID_NONE, NULL, 0);
10901090
if (IS_ERR(pcc->platform)) {
10911091
result = PTR_ERR(pcc->platform);
1092-
goto out_backlight;
1092+
goto out_sysfs;
10931093
}
10941094
result = device_create_file(&pcc->platform->dev,
10951095
&dev_attr_cdpower);
@@ -1105,6 +1105,8 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
11051105

11061106
out_platform:
11071107
platform_device_unregister(pcc->platform);
1108+
out_sysfs:
1109+
sysfs_remove_group(&device->dev.kobj, &pcc_attr_group);
11081110
out_backlight:
11091111
backlight_device_unregister(pcc->backlight);
11101112
out_input:

drivers/platform/x86/toshiba_haps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static int toshiba_haps_add(struct acpi_device *acpi_dev)
183183

184184
pr_info("Toshiba HDD Active Protection Sensor device\n");
185185

186-
haps = kzalloc(sizeof(struct toshiba_haps_dev), GFP_KERNEL);
186+
haps = devm_kzalloc(&acpi_dev->dev, sizeof(*haps), GFP_KERNEL);
187187
if (!haps)
188188
return -ENOMEM;
189189

0 commit comments

Comments
 (0)