Skip to content

Commit 83158b2

Browse files
committed
Merge tag 'platform-drivers-x86-v6.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Ilpo Järvinen: "Fixes and new HW support. The diff is a bit larger than I'd prefer at this point due to unwinding the amd/pmf driver's error handling properly instead of calling a deinit function that was a can full of worms. Summary: - amd/pmf: - Fix error handling in amd_pmf_init_smart_pc() - Fix missing hidden options for Smart PC - surface: aggregator_registry: Add Support for Surface Pro 11" * tag 'platform-drivers-x86-v6.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: MAINTAINERS: Update Ike Panhc's email address platform/x86/amd: pmf: Fix missing hidden options for Smart PC platform/surface: aggregator_registry: Add Support for Surface Pro 11 platform/x86/amd/pmf: fix cleanup in amd_pmf_init_smart_pc()
2 parents 6efcfe1 + 03fc0a2 commit 83158b2

File tree

5 files changed

+33
-13
lines changed

5 files changed

+33
-13
lines changed

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ Henrik Rydberg <[email protected]>
281281
Herbert Xu <[email protected]>
282282
283283
284+
284285
285286
286287
Jacob Shin <[email protected]>

MAINTAINERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -11141,7 +11141,7 @@ S: Maintained
1114111141
F: drivers/i2c/busses/i2c-icy.c
1114211142

1114311143
IDEAPAD LAPTOP EXTRAS DRIVER
11144-
M: Ike Panhc <ike.pan@canonical.com>
11144+
M: Ike Panhc <ikepanhc@gmail.com>
1114511145
1114611146
S: Maintained
1114711147
W: http://launchpad.net/ideapad-laptop

drivers/platform/surface/surface_aggregator_registry.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ static const struct software_node *ssam_node_group_sp8[] = {
371371
NULL,
372372
};
373373

374-
/* Devices for Surface Pro 9 (Intel/x86) and 10 */
374+
/* Devices for Surface Pro 9, 10 and 11 (Intel/x86) */
375375
static const struct software_node *ssam_node_group_sp9[] = {
376376
&ssam_node_root,
377377
&ssam_node_hub_kip,
@@ -430,6 +430,9 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
430430
/* Surface Pro 10 */
431431
{ "MSHW0510", (unsigned long)ssam_node_group_sp9 },
432432

433+
/* Surface Pro 11 */
434+
{ "MSHW0583", (unsigned long)ssam_node_group_sp9 },
435+
433436
/* Surface Book 2 */
434437
{ "MSHW0107", (unsigned long)ssam_node_group_gen5 },
435438

drivers/platform/x86/amd/pmf/spc.c

+2
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,14 @@ static int amd_pmf_get_slider_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_
219219

220220
switch (dev->current_profile) {
221221
case PLATFORM_PROFILE_PERFORMANCE:
222+
case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
222223
val = TA_BEST_PERFORMANCE;
223224
break;
224225
case PLATFORM_PROFILE_BALANCED:
225226
val = TA_BETTER_PERFORMANCE;
226227
break;
227228
case PLATFORM_PROFILE_LOW_POWER:
229+
case PLATFORM_PROFILE_QUIET:
228230
val = TA_BEST_BATTERY;
229231
break;
230232
default:

drivers/platform/x86/amd/pmf/tee-if.c

+25-11
Original file line numberDiff line numberDiff line change
@@ -510,18 +510,18 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev)
510510

511511
ret = amd_pmf_set_dram_addr(dev, true);
512512
if (ret)
513-
goto error;
513+
goto err_cancel_work;
514514

515515
dev->policy_base = devm_ioremap_resource(dev->dev, dev->res);
516516
if (IS_ERR(dev->policy_base)) {
517517
ret = PTR_ERR(dev->policy_base);
518-
goto error;
518+
goto err_free_dram_buf;
519519
}
520520

521521
dev->policy_buf = kzalloc(dev->policy_sz, GFP_KERNEL);
522522
if (!dev->policy_buf) {
523523
ret = -ENOMEM;
524-
goto error;
524+
goto err_free_dram_buf;
525525
}
526526

527527
memcpy_fromio(dev->policy_buf, dev->policy_base, dev->policy_sz);
@@ -531,13 +531,13 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev)
531531
dev->prev_data = kzalloc(sizeof(*dev->prev_data), GFP_KERNEL);
532532
if (!dev->prev_data) {
533533
ret = -ENOMEM;
534-
goto error;
534+
goto err_free_policy;
535535
}
536536

537537
for (i = 0; i < ARRAY_SIZE(amd_pmf_ta_uuid); i++) {
538538
ret = amd_pmf_tee_init(dev, &amd_pmf_ta_uuid[i]);
539539
if (ret)
540-
return ret;
540+
goto err_free_prev_data;
541541

542542
ret = amd_pmf_start_policy_engine(dev);
543543
switch (ret) {
@@ -550,27 +550,41 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev)
550550
status = false;
551551
break;
552552
default:
553-
goto error;
553+
ret = -EINVAL;
554+
amd_pmf_tee_deinit(dev);
555+
goto err_free_prev_data;
554556
}
555557

556558
if (status)
557559
break;
558560
}
559561

560-
if (!status && !pb_side_load)
561-
goto error;
562+
if (!status && !pb_side_load) {
563+
ret = -EINVAL;
564+
goto err_free_prev_data;
565+
}
562566

563567
if (pb_side_load)
564568
amd_pmf_open_pb(dev, dev->dbgfs_dir);
565569

566570
ret = amd_pmf_register_input_device(dev);
567571
if (ret)
568-
goto error;
572+
goto err_pmf_remove_pb;
569573

570574
return 0;
571575

572-
error:
573-
amd_pmf_deinit_smart_pc(dev);
576+
err_pmf_remove_pb:
577+
if (pb_side_load && dev->esbin)
578+
amd_pmf_remove_pb(dev);
579+
amd_pmf_tee_deinit(dev);
580+
err_free_prev_data:
581+
kfree(dev->prev_data);
582+
err_free_policy:
583+
kfree(dev->policy_buf);
584+
err_free_dram_buf:
585+
kfree(dev->buf);
586+
err_cancel_work:
587+
cancel_delayed_work_sync(&dev->pb_work);
574588

575589
return ret;
576590
}

0 commit comments

Comments
 (0)