File tree Expand file tree Collapse file tree 5 files changed +52
-2
lines changed
drivers/platform/x86/amd/pmf Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 7
7
obj-$(CONFIG_AMD_PMF) += amd-pmf.o
8
8
amd-pmf-objs := core.o acpi.o sps.o \
9
9
auto-mode.o cnqf.o \
10
- tee-if.o spc.o
10
+ tee-if.o spc.o pmf-quirks.o
Original file line number Diff line number Diff line change @@ -343,7 +343,10 @@ static int apmf_if_verify_interface(struct amd_pmf_dev *pdev)
343
343
if (err )
344
344
return err ;
345
345
346
- pdev -> supported_func = output .supported_functions ;
346
+ /* only set if not already set by a quirk */
347
+ if (!pdev -> supported_func )
348
+ pdev -> supported_func = output .supported_functions ;
349
+
347
350
dev_dbg (pdev -> dev , "supported functions:0x%x notifications:0x%x version:%u\n" ,
348
351
output .supported_functions , output .notification_mask , output .version );
349
352
Original file line number Diff line number Diff line change @@ -445,6 +445,7 @@ static int amd_pmf_probe(struct platform_device *pdev)
445
445
mutex_init (& dev -> lock );
446
446
mutex_init (& dev -> update_mutex );
447
447
448
+ amd_pmf_quirks_init (dev );
448
449
apmf_acpi_init (dev );
449
450
platform_set_drvdata (pdev , dev );
450
451
amd_pmf_dbgfs_register (dev );
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-2.0-or-later
2
+ /*
3
+ * AMD Platform Management Framework Driver Quirks
4
+ *
5
+ * Copyright (c) 2024, Advanced Micro Devices, Inc.
6
+ * All Rights Reserved.
7
+ *
8
+ * Author: Mario Limonciello <[email protected] >
9
+ */
10
+
11
+ #include <linux/dmi.h>
12
+
13
+ #include "pmf.h"
14
+
15
+ struct quirk_entry {
16
+ u32 supported_func ;
17
+ };
18
+
19
+ static struct quirk_entry quirk_no_sps_bug = {
20
+ .supported_func = 0x4003 ,
21
+ };
22
+
23
+ static const struct dmi_system_id fwbug_list [] = {
24
+ {}
25
+ };
26
+
27
+ void amd_pmf_quirks_init (struct amd_pmf_dev * dev )
28
+ {
29
+ const struct dmi_system_id * dmi_id ;
30
+ struct quirk_entry * quirks ;
31
+
32
+ dmi_id = dmi_first_match (fwbug_list );
33
+ if (!dmi_id )
34
+ return ;
35
+
36
+ quirks = dmi_id -> driver_data ;
37
+ if (quirks -> supported_func ) {
38
+ dev -> supported_func = quirks -> supported_func ;
39
+ pr_info ("Using supported funcs quirk to avoid %s platform firmware bug\n" ,
40
+ dmi_id -> ident );
41
+ }
42
+ }
43
+
Original file line number Diff line number Diff line change @@ -720,4 +720,7 @@ int apmf_check_smart_pc(struct amd_pmf_dev *pmf_dev);
720
720
void amd_pmf_populate_ta_inputs (struct amd_pmf_dev * dev , struct ta_pmf_enact_table * in );
721
721
void amd_pmf_dump_ta_inputs (struct amd_pmf_dev * dev , struct ta_pmf_enact_table * in );
722
722
723
+ /* Quirk infrastructure */
724
+ void amd_pmf_quirks_init (struct amd_pmf_dev * dev );
725
+
723
726
#endif /* PMF_H */
You can’t perform that action at this time.
0 commit comments