]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/linux/linux-6.0.7-platform-x86-amd-Fix-pmc-compile-dependency-errors.patch
checkrootfiles: fix checks on hosts with newer grep
[people/pmueller/ipfire-2.x.git] / src / patches / linux / linux-6.0.7-platform-x86-amd-Fix-pmc-compile-dependency-errors.patch
CommitLineData
65352552
AF
1From: Yupeng Li <liyupeng@zbhlos.com>
2To: Shyam-sundar.S-k@amd.com, hdegoede@redhat.com, markgross@kernel.org
3Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org,
4 caizp2008@163.com, Yupeng Li <liyupeng@zbhlos.com>
5Subject: [PATCH 1/1] platform/x86/amd: Fix pmc compile dependency errors.
6Date: Wed, 26 Oct 2022 15:25:31 +0800
7
8When disabled CONFIG_SUSPEND and CONFIG_DEBUG_FS, get_metrics_table
9and amd_pmc_idlemask_read is defined under two conditions of this,
10pmc build with implicit declaration of function error.Some build error
11messages are as follows:
12
13 CC [M] drivers/platform/x86/amd/pmc.o
14drivers/platform/x86/amd/pmc.c: In function ‘smu_fw_info_show’:
15drivers/platform/x86/amd/pmc.c:436:6: error: implicit declaration of function ‘get_metrics_table’ [-Werror=implicit-function-declaration]
16 436 | if (get_metrics_table(dev, &table))
17 | ^~~~~~~~~~~~~~~~~
18drivers/platform/x86/amd/pmc.c: In function ‘amd_pmc_idlemask_show’:
19drivers/platform/x86/amd/pmc.c:508:8: error: implicit declaration of function ‘amd_pmc_idlemask_read’; did you mean ‘amd_pmc_idlemask_show’? [-Werror=implicit-function-declaration]
20 508 | rc = amd_pmc_idlemask_read(dev, NULL, s);
21 | ^~~~~~~~~~~~~~~~~~~~~
22 | amd_pmc_idlemask_show
23cc1: some warnings being treated as errors
24
25Signed-off-by: Yupeng Li <liyupeng@zbhlos.com>
26Reviewed-by: Caicai <caizp2008@163.com>
27---
28 drivers/platform/x86/amd/pmc.c | 5 ++++-
29 1 file changed, 4 insertions(+), 1 deletion(-)
30
31diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c
32index ce859b300712..2b08039921b8 100644
33--- a/drivers/platform/x86/amd/pmc.c
34+++ b/drivers/platform/x86/amd/pmc.c
35@@ -433,8 +433,10 @@ static int smu_fw_info_show(struct seq_file *s, void *unused)
36 struct smu_metrics table;
37 int idx;
38
39+#if defined(CONFIG_SUSPEND) || defined(CONFIG_DEBUG_FS)
40 if (get_metrics_table(dev, &table))
41 return -EINVAL;
42+#endif
43
44 seq_puts(s, "\n=== SMU Statistics ===\n");
45 seq_printf(s, "Table Version: %d\n", table.table_version);
46@@ -503,11 +505,12 @@ static int amd_pmc_idlemask_show(struct seq_file *s, void *unused)
47 if (rc)
48 return rc;
49 }
50-
51 if (dev->major > 56 || (dev->major >= 55 && dev->minor >= 37)) {
52+#if defined(CONFIG_SUSPEND) || defined(CONFIG_DEBUG_FS)
53 rc = amd_pmc_idlemask_read(dev, NULL, s);
54 if (rc)
55 return rc;
56+#endif
57 } else {
58 seq_puts(s, "Unsupported SMU version for Idlemask\n");
59 }
60--
612.34.1
62
63