summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/amd/pmf/pmf-quirks.c
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2024-04-10 16:09:55 +0200
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2024-04-16 14:17:31 +0200
commited13f622bcd594d6cefd6239b1722ed8b84ba98f (patch)
treef12a575c1e6f521249a1de2d8f7764fa4509acd1 /drivers/platform/x86/amd/pmf/pmf-quirks.c
parentplatform/x86/amd: pmf: Decrease error message to debug (diff)
downloadlinux-ed13f622bcd594d6cefd6239b1722ed8b84ba98f.tar.xz
linux-ed13f622bcd594d6cefd6239b1722ed8b84ba98f.zip
platform/x86/amd: pmf: Add infrastructure for quirking supported funcs
In the event of a BIOS bug add infrastructure that will be utilized to override the return value for supported_funcs to avoid enabling features. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20240410140956.385-2-mario.limonciello@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/amd/pmf/pmf-quirks.c')
-rw-r--r--drivers/platform/x86/amd/pmf/pmf-quirks.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/platform/x86/amd/pmf/pmf-quirks.c b/drivers/platform/x86/amd/pmf/pmf-quirks.c
new file mode 100644
index 000000000000..9f3790eaaa30
--- /dev/null
+++ b/drivers/platform/x86/amd/pmf/pmf-quirks.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * AMD Platform Management Framework Driver Quirks
+ *
+ * Copyright (c) 2024, Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Author: Mario Limonciello <mario.limonciello@amd.com>
+ */
+
+#include <linux/dmi.h>
+
+#include "pmf.h"
+
+struct quirk_entry {
+ u32 supported_func;
+};
+
+static struct quirk_entry quirk_no_sps_bug = {
+ .supported_func = 0x4003,
+};
+
+static const struct dmi_system_id fwbug_list[] = {
+ {}
+};
+
+void amd_pmf_quirks_init(struct amd_pmf_dev *dev)
+{
+ const struct dmi_system_id *dmi_id;
+ struct quirk_entry *quirks;
+
+ dmi_id = dmi_first_match(fwbug_list);
+ if (!dmi_id)
+ return;
+
+ quirks = dmi_id->driver_data;
+ if (quirks->supported_func) {
+ dev->supported_func = quirks->supported_func;
+ pr_info("Using supported funcs quirk to avoid %s platform firmware bug\n",
+ dmi_id->ident);
+ }
+}
+